diff --git a/environments/squirrel.yml b/environments/squirrel.yml new file mode 100644 index 0000000..7b103dd --- /dev/null +++ b/environments/squirrel.yml @@ -0,0 +1,17 @@ +name: squirrel +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - biopython>=1.74 + - minimap2>=2.16 + - python=3.10 + - snakemake-minimal=7.32 + - matplotlib>=3.3.1 + - gofasta + - iqtree>=2.1 + - jclusterfunk>=0.0.25 + - pip + - pip: + - git+https://github.com/aineniamh/squirrel.git@main \ No newline at end of file diff --git a/lib/WorkflowMain.groovy b/lib/WorkflowMain.groovy index bfb8f20..9c8dbd1 100644 --- a/lib/WorkflowMain.groovy +++ b/lib/WorkflowMain.groovy @@ -53,12 +53,12 @@ class WorkflowMain { // Explode on conda // conda.enabled seems to be backward compatible but wrap this // in a generic catch just in case - try { - if (workflow.session.config.conda.enabled) { - log.error "Sorry, this workflow is not compatible with Conda, please use -profile standard (Docker) or -profile singularity." - System.exit(1) - } - } catch(Exception e) {} + // try { + // if (workflow.session.config.conda.enabled) { + // log.error "Sorry, this workflow is not compatible with Conda, please use -profile standard (Docker) or -profile singularity." + // System.exit(1) + // } + // } catch(Exception e) {} // Validate workflow parameters via the JSON schema if (params.validate_params) { diff --git a/modules/illumina.nf b/modules/illumina.nf index 3b45224..dc26c9d 100644 --- a/modules/illumina.nf +++ b/modules/illumina.nf @@ -52,7 +52,7 @@ process align_trim { container 'community.wave.seqera.io/library/pysam_samtools_numpy_pandas:0ef969f9a905399f' - conda 'bioconda::pysam=0.22.1', 'bioconda::samtools=1.12', 'conda-forge::numpy=2.1.1', 'conda-forge::pandas=2.2.2' + conda 'bioconda::pysam=0.22.1 bioconda::samtools=1.12 conda-forge::numpy=2.1.1 conda-forge::pandas=2.2.2' publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "${sampleName}.primertrimmed.rg.sorted.bam*", mode: 'copy' publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "${sampleName}.amplicon_depths.tsv", mode: 'copy' @@ -94,7 +94,7 @@ process indexReference { container 'community.wave.seqera.io/library/bwa:0.7.18--324359fbc6e00dba' - conda 'bioconda::bwa=0.7.17' + conda 'bioconda::bwa=0.7.18' input: path(ref) @@ -122,7 +122,7 @@ process readMapping { container 'community.wave.seqera.io/library/bwa_samtools:3938c84206f62975' - conda 'bioconda::bwa=0.7.18', 'bioconda::samtools=1.12' + conda 'bioconda::bwa=0.7.18 bioconda::samtools=1.12' publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "${sampleName}.sorted{.bam,.bam.bai}", mode: 'copy' @@ -149,7 +149,7 @@ process callConsensusFreebayes { container 'community.wave.seqera.io/library/bcftools_freebayes_pysam_tabix:c16cddc9a1a28b82' - conda 'bioconda::freebayes=1.3.6', 'bioconda::bcftools=1.20', 'bioconda::pysam=0.22.1', 'bioconda::tabix=1.11' + conda 'bioconda::freebayes=1.3.6 bioconda::bcftools=1.20 bioconda::pysam=0.22.1 bioconda::tabix=1.11' publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "${sampleName}.consensus.fa", mode: 'copy' publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "${sampleName}.variants.norm.vcf", mode: 'copy' diff --git a/modules/qc.nf b/modules/qc.nf index c0421ba..0d8944f 100644 --- a/modules/qc.nf +++ b/modules/qc.nf @@ -6,7 +6,7 @@ process makeQCCSV { container 'community.wave.seqera.io/library/samtools_biopython_matplotlib_pandas:2bb143fe29dc1ce9' - conda "conda-forge::matplotlib=3.9.2", "conda-forge::pandas=2.2.2", "conda-forge::biopython=1.84", "bioconda::samtools=1.20" + conda "conda-forge::matplotlib=3.9.2 conda-forge::pandas=2.2.2 conda-forge::biopython=1.84 bioconda::samtools=1.20" publishDir "${params.outdir}/qc_plots", pattern: "${sampleName}.depth.png", mode: 'copy' diff --git a/modules/squirrel.nf b/modules/squirrel.nf index 89542a6..e2642da 100644 --- a/modules/squirrel.nf +++ b/modules/squirrel.nf @@ -4,6 +4,8 @@ process squirrelAlignmentAndQC { container "docker.io/articnetworkorg/squirrel@sha256:78921da0c726dd525f5d72db331526975adb634478ee31047c46765bd3d5a64a" + conda "${projectDir}/environments/squirrel.yml" + publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "squirrel/**", mode: 'copy', saveAs: { fn -> fn.replace("squirrel/", "")} input: diff --git a/modules/utils.nf b/modules/utils.nf index ef6868a..1cd3754 100644 --- a/modules/utils.nf +++ b/modules/utils.nf @@ -1,67 +1,3 @@ -process articDownloadScheme{ - tag params.schemeRepoURL - - label 'internet' - - publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "scheme", mode: "copy" - - output: - path "scheme/**/${params.schemeVersion}/*.reference.fasta" , emit: reffasta - path "scheme/**/${params.schemeVersion}/${params.scheme}.bed" , emit: bed - path "scheme" , emit: scheme - - script: - """ - git clone ${params.schemeRepoURL} scheme - """ -} - -process get_bed_ref { - - label 'process_single' - - container 'nextflow/bash:latest' - - input: - path scheme_dir - val scheme_name - val scheme_version - output: - path "primer.bed", emit: bed - path "reference.fasta", emit: ref - path "reference.gff3", emit: gff - - """ - cp ${scheme_name}/${scheme_version}/primer.bed primer.bed - cp ${scheme_name}/${scheme_version}/reference.fasta reference.fasta - cp ${scheme_name}/${scheme_version}/reference.gff3 reference.gff3 - """ -} - -process performHostFilter { - - tag { sampleName } - - container 'community.wave.seqera.io/library/bwa_pysam_samtools_python:f3b7e3fe2ad2cadc' - - conda 'bioconda::bwa=0.7.18', 'bioconda::samtools=1.20', 'bioconda::python=3.12.5', 'bioconda::pysam=0.22.1' - - publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "${sampleName}_hostfiltered_R*.fastq.gz", mode: 'copy' - - input: - tuple val(sampleName), path(forward), path(reverse) - output: - tuple val(sampleName), path("${sampleName}_hostfiltered_R1.fastq.gz"), path("${sampleName}_hostfiltered_R2.fastq.gz"), emit: fastqPairs - - script: - """ - bwa mem -t ${task.cpus} ${params.composite_ref} ${forward} ${reverse} | \ - filter_non_human_reads.py -c ${params.viral_contig_name} > ${sampleName}.viral_and_nonmapping_reads.bam - samtools sort -n ${sampleName}.viral_and_nonmapping_reads.bam | \ - samtools fastq -1 ${sampleName}_hostfiltered_R1.fastq.gz -2 ${sampleName}_hostfiltered_R2.fastq.gz -s ${sampleName}_singletons.fastq.gz - - """ -} - process publish { publishDir "${params.outdir}/", mode: 'copy' container 'nextflow/bash:latest' diff --git a/nextflow.config b/nextflow.config index ec1f434..866f36d 100644 --- a/nextflow.config +++ b/nextflow.config @@ -5,7 +5,7 @@ manifest { description = 'Epi2me compatible Nextflow pipeline for processing ARTIC tiling amplicon Illumina sequencing reads from monkeypox virus (MPXV) samples.' mainScript = 'main.nf' nextflowVersion = '>=20.01.0' - version = '1.3.0' + version = '1.3.1' defaultBranch = 'main' }