diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bea3e12..f9d82b62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,24 @@ - ๐Ÿ› fix `ignore_3prime_r2` param #299 - ๐Ÿ› removed unused directory #297 +## Working list... + +### Pipeline Updates + +- Add `Biscuit` aligner as a separate, 3rd workflow + - Add `biscuit_index` parameter +- Add a `--save_merged` option to save merged (`cat`'d) fastq files for the same sample + +### Refactoring + +- ๐Ÿงน Refactoring of parameters, especially those that generalize across aligners: + - `--non_directional` is now under 'Alignment options' rather than 'Bismark options', as both the Bismark and Biscuit aligners support directional and non-directional alignment. + - New 'Methylation calling options' section + - `--merge_cg` replaces the former `--cytosine_report` option. Biscuit and bwa-meth produce stranded methylation calls by default, while bismark does not. This flag abstracts away all the necessary flags for each tool, and defaults to producing merged (unstranded) methylationc calls. + - `--meth_cutoff`, `--comprehensive`, and the `--ignore` parameters apply to all 3 aligners + - `--no_overlap` applies to biscuit and bismark but NOT bwa-meth + - `--nomeseq` has been moved to 'Special Library Types' as both `bismark` and `biscuit` support NOMe-seq. + ## [v2.3.0](https://github.com/nf-core/methylseq/releases/tag/2.3.0) - 2022-12-16 ### Pipeline Updates diff --git a/README.md b/README.md index 0b928113..1457b42a 100644 --- a/README.md +++ b/README.md @@ -22,23 +22,23 @@ On release, automated continuous integration tests run the pipeline on a full-si ## Pipeline Summary -The pipeline allows you to choose between running either [Bismark](https://github.com/FelixKrueger/Bismark) or [bwa-meth](https://github.com/brentp/bwa-meth) / [MethylDackel](https://github.com/dpryan79/methyldackel). -Choose between workflows by using `--aligner bismark` (default, uses bowtie2 for alignment), `--aligner bismark_hisat` or `--aligner bwameth`. - -| Step | Bismark workflow | bwa-meth workflow | -| -------------------------------------------- | ---------------- | --------------------- | -| Generate Reference Genome Index _(optional)_ | Bismark | bwa-meth | -| Merge re-sequenced FastQ files | cat | cat | -| Raw data QC | FastQC | FastQC | -| Adapter sequence trimming | Trim Galore! | Trim Galore! | -| Align Reads | Bismark | bwa-meth | -| Deduplicate Alignments | Bismark | Picard MarkDuplicates | -| Extract methylation calls | Bismark | MethylDackel | -| Sample report | Bismark | - | -| Summary Report | Bismark | - | -| Alignment QC | Qualimap | Qualimap | -| Sample complexity | Preseq | Preseq | -| Project Report | MultiQC | MultiQC | +The pipeline allows you to choose between running either [Bismark](https://github.com/FelixKrueger/Bismark), [bwa-meth](https://github.com/brentp/bwa-meth) / [MethylDackel](https://github.com/dpryan79/methyldackel), or [biscuit](https://huishenlab.github.io/biscuit/). +Choose between workflows by using `--aligner bismark` (default, uses bowtie2 for alignment), `--aligner bismark_hisat`, `--aligner bwameth`, or `--aligner biscuit`. + +| Step | Bismark workflow | bwa-meth workflow | Biscuit workflow | +| -------------------------------------------- | ---------------- | --------------------- | ---------------- | +| Generate Reference Genome Index _(optional)_ | Bismark | bwa-meth | Biscuit `index` | +| Merge re-sequenced FastQ files | cat | cat | cat | +| Raw data QC | FastQC | FastQC | FastQC | +| Adapter sequence trimming | Trim Galore! | Trim Galore! | Cutadapt | +| Align Reads | Bismark | bwa-meth | biscuit `align` | +| Deduplicate Alignments | Bismark | Picard MarkDuplicates | samblaster | +| Extract methylation calls | Bismark | MethylDackel | Biscuit `pileup` | +| Sample report | Bismark | - | Biscuit `qc` | +| Summary Report | Bismark | - | Biscuit `qc` | +| Alignment QC | Qualimap | Qualimap | Qualimap | +| Sample complexity | Preseq | Preseq | Preseq | +| Project Report | MultiQC | MultiQC | MultiQC | ## Usage diff --git a/conf/modules.config b/conf/modules.config index 5c55e852..5cccac91 100755 --- a/conf/modules.config +++ b/conf/modules.config @@ -34,6 +34,15 @@ process { ] } + withName: CAT_FASTQ { + publishDir = [ + path: { "${params.outdir}/merged_fastq" }, + mode: params.publish_dir_mode, + pattern: '*.gz', + enabled: params.save_merged + ] + } + withName: FASTQC { ext.args = '--quiet' publishDir = [ @@ -209,11 +218,11 @@ process { params.comprehensive ? ' --comprehensive --merge_non_CpG' : '', params.meth_cutoff ? " --cutoff ${params.meth_cutoff}" : '', params.nomeseq ? '--CX' : '', - params.ignore_r1 > 0 ? "--ignore ${params.ignore_r1}" : '', - params.ignore_3prime_r1 > 0 ? "--ignore_3prime ${params.ignore_3prime_r1}" : '', - meta.single_end ? '' : (params.no_overlap ? ' --no_overlap' : '--include_overlap'), - meta.single_end ? '' : (params.ignore_r2 > 0 ? "--ignore_r2 ${params.ignore_r2}" : ""), - meta.single_end ? '' : (params.ignore_3prime_r2 > 0 ? "--ignore_3prime_r2 ${params.ignore_3prime_r2}": "") + meta.single_end ? '' : (params.no_overlap ? ' --no_overlap' : '--include_overlap'), + meta.single_end ? '' : (params.ignore > 0 ? "--ignore ${params.ignore}" : ""), + meta.single_end ? '' : (params.ignore_3prime > 0 ? "--ignore_3prime ${params.ignore_3prime}" : ""), + meta.single_end ? '' : (params.ignore_r2 > 0 ? "--ignore_r2 ${params.ignore_r2}" : ""), + meta.single_end ? '' : (params.ignore_3prime_r2 > 0 ? "--ignore_r2 ${params.ignore_3prime_r2}" : "") ].join(' ').trim() } publishDir = [ [ @@ -304,6 +313,173 @@ process { ] } + withName: BISCUIT_INDEX { + ext.args = '' + publishDir = [ + path: { "${params.outdir}/${params.aligner}/reference_genome" }, + saveAs: { it =~ /.*\.yml/ ? null : it }, + mode: params.publish_dir_mode, + enabled: params.save_reference + ] + } + + withName: BISCUIT_ALIGN { + ext.args = { [ + // Use directional alignment (align read 1 to parent, read 2 to daughter). + // Note that `pbat` libaries are directional, but 'backwards' (read 1 aligns to daughter); + // this 'inversion' is handled in the `biscuit` subworkflow by reversing read 1 and read 2 if `pbat` is set. + ( params.pbat || params.single_cell || params.zymo || (!params.non_directional) ) ? '-b 1' : '', + ].join(' ').trim() } + ext.args2 = '' + publishDir = [ + [ + path: { "${params.outdir}/${params.aligner}/alignments/raw" }, + mode: params.publish_dir_mode, + pattern: "*.bam.*", + enabled: (params.save_align_intermeds || params.skip_deduplication || params.rrbs) + ] + ] + } + + withName: BISCUIT_BLASTER { + ext.args = { [ + // Use directional alignment (align read 1 to parent, read 2 to daughter). + // Note that `pbat` libaries are directional, but 'backwards' (read 1 aligns to daughter); + // this 'inversion' is handled in the `biscuit` subworkflow by reversing read 1 and read 2 if `pbat` is set. + ( params.pbat || params.single_cell || params.zymo || (!params.non_directional) ) ? '-b 1' : '', + ].join(' ').trim() } + ext.args2 = { [ + meta.single_end ? "--ignoreUnmated" : "" + ].join(' ').trim() } + ext.args3 = '' + publishDir = [ + [ + path: { "${params.outdir}/${params.aligner}/alignments/dup_marked" }, + mode: params.publish_dir_mode, + pattern: "*.bam*", + enabled: (params.save_align_intermeds || params.skip_deduplication || params.rrbs) + ] + ] + } + + withName: BISCUIT_BSCONV { + ext.prefix = { "${meta.id}_bsconv" } + ext.args = { "-f ${params.bs_conv_filter}" } + publishDir = [ + path: { "${params.outdir}/${params.aligner}/alignments/bisulfite_conversion_filtered" }, + mode: params.publish_dir_mode, + pattern: "*.bam", + enabled: params.save_align_intermeds + ] + } + + withName: BISCUIT_PILEUP { + errorStrategy = 'retry' + maxRetries = 3 + ext.args = { [ + params.no_overlap ? '' : '-d', + params.nomeseq ? '-N' : '', + params.ignore > 0 ? "-5 ${params.ignore}" : '', + params.ignore_3prime > 0 ? "-3 ${params.ignore_3prime}" : '', + ].join(' ').trim() } + publishDir = [ + path: { "${params.outdir}/${params.aligner}/snp_data/" }, + mode: params.publish_dir_mode, + enabled: params.save_align_intermeds, + pattern: "*.vcf.gz" + ] + } + + withName: BISCUIT_VCF2BED { + ext.args = { [ + (params.meth_cutoff) ? "-k ${params.meth_cutoff}" : '-k 1', + (params.comprehensive) ? '-t c' : '', + (params.nomeseq) ? '-t hcg' : '' + ].join(' ').trim() } + publishDir = [ + path: { "${params.outdir}/${params.aligner}/methylation_calls/" }, + mode: params.publish_dir_mode, + enabled: !params.merge_cg, + pattern: "*.bed.gz" + ] + } + + withName: BISCUIT_VCF2BED_NOME { + ext.args = { [ + (params.meth_cutoff) ? "-k ${params.meth_cutoff}" : '-k 1', + (params.nomeseq) ? '-t gch' : '' + ].join(' ').trim() } + publishDir = [ + path: { "${params.outdir}/${params.aligner}/accessibility_data/" }, + mode: params.publish_dir_mode, + enabled: !params.merge_cg, + pattern: "*.bed.gz" + ] + } + + withName: BISCUIT_MERGECG { + ext.prefix = { "${meta.id}_mergecg" } + ext.args = '' + publishDir = [ + path: { "${params.outdir}/${params.aligner}/methylation_calls/" }, + mode: params.publish_dir_mode, + enabled: params.merge_cg, + pattern: "*.bed.gz" + ] + } + + withName: BISCUIT_MERGECG_NOME { + ext.prefix = { "${meta.id}_mergecg" } + ext.args = '-N' + publishDir = [ + path: { "${params.outdir}/${params.aligner}/accessibility_data/" }, + mode: params.publish_dir_mode, + enabled: params.merge_cg, + pattern: "*.bed.gz" + ] + } + + withName: BISCUIT_QC { + ext.args = '' + publishDir = [ + [ + path: { "${params.outdir}/${params.aligner}/qc/mbias/cpg" }, + mode: params.publish_dir_mode, + pattern: "*_CpGRetentionByReadPos.txt" + ], + [ + path: { "${params.outdir}/${params.aligner}/qc/mbias/cph" }, + mode: params.publish_dir_mode, + pattern: "*_CpHRetentionByReadPos.txt" + ], + [ + path: { "${params.outdir}/${params.aligner}/qc/dup_report/" }, + mode: params.publish_dir_mode, + pattern: "*_dup_report.txt" + ], + [ + path: { "${params.outdir}/${params.aligner}/qc/insert_size/" }, + mode: params.publish_dir_mode, + pattern: "*_isize_table.txt" + ], + [ + path: { "${params.outdir}/${params.aligner}/qc/mapping_qual/" }, + mode: params.publish_dir_mode, + pattern: "*_mapq_table.txt" + ], + [ + path: { "${params.outdir}/${params.aligner}/qc/mapping_strand/" }, + mode: params.publish_dir_mode, + pattern: "*_strand_table.txt" + ], + [ + path: { "${params.outdir}/${params.aligner}/qc/conversion/" }, + mode: params.publish_dir_mode, + pattern: "*_totalReadConversionRate.txt" + ], + ] + } + withName: PICARD_MARKDUPLICATES { ext.args = "--ASSUME_SORTED true --REMOVE_DUPLICATES false --VALIDATION_STRINGENCY LENIENT --PROGRAM_RECORD_ID 'null' --TMP_DIR tmp" ext.prefix = { "${meta.id}.markdup.sorted" } @@ -381,6 +557,18 @@ process { ] } + withName: SAMTOOLS_INDEX_BSCONV { + ext.args = "" + publishDir = [ + [ + path: { "${params.outdir}/${params.aligner}/alignments/bisulfite_conversion_filtered" }, + mode: params.publish_dir_mode, + pattern: "*.bai", + enabled: params.save_align_intermeds + ] + ] + } + withName: SAMTOOLS_INDEX_DEDUPLICATED { ext.args = "" publishDir = [ @@ -407,12 +595,17 @@ process { } withName: METHYLDACKEL_EXTRACT { - ext.args = [ - params.comprehensive ? ' --CHG --CHH' : '', - params.ignore_flags ? " --ignoreFlags" : '', - params.methyl_kit ? " --methylKit" : '', - params.min_depth > 0 ? " --minDepth ${params.min_depth}" : '' - ].join(" ").trim() + ext.args = { + def simple_args = [ + params.comprehensive ? ' --CHG --CHH' : '', + params.ignore_flags ? " --ignoreFlags" : '', + params.methyl_kit ? " --methylKit" : '', + params.meth_cutoff ? " --minDepth ${params.meth_cutoff}" : '', + ].join(" ") + def ignore_bases = [params.ignore, params.ignore_3prime, params.ignore_r2, params.ignore_3prime_r2].join(",") + def ignore_args = ["--nOT", "--nOB", "--nCTOT", "--nCTOB"].collect { "$it $ignore_bases" }.join(" ") + return [simple_args, ignore_args].join(" ").trim() + } publishDir = [ [ path: { "${params.outdir}/methyldackel" }, diff --git a/main.nf b/main.nf index 4b926ef1..8ecd346b 100644 --- a/main.nf +++ b/main.nf @@ -20,6 +20,7 @@ nextflow.enable.dsl = 2 params.fasta = WorkflowMain.getGenomeAttribute(params, 'fasta') params.fasta_index = WorkflowMain.getGenomeAttribute(params, 'fasta_index') params.bismark_index = WorkflowMain.getGenomeAttribute(params, 'bismark') +params.biscuit_index = WorkflowMain.getGenomeAttribute(params, 'biscuit') params.bwa_meth_index = WorkflowMain.getGenomeAttribute(params, 'bwa_meth') /* diff --git a/modules.json b/modules.json index bf351c59..a4e35c20 100644 --- a/modules.json +++ b/modules.json @@ -5,138 +5,246 @@ "https://github.com/nf-core/modules.git": { "modules": { "nf-core": { + "biscuit/align": { + "branch": "master", + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] + }, + "biscuit/biscuitblaster": { + "branch": "master", + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] + }, + "biscuit/bsconv": { + "branch": "master", + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] + }, + "biscuit/index": { + "branch": "master", + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] + }, + "biscuit/mergecg": { + "branch": "master", + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] + }, + "biscuit/pileup": { + "branch": "master", + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] + }, + "biscuit/qc": { + "branch": "master", + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] + }, + "biscuit/vcf2bed": { + "branch": "master", + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] + }, "bismark/align": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] }, "bismark/coverage2cytosine": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] }, "bismark/deduplicate": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] }, "bismark/genomepreparation": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] }, "bismark/methylationextractor": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] }, "bismark/report": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] }, "bismark/summary": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] }, "bwameth/align": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] }, "bwameth/index": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] }, "cat/fastq": { "branch": "master", - "git_sha": "5c460c5a4736974abde2843294f35307ee2b0e5e", - "installed_by": ["modules"] + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] }, "custom/dumpsoftwareversions": { "branch": "master", "git_sha": "37dee863936732fe7e05dc598bf6e183a8e7ef73", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "fastqc": { "branch": "master", - "git_sha": "65ad3e0b9a4099592e1102e92e10455dc661cf53", - "installed_by": ["modules"] + "git_sha": "617777a807a1770f73deb38c80004bac06807eef", + "installed_by": [ + "modules" + ] }, "methyldackel/extract": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] }, "methyldackel/mbias": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] }, "multiqc": { "branch": "master", "git_sha": "642a0d8afe373ac45244a7947fb8a6c0a5a312d4", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "picard/markduplicates": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "git_sha": "20b0918591d4ba20047d7e13e5094bcceba81447", + "installed_by": [ + "modules" + ] }, "preseq/lcextrap": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "git_sha": "990d7f86d43f90187236967980337141943e0a79", + "installed_by": [ + "modules" + ] }, "qualimap/bamqc": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] }, "qualimap/bamqccram": { "branch": "master", - "git_sha": "603ecbd9f45300c9788f197d2a15a005685b4220", - "installed_by": ["modules"] + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] }, "samtools/faidx": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", + "installed_by": [ + "modules" + ] }, "samtools/flagstat": { "branch": "master", - "git_sha": "570ec5bcfe19c49e16c9ca35a7a116563af6cc1c", - "installed_by": ["modules"] + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", + "installed_by": [ + "modules" + ] }, "samtools/index": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", + "installed_by": [ + "modules" + ] }, "samtools/sort": { "branch": "master", - "git_sha": "a0f7be95788366c1923171e358da7d049eb440f9", - "installed_by": ["modules"] + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", + "installed_by": [ + "modules" + ] }, "samtools/stats": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", + "installed_by": [ + "modules" + ] }, "trimgalore": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] }, "untar": { "branch": "master", - "git_sha": "8fc1d24c710ebe1d5de0f2447ec9439fd3d9d66a", - "installed_by": ["modules"] + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": [ + "modules" + ] } } } } } -} +} \ No newline at end of file diff --git a/modules/nf-core/biscuit/align/environment.yml b/modules/nf-core/biscuit/align/environment.yml new file mode 100644 index 00000000..90e26ee6 --- /dev/null +++ b/modules/nf-core/biscuit/align/environment.yml @@ -0,0 +1,8 @@ +name: biscuit_align +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::biscuit=1.1.0.20220707 + - bioconda::samtools=1.16.1 diff --git a/modules/nf-core/biscuit/align/main.nf b/modules/nf-core/biscuit/align/main.nf new file mode 100644 index 00000000..51547487 --- /dev/null +++ b/modules/nf-core/biscuit/align/main.nf @@ -0,0 +1,45 @@ +process BISCUIT_ALIGN { + tag "$meta.id" + label 'process_high' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-d94f582b04a3edcede1215189c0d881506640fd9:6519548ea4f3d6a526c78ad0350c58f867f28574-0': + 'biocontainers/mulled-v2-d94f582b04a3edcede1215189c0d881506640fd9:6519548ea4f3d6a526c78ad0350c58f867f28574-0' }" + + input: + tuple val(meta), path(reads) + path index + + output: + tuple val(meta), path("*.bam"), emit: bam + tuple val(meta), path("*.bai"), emit: bai + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def biscuit_cpus = (int) Math.max(Math.floor(task.cpus*0.9),1) + def samtools_cpus = task.cpus-biscuit_cpus + """ + INDEX=`find -L ./ -name "*.bis.amb" | sed 's/\\.bis.amb\$//'` + + biscuit align \\ + $args \\ + -@ $biscuit_cpus \\ + \$INDEX \\ + $reads \\ + | samtools sort $args2 --threads $samtools_cpus --write-index -o ${prefix}.bam##idx##${prefix}.bam.bai - + + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + biscuit: \$( biscuit version |& sed '1!d; s/^.*BISCUIT Version: //' ) + samtools: \$( samtools --version |& sed '1!d; s/^.*samtools //' ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/biscuit/align/meta.yml b/modules/nf-core/biscuit/align/meta.yml new file mode 100644 index 00000000..ba75da1c --- /dev/null +++ b/modules/nf-core/biscuit/align/meta.yml @@ -0,0 +1,54 @@ +name: biscuit_align +description: Aligns single- or paired-end reads from bisulfite-converted libraries to a reference genome using Biscuit. +keywords: + - biscuit + - DNA methylation + - WGBS + - scWGBS + - bisulfite sequencing + - aligner + - bam +tools: + - biscuit: + description: A utility for analyzing sodium bisulfite conversion-based DNA methylation/modification data + homepage: https://huishenlab.github.io/biscuit/ + documentation: https://huishenlab.github.io/biscuit/docs/alignment + tool_dev_url: https://github.com/huishenlab/biscuit + licence: ["MIT"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: | + List of input fastq files of size 1 and 2 for single-end and paired-end data, + respectively. + - index: + type: directory + description: Biscuit genome index directory (generated with 'biscuit index') + pattern: "BiscuitIndex" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: Output BAM file containing read alignments + pattern: "*.{bam}" + - bai: + type: file + description: Output BAM index + pattern: "*.{bai}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@njspix" +maintainers: + - "@njspix" diff --git a/modules/nf-core/biscuit/biscuitblaster/environment.yml b/modules/nf-core/biscuit/biscuitblaster/environment.yml new file mode 100644 index 00000000..1cf1fbc0 --- /dev/null +++ b/modules/nf-core/biscuit/biscuitblaster/environment.yml @@ -0,0 +1,9 @@ +name: biscuit_blaster +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::biscuit=1.1.0.20220707 + - bioconda::samblaster=0.1.26 + - bioconda::samtools=1.16.1 diff --git a/modules/nf-core/biscuit/biscuitblaster/main.nf b/modules/nf-core/biscuit/biscuitblaster/main.nf new file mode 100644 index 00000000..bb79d050 --- /dev/null +++ b/modules/nf-core/biscuit/biscuitblaster/main.nf @@ -0,0 +1,52 @@ +process BISCUIT_BLASTER { + tag "$meta.id" + label 'process_high' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-d94f582b04a3edcede1215189c0d881506640fd9:6519548ea4f3d6a526c78ad0350c58f867f28574-0': + 'biocontainers/mulled-v2-d94f582b04a3edcede1215189c0d881506640fd9:6519548ea4f3d6a526c78ad0350c58f867f28574-0' }" + + input: + tuple val(meta), path(reads) + path index + + output: + tuple val(meta), path("*.bam"), emit: bam + tuple val(meta), path("*.bai"), emit: bai + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def prefix = task.ext.prefix ?: "${meta.id}" + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def args3 = task.ext.args3 ?: '' + def biscuit_cpus = (int) Math.max(Math.floor(task.cpus*0.95),1) + def samtools_cpus = task.cpus-biscuit_cpus + """ + INDEX=`find -L ./ -name "*.bis.amb" | sed 's/\\.bis.amb\$//'` + + biscuit align \\ + -@ $biscuit_cpus \\ + $args \\ + \$INDEX \\ + $reads | \\ + samblaster \\ + $args2 | \\ + samtools sort \\ + -@ $samtools_cpus \\ + $args3 \\ + --write-index \\ + -o ${prefix}.bam##idx##${prefix}.bam.bai + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + biscuit: \$( biscuit version |& sed '1!d; s/^.*BISCUIT Version: //' ) + samtools: \$( samtools --version |& sed '1!d; s/^.*samtools //' ) + samblaster: \$( samblaster --version |& sed 's/^.*samblaster: Version //' ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/biscuit/biscuitblaster/meta.yml b/modules/nf-core/biscuit/biscuitblaster/meta.yml new file mode 100644 index 00000000..1aa16365 --- /dev/null +++ b/modules/nf-core/biscuit/biscuitblaster/meta.yml @@ -0,0 +1,73 @@ +name: biscuit_blaster +description: A fast, compact one-liner to produce duplicate-marked, sorted, and indexed BAM files using Biscuit +keywords: + - biscuit + - DNA methylation + - WGBS + - scWGBS + - bisulfite sequencing + - aligner + - bam +tools: + - biscuit: + description: A utility for analyzing sodium bisulfite conversion-based DNA methylation/modification data + homepage: https://huishenlab.github.io/biscuit/ + documentation: https://huishenlab.github.io/biscuit/biscuitblaster/ + tool_dev_url: https://github.com/huishenlab/biscuit + licence: ["MIT"] + - samblaster: + description: | + samblaster is a fast and flexible program for marking duplicates in read-id grouped paired-end SAM files. + It can also optionally output discordant read pairs and/or split read mappings to separate SAM files, + and/or unmapped/clipped reads to a separate FASTQ file. + By default, samblaster reads SAM input from stdin and writes SAM to stdout. + documentation: https://github.com/GregoryFaust/samblaster + tool_dev_url: https://github.com/GregoryFaust/samblaster + doi: "10.1093/bioinformatics/btu314" + licence: ["MIT"] + - samtools: + description: | + SAMtools is a set of utilities for interacting with and post-processing + short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li. + These files are generated as output by short read aligners like BWA. + homepage: http://www.htslib.org/ + documentation: http://www.htslib.org/doc/samtools.html + doi: 10.1093/bioinformatics/btp352 + licence: ["MIT"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: | + List of input fastq files of size 1 and 2 for single-end and paired-end data, + respectively. + - index: + type: directory + description: Biscuit genome index directory (generated with 'biscuit index') + pattern: "BiscuitIndex" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: Output BAM file containing read alignments + pattern: "*.{bam}" + - bai: + type: file + description: Output BAM index + pattern: "*.{bai}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@njspix" +maintainers: + - "@njspix" diff --git a/modules/nf-core/biscuit/bsconv/environment.yml b/modules/nf-core/biscuit/bsconv/environment.yml new file mode 100644 index 00000000..937dbadf --- /dev/null +++ b/modules/nf-core/biscuit/bsconv/environment.yml @@ -0,0 +1,7 @@ +name: biscuit_bsconv +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::biscuit=1.1.0.20220707 diff --git a/modules/nf-core/biscuit/bsconv/main.nf b/modules/nf-core/biscuit/bsconv/main.nf new file mode 100644 index 00000000..1d7f1240 --- /dev/null +++ b/modules/nf-core/biscuit/bsconv/main.nf @@ -0,0 +1,40 @@ +process BISCUIT_BSCONV { + tag "$meta.id" + label 'process_long' + + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/biscuit:1.1.0.20220707--he272189_1': + 'biocontainers/biscuit:1.1.0.20220707--he272189_1' }" + + input: + tuple val(meta), path(bam), path(bai) + path(index) + + output: + tuple val(meta), path("*.bam"), emit: bsconv_bam + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + if ("$bam" == "${prefix}.bam") error "Input and output names are the same, set prefix in module configuration to disambiguate!" + """ + INDEX=`find -L ./ -name "*.bis.amb" | sed 's/\\.bis.amb\$//'` + + biscuit bsconv \\ + $args \\ + \$INDEX \\ + $bam \\ + ${prefix}.bam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + biscuit: \$( biscuit version |& sed '1!d; s/^.*BISCUIT Version: //' ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/biscuit/bsconv/meta.yml b/modules/nf-core/biscuit/bsconv/meta.yml new file mode 100644 index 00000000..e0919db3 --- /dev/null +++ b/modules/nf-core/biscuit/bsconv/meta.yml @@ -0,0 +1,52 @@ +name: biscuit_bsconv +description: Summarize and/or filter reads based on bisulfite conversion rate +keywords: + - biscuit + - DNA methylation + - WGBS + - scWGBS + - bisulfite sequencing + - aligner + - bam + - filter +tools: + - biscuit: + description: A utility for analyzing sodium bisulfite conversion-based DNA methylation/modification data + homepage: https://huishenlab.github.io/biscuit/ + documentation: https://huishenlab.github.io/biscuit/docs/subcommand_help.html#biscuit-bsconv + tool_dev_url: https://github.com/huishenlab/biscuit + licence: ["MIT"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM file contained mapped reads + - bai: + type: file + description: BAM file index + - index: + type: dir + description: Biscuit genome index directory (generated with 'biscuit index') + pattern: "BiscuitIndex" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bsconv_bam: + type: file + description: Output BAM file containing filtered read alignments + pattern: "*.{bam}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@njspix" +maintainers: + - "@njspix" diff --git a/modules/nf-core/biscuit/index/environment.yml b/modules/nf-core/biscuit/index/environment.yml new file mode 100644 index 00000000..66b9fde8 --- /dev/null +++ b/modules/nf-core/biscuit/index/environment.yml @@ -0,0 +1,7 @@ +name: biscuit_index +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::biscuit=1.1.0.20220707 diff --git a/modules/nf-core/biscuit/index/main.nf b/modules/nf-core/biscuit/index/main.nf new file mode 100644 index 00000000..5ed6a417 --- /dev/null +++ b/modules/nf-core/biscuit/index/main.nf @@ -0,0 +1,33 @@ +process BISCUIT_INDEX { + tag "$fasta" + label 'process_long' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/biscuit:1.1.0.20220707--he272189_1': + 'biocontainers/biscuit:1.1.0.20220707--he272189_1' }" + + input: + path fasta, stageAs: "BiscuitIndex/*" + + output: + path "BiscuitIndex/*.fa*", emit: index, includeInputs: true + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + """ + biscuit \\ + index \\ + $args \\ + $fasta + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + biscuit: \$( biscuit version |& sed '1!d; s/^.*BISCUIT Version: //' ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/biscuit/index/meta.yml b/modules/nf-core/biscuit/index/meta.yml new file mode 100644 index 00000000..d7a7d449 --- /dev/null +++ b/modules/nf-core/biscuit/index/meta.yml @@ -0,0 +1,35 @@ +name: biscuit_index +description: Indexes a reference genome for use with Biscuit +keywords: + - biscuit + - DNA methylation + - WGBS + - scWGBS + - bisulfite sequencing + - index + - reference + - fasta +tools: + - biscuit: + description: A utility for analyzing sodium bisulfite conversion-based DNA methylation/modification data + homepage: https://huishenlab.github.io/biscuit/ + documentation: https://huishenlab.github.io/biscuit/docs/alignment + tool_dev_url: https://github.com/huishenlab/biscuit + licence: ["MIT"] +input: + - fasta: + type: file + description: Input genome fasta file +output: + - index: + type: dir + description: Biscuit genome index directory + pattern: "BiscuitIndex" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@njspix" +maintainers: + - "@njspix" diff --git a/modules/nf-core/biscuit/mergecg/environment.yml b/modules/nf-core/biscuit/mergecg/environment.yml new file mode 100644 index 00000000..eb9d77b4 --- /dev/null +++ b/modules/nf-core/biscuit/mergecg/environment.yml @@ -0,0 +1,8 @@ +name: biscuit_mergecg +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::biscuit=1.1.0.20220707 + - bioconda::samtools=1.16.1 diff --git a/modules/nf-core/biscuit/mergecg/main.nf b/modules/nf-core/biscuit/mergecg/main.nf new file mode 100644 index 00000000..6d1768fc --- /dev/null +++ b/modules/nf-core/biscuit/mergecg/main.nf @@ -0,0 +1,44 @@ +process BISCUIT_MERGECG { + tag "$meta.id" + label 'process_long' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-d94f582b04a3edcede1215189c0d881506640fd9:6519548ea4f3d6a526c78ad0350c58f867f28574-0': + 'biocontainers/mulled-v2-d94f582b04a3edcede1215189c0d881506640fd9:6519548ea4f3d6a526c78ad0350c58f867f28574-0' }" + + + input: + tuple val(meta), path(bed) + path index + + output: + tuple val(meta), path("*.bed.gz"), emit: mergecg_bed + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + INDEX=`find -L ./ -name "*.bis.amb" | sed 's/\\.bis.amb\$//'` + + biscuit mergecg \\ + $args \\ + \$INDEX \\ + $bed | \\ + LC_ALL=C sort -k1,1 -k2,2n | \\ + bgzip \\ + $args2 \\ + -c > ${prefix}.bed.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + biscuit: \$( biscuit version |& sed '1!d; s/^.*BISCUIT Version: //' ) + samtools: \$( samtools --version |& sed '1!d; s/^.*samtools //' ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/biscuit/mergecg/meta.yml b/modules/nf-core/biscuit/mergecg/meta.yml new file mode 100644 index 00000000..99570c81 --- /dev/null +++ b/modules/nf-core/biscuit/mergecg/meta.yml @@ -0,0 +1,49 @@ +name: biscuit_mergecg +description: Merges methylation information for opposite-strand C's in a CpG context +keywords: + - biscuit + - DNA methylation + - WGBS + - scWGBS + - bisulfite sequencing + - aligner + - bed +tools: + - biscuit: + description: A utility for analyzing sodium bisulfite conversion-based DNA methylation/modification data + homepage: https://huishenlab.github.io/biscuit/ + documentation: https://huishenlab.github.io/biscuit/docs/methylextraction.html + tool_dev_url: https://github.com/huishenlab/biscuit + licence: ["MIT"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bed: + type: file + description: | + Biscuit BED file (output of biscuit vcf2bed) + - index: + type: directory + description: Biscuit genome index directory (generated with 'biscuit index') + pattern: "BiscuitIndex" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - mergecg_bed: + type: file + description: Gzipped BED file with merged methylation information + pattern: "*.bed.gz" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@njspix" +maintainers: + - "@njspix" diff --git a/modules/nf-core/biscuit/pileup/environment.yml b/modules/nf-core/biscuit/pileup/environment.yml new file mode 100644 index 00000000..60132b4d --- /dev/null +++ b/modules/nf-core/biscuit/pileup/environment.yml @@ -0,0 +1,8 @@ +name: biscuit_pileup +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::biscuit=1.1.0.20220707 + - bioconda::samtools=1.16.1 diff --git a/modules/nf-core/biscuit/pileup/main.nf b/modules/nf-core/biscuit/pileup/main.nf new file mode 100644 index 00000000..43b151c3 --- /dev/null +++ b/modules/nf-core/biscuit/pileup/main.nf @@ -0,0 +1,45 @@ +process BISCUIT_PILEUP { + tag "$meta.id" + label 'process_high' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-d94f582b04a3edcede1215189c0d881506640fd9:6519548ea4f3d6a526c78ad0350c58f867f28574-0': + 'biocontainers/mulled-v2-d94f582b04a3edcede1215189c0d881506640fd9:6519548ea4f3d6a526c78ad0350c58f867f28574-0' }" + + input: + tuple val(meta), path(normal_bams), path(normal_bais), path(tumor_bam), path(tumor_bai) + path index + + output: + tuple val(meta), path("*.vcf.gz"), emit: vcf + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def biscuit_cpus = (int) Math.max(Math.floor(task.cpus*0.9),1) + def bgzip_cpus = task.cpus-biscuit_cpus + if ( tumor_bam != [] && normal_bams.toList().size() > 1 ) error "[BISCUIT_PILEUP] error: Tumor BAM provided with more than one normal BAM" + if ( tumor_bam.toList().size() > 1 ) error "[BISCUIT_PILEUP] error: more than one tumor BAM provided" + input = ( tumor_bam==[] ) ? "${normal_bams}" : "-S -T ${tumor_bam} -I ${normal_bams}" + """ + INDEX=`find -L ./ -name "*.bis.amb" | sed 's/\\.bis.amb\$//'` + + biscuit pileup \\ + -@ $biscuit_cpus \\ + $args \\ + \$INDEX \\ + $input \\ + | bgzip -@ $bgzip_cpus $args2 > ${prefix}.vcf.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + biscuit: \$( biscuit version |& sed '1!d; s/^.*BISCUIT Version: //' ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/biscuit/pileup/meta.yml b/modules/nf-core/biscuit/pileup/meta.yml new file mode 100644 index 00000000..b32d564e --- /dev/null +++ b/modules/nf-core/biscuit/pileup/meta.yml @@ -0,0 +1,68 @@ +name: biscuit_pileup +description: Computes cytosine methylation and callable SNV mutations, optionally in reference to a germline BAM to call somatic variants +keywords: + - bisulfite + - DNA methylation + - pileup + - variant calling + - WGBS + - scWGBS + - bam + - vcf +tools: + - biscuit: + description: A utility for analyzing sodium bisulfite conversion-based DNA methylation/modification data + homepage: https://huishenlab.github.io/biscuit/ + documentation: https://huishenlab.github.io/biscuit/docs/pileup.html + tool_dev_url: https://github.com/huishenlab/biscuit + licence: ["MIT"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - normal_bams: + type: file + description: | + BAM files to be analyzed. If no tumor_bam file is provided, any number of "normal" BAMs may be provided + ("normal" here is just a semantic issue, these BAMs could be from tumor or any other kind of tissue). If a + tumor BAM file is provided, exactly one normal (germline) BAM must be provided. + pattern: "*.{bam}" + - normal_bais: + type: file + description: BAM index file or files corresponding to the provided normal_bams + pattern: "*.{bai}" + - tumor_bam: + type: file + description: | + Optional. If a tumor BAM file is provided, pileup will run in "somatic" mode and will annotate variants with + their somatic state (present in tumor only, present in normal only, present in both, etc). Note that if a + tumor BAM file is provided, exactly one normal BAM must be provided. + pattern: "*.{bam}" + - tumor_bai: + type: file + description: Optional. BAM index file corresponding to provided tumor_bam + pattern: "*.{bai}" + - index: + type: directory + description: Biscuit genome index directory (generated with 'biscuit index') + pattern: "BiscuitIndex" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - vcf: + type: file + description: vcf file with methylation information + pattern: "*.{vcf.gz}" +authors: + - "@njspix" +maintainers: + - "@njspix" diff --git a/modules/nf-core/biscuit/qc/environment.yml b/modules/nf-core/biscuit/qc/environment.yml new file mode 100644 index 00000000..9e9f3a26 --- /dev/null +++ b/modules/nf-core/biscuit/qc/environment.yml @@ -0,0 +1,7 @@ +name: biscuit_qc +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::biscuit=1.1.0.20220707 diff --git a/modules/nf-core/biscuit/qc/main.nf b/modules/nf-core/biscuit/qc/main.nf new file mode 100644 index 00000000..701ff769 --- /dev/null +++ b/modules/nf-core/biscuit/qc/main.nf @@ -0,0 +1,40 @@ +process BISCUIT_QC { + tag "$meta.id" + label 'process_long' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/biscuit:1.1.0.20220707--he272189_1': + 'biocontainers/biscuit:1.1.0.20220707--he272189_1' }" + + input: + tuple val(meta), path(bam) + path(index) + + output: + tuple val(meta), path("*.txt"), emit: biscuit_qc_reports + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def se = meta.single_end ? "-s" : "" + """ + INDEX=`find -L ./ -name "*.bis.amb" | sed 's/\\.bis.amb\$//'` + + biscuit qc \\ + $args \\ + $se \\ + \$INDEX \\ + $bam \\ + $prefix + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + biscuit: \$( biscuit version |& sed '1!d; s/^.*BISCUIT Version: //' ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/biscuit/qc/meta.yml b/modules/nf-core/biscuit/qc/meta.yml new file mode 100644 index 00000000..92199338 --- /dev/null +++ b/modules/nf-core/biscuit/qc/meta.yml @@ -0,0 +1,48 @@ +name: biscuit_qc +description: Perform basic quality control on a BAM file generated with Biscuit +keywords: + - biscuit + - DNA methylation + - WGBS + - scWGBS + - bisulfite sequencing + - index + - BAM + - quality control +tools: + - biscuit: + description: A utility for analyzing sodium bisulfite conversion-based DNA methylation/modification data + homepage: https://huishenlab.github.io/biscuit/ + documentation: https://huishenlab.github.io/biscuit/docs/subcommand_help.html#biscuit-qc + tool_dev_url: https://github.com/huishenlab/biscuit + licence: ["MIT"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM file produced using Biscuit +output: + - biscuit_qc_reports: + type: file + description: | + Summary files containing the following information: + - CpG retention by position in read + - CpH retention by position in read + - Read duplication statistics + - Insert size distribution + - Distribution of mapping qualities + - Proportion of reads mapping to each strand + - Read-averaged cytosine conversion rate for CpA, CpC, CpG, and CpT + pattern: "*.txt" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@njspix" +maintainers: + - "@njspix" diff --git a/modules/nf-core/biscuit/vcf2bed/environment.yml b/modules/nf-core/biscuit/vcf2bed/environment.yml new file mode 100644 index 00000000..ed6dca0c --- /dev/null +++ b/modules/nf-core/biscuit/vcf2bed/environment.yml @@ -0,0 +1,8 @@ +name: biscuit_vcf2bed +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::biscuit=1.1.0.20220707 + - bioconda::samtools=1.16.1 diff --git a/modules/nf-core/biscuit/vcf2bed/main.nf b/modules/nf-core/biscuit/vcf2bed/main.nf new file mode 100644 index 00000000..ea8c85dc --- /dev/null +++ b/modules/nf-core/biscuit/vcf2bed/main.nf @@ -0,0 +1,39 @@ +process BISCUIT_VCF2BED { + tag "$meta.id" + label 'process_long' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-d94f582b04a3edcede1215189c0d881506640fd9:6519548ea4f3d6a526c78ad0350c58f867f28574-0': + 'biocontainers/mulled-v2-d94f582b04a3edcede1215189c0d881506640fd9:6519548ea4f3d6a526c78ad0350c58f867f28574-0' }" + + input: + tuple val(meta), path(vcf) + + output: + tuple val(meta), path("*.bed.gz"), emit: bed + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + biscuit vcf2bed \\ + $args \\ + $vcf | \\ + LC_ALL=C sort -k1,1 -k2,2n | \\ + bgzip \\ + $args2 \\ + -c > ${prefix}.bed.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + biscuit: \$(echo \$(biscuit version 2>&1) | sed 's/^.*BISCUIT Version: //; s/Using.*\$//') + samtools: \$( samtools --version |& sed '1!d; s/^.*samtools //' ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/biscuit/vcf2bed/meta.yml b/modules/nf-core/biscuit/vcf2bed/meta.yml new file mode 100644 index 00000000..f03e62c3 --- /dev/null +++ b/modules/nf-core/biscuit/vcf2bed/meta.yml @@ -0,0 +1,46 @@ +name: biscuit_vcf2bed +description: | + Summarizes methylation or SNV information from a Biscuit VCF in a + standard-compliant BED file. +keywords: + - biscuit + - DNA methylation + - WGBS + - scWGBS + - bisulfite sequencing + - aligner + - vcf +tools: + - biscuit: + description: A utility for analyzing sodium bisulfite conversion-based DNA methylation/modification data + homepage: https://huishenlab.github.io/biscuit/ + documentation: https://huishenlab.github.io/biscuit/docs/methylextraction.html + tool_dev_url: https://github.com/huishenlab/biscuit + licence: ["MIT"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: Biscuit vcf file (output of biscuit pileup) +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bed: + type: file + description: Gzipped BED file with methylation or SNV information + pattern: "*.{bed.gz}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@njspix" +maintainers: + - "@njspix" diff --git a/modules/nf-core/bismark/align/environment.yml b/modules/nf-core/bismark/align/environment.yml new file mode 100644 index 00000000..d7cb8a29 --- /dev/null +++ b/modules/nf-core/bismark/align/environment.yml @@ -0,0 +1,7 @@ +name: bismark_align +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::bismark=0.24.0 diff --git a/modules/nf-core/bismark/align/main.nf b/modules/nf-core/bismark/align/main.nf index d36f6726..3487979e 100644 --- a/modules/nf-core/bismark/align/main.nf +++ b/modules/nf-core/bismark/align/main.nf @@ -2,7 +2,7 @@ process BISMARK_ALIGN { tag "$meta.id" label 'process_high' - conda "bioconda::bismark=0.24.0" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/bismark:0.24.0--hdfd78af_0' : 'biocontainers/bismark:0.24.0--hdfd78af_0' }" diff --git a/modules/nf-core/bismark/align/meta.yml b/modules/nf-core/bismark/align/meta.yml index 91c17b8a..03b9826e 100644 --- a/modules/nf-core/bismark/align/meta.yml +++ b/modules/nf-core/bismark/align/meta.yml @@ -58,3 +58,5 @@ output: pattern: "versions.yml" authors: - "@phue" +maintainers: + - "@phue" diff --git a/modules/nf-core/bismark/align/tests/main.nf.test b/modules/nf-core/bismark/align/tests/main.nf.test new file mode 100644 index 00000000..07139556 --- /dev/null +++ b/modules/nf-core/bismark/align/tests/main.nf.test @@ -0,0 +1,250 @@ +nextflow_process { + + name "Test Process BISMARK_ALIGN" + script "../main.nf" + process "BISMARK_ALIGN" + tag "bismark" + tag "bismark/align" + tag "modules" + tag "modules_nfcore" + + test("Should run bismark/align (bowtie2 single end) without failures") { + config './nextflow_bowtie2.config' + + setup { + run("BISMARK_GENOMEPREPARATION") { + script "../../genomepreparation/main.nf" + process { + """ + input[0] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + """ + } + } + } + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:true ], + file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true) + ] + input[1] = BISMARK_GENOMEPREPARATION.out.index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.bam).match("bam_bt2_se") }, + { assert snapshot(process.out.unmapped).match("unmapped_bt2_se") }, + { assert snapshot(process.out.versions).match("versions") }, + { + with(process.out.report) { + with(get(0)) { + assert get(1).endsWith("bt2_SE_report.txt") + assert path(get(1)).readLines().last().contains("Bismark completed in") + } + } + } + ) + } + } + + test("Should run bismark/align (bowtie2 paired end) without failures") { + config './nextflow_bowtie2.config' + + setup { + run("BISMARK_GENOMEPREPARATION") { + script "../../genomepreparation/main.nf" + process { + """ + input[0] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + """ + } + } + } + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + [ + file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_methylated_2_fastq_gz'], checkIfExists: true) + ] + ] + input[1] = BISMARK_GENOMEPREPARATION.out.index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.bam).match("bam_bt2_pe") }, + { assert snapshot(process.out.unmapped).match("unmapped_bt2_pe") }, + { assert snapshot(process.out.versions).match("versions") }, + { + with(process.out.report) { + with(get(0)) { + assert get(1).endsWith("_bt2_PE_report.txt") + assert path(get(1)).readLines().last().contains("Bismark completed in") + } + } + } + ) + } + } + + test("Should run bismark/align (hisat2 single end) without failures") { + config './nextflow_hisat2.config' + + setup { + run("BISMARK_GENOMEPREPARATION") { + script "../../genomepreparation/main.nf" + process { + """ + input[0] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + """ + } + } + } + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:true ], + file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true) + ] + input[1] = BISMARK_GENOMEPREPARATION.out.index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.bam).match("bam_hisat2_se") }, + { assert snapshot(process.out.unmapped).match("unmapped_hisat2_se") }, + { assert snapshot(process.out.versions).match("versions") }, + { + with(process.out.report) { + with(get(0)) { + assert get(1).endsWith("hisat2_SE_report.txt") + assert path(get(1)).readLines().last().contains("Bismark completed in") + } + } + } + ) + } + } + + test("Should run bismark/align (hisat2 paired end) without failures") { + config './nextflow_hisat2.config' + + setup { + run("BISMARK_GENOMEPREPARATION") { + script "../../genomepreparation/main.nf" + process { + """ + input[0] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + """ + } + } + } + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + [ + file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_methylated_2_fastq_gz'], checkIfExists: true) + ] + ] + input[1] = BISMARK_GENOMEPREPARATION.out.index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.bam).match("bam_hisat2_pe") }, + { assert snapshot(process.out.unmapped).match("unmapped_hisat2_pe") }, + { assert snapshot(process.out.versions).match("versions") }, + { + with(process.out.report) { + with(get(0)) { + assert get(1).endsWith("hisat2_PE_report.txt") + assert path(get(1)).readLines().last().contains("Bismark completed in") + } + } + } + ) + } + } + + test("Should run bismark/align (minimap2 single end) without failures") { + config './nextflow_minimap2.config' + + setup { + run("BISMARK_GENOMEPREPARATION") { + script "../../genomepreparation/main.nf" + process { + """ + input[0] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + """ + } + } + } + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:true ], + file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true) + ] + input[1] = BISMARK_GENOMEPREPARATION.out.index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.bam).match("bam_minimap2_se") }, + { assert snapshot(process.out.unmapped).match("unmapped_minimap2_se") }, + { assert snapshot(process.out.versions).match("versions") }, + { + with(process.out.report) { + with(get(0)) { + assert get(1).endsWith("mm2_SE_report.txt") + assert path(get(1)).readLines().last().contains("Bismark completed in") + } + } + } + ) + } + } +} diff --git a/modules/nf-core/bismark/align/tests/main.nf.test.snap b/modules/nf-core/bismark/align/tests/main.nf.test.snap new file mode 100644 index 00000000..f132e070 --- /dev/null +++ b/modules/nf-core/bismark/align/tests/main.nf.test.snap @@ -0,0 +1,120 @@ +{ + "unmapped_hisat2_pe": { + "content": [ + [ + + ] + ], + "timestamp": "2023-10-18T10:43:05.063588715" + }, + "bam_bt2_se": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.methylated_1_bismark_bt2.bam:md5,315d5299edbd6fe6a3716996bc2129c4" + ] + ] + ], + "timestamp": "2023-10-18T10:42:06.821761726" + }, + "bam_minimap2_se": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.methylated_1_bismark_mm2.bam:md5,d8c54051df96f12e5ceb08cbd58c1ca4" + ] + ] + ], + "timestamp": "2023-10-18T10:43:24.234318958" + }, + "bam_bt2_pe": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.methylated_1_bismark_bt2_pe.bam:md5,e9b17bd5b5897b38562e1e8c18442787" + ] + ] + ], + "timestamp": "2023-10-18T10:42:26.299667292" + }, + "versions": { + "content": [ + [ + "versions.yml:md5,908dc37f43469e417f419f1173047da5" + ] + ], + "timestamp": "2023-10-18T10:42:06.844406815" + }, + "unmapped_minimap2_se": { + "content": [ + [ + + ] + ], + "timestamp": "2023-10-18T10:43:24.254014927" + }, + "unmapped_hisat2_se": { + "content": [ + [ + + ] + ], + "timestamp": "2023-10-18T10:42:45.125915494" + }, + "bam_hisat2_pe": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.methylated_1_bismark_hisat2_pe.bam:md5,120c2da988865860df873f7e4a3dabc1" + ] + ] + ], + "timestamp": "2023-10-18T10:43:05.047908937" + }, + "unmapped_bt2_se": { + "content": [ + [ + + ] + ], + "timestamp": "2023-10-18T10:42:06.838672413" + }, + "bam_hisat2_se": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.methylated_1_bismark_hisat2.bam:md5,cc5f52b3269540cf121e32c0512ea8d6" + ] + ] + ], + "timestamp": "2023-10-18T10:42:45.112219005" + }, + "unmapped_bt2_pe": { + "content": [ + [ + + ] + ], + "timestamp": "2023-10-18T10:42:26.310951647" + } +} \ No newline at end of file diff --git a/modules/nf-core/bismark/align/tests/nextflow_bowtie2.config b/modules/nf-core/bismark/align/tests/nextflow_bowtie2.config new file mode 100644 index 00000000..cf0357e2 --- /dev/null +++ b/modules/nf-core/bismark/align/tests/nextflow_bowtie2.config @@ -0,0 +1,8 @@ +process { + withName: BISMARK_ALIGN { + ext.args = '--bowtie2' + } + withName: BISMARK_GENOMEPREPARATION { + ext.args = '--bowtie2' + } +} \ No newline at end of file diff --git a/modules/nf-core/bismark/align/tests/nextflow_hisat2.config b/modules/nf-core/bismark/align/tests/nextflow_hisat2.config new file mode 100644 index 00000000..5b962ae0 --- /dev/null +++ b/modules/nf-core/bismark/align/tests/nextflow_hisat2.config @@ -0,0 +1,8 @@ +process { + withName: BISMARK_ALIGN { + ext.args = '--hisat2' + } + withName: BISMARK_GENOMEPREPARATION { + ext.args = '--hisat2' + } +} \ No newline at end of file diff --git a/modules/nf-core/bismark/align/tests/nextflow_minimap2.config b/modules/nf-core/bismark/align/tests/nextflow_minimap2.config new file mode 100644 index 00000000..dd46fe26 --- /dev/null +++ b/modules/nf-core/bismark/align/tests/nextflow_minimap2.config @@ -0,0 +1,8 @@ +process { + withName: BISMARK_ALIGN { + ext.args = '--minimap2' + } + withName: BISMARK_GENOMEPREPARATION { + ext.args = '--minimap2' + } +} \ No newline at end of file diff --git a/modules/nf-core/bismark/align/tests/tags.yml b/modules/nf-core/bismark/align/tests/tags.yml new file mode 100644 index 00000000..dd99d819 --- /dev/null +++ b/modules/nf-core/bismark/align/tests/tags.yml @@ -0,0 +1,2 @@ +bismark/align: + - modules/nf-core/bismark/align/** diff --git a/modules/nf-core/bismark/coverage2cytosine/environment.yml b/modules/nf-core/bismark/coverage2cytosine/environment.yml new file mode 100644 index 00000000..abda2847 --- /dev/null +++ b/modules/nf-core/bismark/coverage2cytosine/environment.yml @@ -0,0 +1,7 @@ +name: bismark_coverage2cytosine +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::bismark=0.24.0 diff --git a/modules/nf-core/bismark/coverage2cytosine/main.nf b/modules/nf-core/bismark/coverage2cytosine/main.nf index f5429700..0ad2d434 100644 --- a/modules/nf-core/bismark/coverage2cytosine/main.nf +++ b/modules/nf-core/bismark/coverage2cytosine/main.nf @@ -2,7 +2,7 @@ process BISMARK_COVERAGE2CYTOSINE { tag "$meta.id" label 'process_low' - conda "bioconda::bismark=0.23.0" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/bismark:0.24.0--hdfd78af_0' : 'biocontainers/bismark:0.24.0--hdfd78af_0' }" diff --git a/modules/nf-core/bismark/coverage2cytosine/meta.yml b/modules/nf-core/bismark/coverage2cytosine/meta.yml index 511578c8..e9d6bde0 100644 --- a/modules/nf-core/bismark/coverage2cytosine/meta.yml +++ b/modules/nf-core/bismark/coverage2cytosine/meta.yml @@ -20,7 +20,6 @@ tools: documentation: https://github.com/FelixKrueger/Bismark/tree/master/Docs doi: 10.1093/bioinformatics/btr167 licence: ["GPL-3.0-or-later"] - input: - meta: type: map @@ -35,7 +34,6 @@ input: type: dir description: Bismark genome index directory pattern: "BismarkIndex" - output: - meta: type: map @@ -58,6 +56,7 @@ output: type: file description: File containing software versions pattern: "versions.yml" - authors: - "@ewels" +maintainers: + - "@ewels" diff --git a/modules/nf-core/bismark/coverage2cytosine/tests/main.nf.test b/modules/nf-core/bismark/coverage2cytosine/tests/main.nf.test new file mode 100644 index 00000000..e6618054 --- /dev/null +++ b/modules/nf-core/bismark/coverage2cytosine/tests/main.nf.test @@ -0,0 +1,58 @@ +nextflow_process { + + name "Test Process BISMARK_COVERAGE2CYTOSINE" + script "../main.nf" + process "BISMARK_COVERAGE2CYTOSINE" + tag "bismark" + tag "bismark/coverage2cytosine" + tag "modules" + tag "modules_nfcore" + + test("Should run bismark/coverage2cytosine without failures") { + + setup { + run("BISMARK_GENOMEPREPARATION") { + script "../../genomepreparation/main.nf" + process { + """ + input[0] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + """ + } + } + + run("BISMARK_METHYLATIONEXTRACTOR") { + script "../../methylationextractor/main.nf" + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_bam'], checkIfExists: true) + ] + input[1] = BISMARK_GENOMEPREPARATION.out.index + """ + } + } + } + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = BISMARK_METHYLATIONEXTRACTOR.out.coverage + input[1] = BISMARK_GENOMEPREPARATION.out.index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/bismark/coverage2cytosine/tests/main.nf.test.snap b/modules/nf-core/bismark/coverage2cytosine/tests/main.nf.test.snap new file mode 100644 index 00000000..17474a02 --- /dev/null +++ b/modules/nf-core/bismark/coverage2cytosine/tests/main.nf.test.snap @@ -0,0 +1,57 @@ +{ + "Should run bismark/coverage2cytosine without failures": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.CpG_report.txt.gz:md5,f0d16086d10e5ba32a4b71e4a349342a" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.cytosine_context_summary.txt:md5,5ed486bfa844a5e476a7ab054a7a8d6b" + ] + ], + "3": [ + "versions.yml:md5,9ad535f8f13a38c9bc3f0975fbfee39c" + ], + "coverage": [ + + ], + "report": [ + [ + { + "id": "test", + "single_end": false + }, + "test.CpG_report.txt.gz:md5,f0d16086d10e5ba32a4b71e4a349342a" + ] + ], + "summary": [ + [ + { + "id": "test", + "single_end": false + }, + "test.cytosine_context_summary.txt:md5,5ed486bfa844a5e476a7ab054a7a8d6b" + ] + ], + "versions": [ + "versions.yml:md5,9ad535f8f13a38c9bc3f0975fbfee39c" + ] + } + ], + "timestamp": "2023-10-17T11:21:30.915147802" + } +} \ No newline at end of file diff --git a/modules/nf-core/bismark/coverage2cytosine/tests/tags.yml b/modules/nf-core/bismark/coverage2cytosine/tests/tags.yml new file mode 100644 index 00000000..aec54b67 --- /dev/null +++ b/modules/nf-core/bismark/coverage2cytosine/tests/tags.yml @@ -0,0 +1,2 @@ +bismark/coverage2cytosine: + - modules/nf-core/bismark/coverage2cytosine/** diff --git a/modules/nf-core/bismark/deduplicate/environment.yml b/modules/nf-core/bismark/deduplicate/environment.yml new file mode 100644 index 00000000..6160c2e6 --- /dev/null +++ b/modules/nf-core/bismark/deduplicate/environment.yml @@ -0,0 +1,7 @@ +name: bismark_deduplicate +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::bismark=0.24.0 diff --git a/modules/nf-core/bismark/deduplicate/main.nf b/modules/nf-core/bismark/deduplicate/main.nf index 7e238d77..e41b601b 100644 --- a/modules/nf-core/bismark/deduplicate/main.nf +++ b/modules/nf-core/bismark/deduplicate/main.nf @@ -2,7 +2,7 @@ process BISMARK_DEDUPLICATE { tag "$meta.id" label 'process_high' - conda "bioconda::bismark=0.24.0" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/bismark:0.24.0--hdfd78af_0' : 'biocontainers/bismark:0.24.0--hdfd78af_0' }" diff --git a/modules/nf-core/bismark/deduplicate/meta.yml b/modules/nf-core/bismark/deduplicate/meta.yml index a310a851..cb48f6b1 100644 --- a/modules/nf-core/bismark/deduplicate/meta.yml +++ b/modules/nf-core/bismark/deduplicate/meta.yml @@ -51,3 +51,5 @@ output: pattern: "versions.yml" authors: - "@phue" +maintainers: + - "@phue" diff --git a/modules/nf-core/bismark/deduplicate/tests/main.nf.test b/modules/nf-core/bismark/deduplicate/tests/main.nf.test new file mode 100644 index 00000000..478c69b6 --- /dev/null +++ b/modules/nf-core/bismark/deduplicate/tests/main.nf.test @@ -0,0 +1,36 @@ +nextflow_process { + + name "Test Process BISMARK_DEDUPLICATE" + script "../main.nf" + process "BISMARK_DEDUPLICATE" + tag "bismark" + tag "bismark/deduplicate" + tag "modules" + tag "modules_nfcore" + + test("Should run bismark/deduplicate without failures") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_bam'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/bismark/deduplicate/tests/main.nf.test.snap b/modules/nf-core/bismark/deduplicate/tests/main.nf.test.snap new file mode 100644 index 00000000..6a69ed34 --- /dev/null +++ b/modules/nf-core/bismark/deduplicate/tests/main.nf.test.snap @@ -0,0 +1,51 @@ +{ + "Should run bismark/deduplicate without failures": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.methylated.deduplicated.bam:md5,ac241d97729ecf98b294a7371346dcdb" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.methylated.deduplication_report.txt:md5,86aaf87bac9ccdc3cc83628f20b902dc" + ] + ], + "2": [ + "versions.yml:md5,1859cf7d4e598dec0678f073c9e2f539" + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.methylated.deduplicated.bam:md5,ac241d97729ecf98b294a7371346dcdb" + ] + ], + "report": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.methylated.deduplication_report.txt:md5,86aaf87bac9ccdc3cc83628f20b902dc" + ] + ], + "versions": [ + "versions.yml:md5,1859cf7d4e598dec0678f073c9e2f539" + ] + } + ], + "timestamp": "2023-10-17T10:32:40.893624928" + } +} \ No newline at end of file diff --git a/modules/nf-core/bismark/deduplicate/tests/tags.yml b/modules/nf-core/bismark/deduplicate/tests/tags.yml new file mode 100644 index 00000000..35ac3505 --- /dev/null +++ b/modules/nf-core/bismark/deduplicate/tests/tags.yml @@ -0,0 +1,2 @@ +bismark/deduplicate: + - modules/nf-core/bismark/deduplicate/** diff --git a/modules/nf-core/bismark/genomepreparation/environment.yml b/modules/nf-core/bismark/genomepreparation/environment.yml new file mode 100644 index 00000000..e27febfc --- /dev/null +++ b/modules/nf-core/bismark/genomepreparation/environment.yml @@ -0,0 +1,7 @@ +name: bismark_genomepreparation +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::bismark=0.24.0 diff --git a/modules/nf-core/bismark/genomepreparation/main.nf b/modules/nf-core/bismark/genomepreparation/main.nf index 8f424443..7f5a2eee 100644 --- a/modules/nf-core/bismark/genomepreparation/main.nf +++ b/modules/nf-core/bismark/genomepreparation/main.nf @@ -2,7 +2,7 @@ process BISMARK_GENOMEPREPARATION { tag "$fasta" label 'process_high' - conda "bioconda::bismark=0.24.0" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/bismark:0.24.0--hdfd78af_0' : 'biocontainers/bismark:0.24.0--hdfd78af_0' }" diff --git a/modules/nf-core/bismark/genomepreparation/meta.yml b/modules/nf-core/bismark/genomepreparation/meta.yml index 23588e1d..06fe4f8c 100644 --- a/modules/nf-core/bismark/genomepreparation/meta.yml +++ b/modules/nf-core/bismark/genomepreparation/meta.yml @@ -36,3 +36,5 @@ output: pattern: "versions.yml" authors: - "@phue" +maintainers: + - "@phue" diff --git a/modules/nf-core/bismark/genomepreparation/tests/main.nf.test b/modules/nf-core/bismark/genomepreparation/tests/main.nf.test new file mode 100644 index 00000000..d21ebddf --- /dev/null +++ b/modules/nf-core/bismark/genomepreparation/tests/main.nf.test @@ -0,0 +1,33 @@ +nextflow_process { + + name "Test Process BISMARK_GENOMEPREPARATION" + script "../main.nf" + process "BISMARK_GENOMEPREPARATION" + tag "bismark" + tag "bismark/genomepreparation" + tag "modules" + tag "modules_nfcore" + + test("Should run bismark/genomepreparation without failures") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/bismark/genomepreparation/tests/main.nf.test.snap b/modules/nf-core/bismark/genomepreparation/tests/main.nf.test.snap new file mode 100644 index 00000000..a343efad --- /dev/null +++ b/modules/nf-core/bismark/genomepreparation/tests/main.nf.test.snap @@ -0,0 +1,65 @@ +{ + "Should run bismark/genomepreparation without failures": { + "content": [ + { + "0": [ + [ + [ + [ + "BS_CT.1.bt2:md5,10a8854e5eeb95629f46d24b0d8da70c", + "BS_CT.2.bt2:md5,bc5d407e6fce3e1cdb4b23ab2a20f707", + "BS_CT.3.bt2:md5,4ed93abba181d8dfab2e303e33114777", + "BS_CT.4.bt2:md5,6c4f549575e5882ff3a97ae10ae2e7be", + "BS_CT.rev.1.bt2:md5,d37d586b41b6a36efb25839961d242cb", + "BS_CT.rev.2.bt2:md5,48bf400de85cd7324fbf6bf38fe2dc95", + "genome_mfa.CT_conversion.fa:md5,903b9f357eea4a5f36e21e78e0fe1dfa" + ], + [ + "BS_GA.1.bt2:md5,a6fa4068ed10872568f32568c66cb600", + "BS_GA.2.bt2:md5,fc5b634e2f5137801e3801d62ad05f74", + "BS_GA.3.bt2:md5,4ed93abba181d8dfab2e303e33114777", + "BS_GA.4.bt2:md5,b1e855685ed634daa7df8e180c9b2fc4", + "BS_GA.rev.1.bt2:md5,17f51e65f44477962226a83b369b2bc4", + "BS_GA.rev.2.bt2:md5,d36044c5dfe37af0411f60d446585bc6", + "genome_mfa.GA_conversion.fa:md5,e529375ec2039112161465b5169fcd59" + ] + ], + "genome.fasta:md5,6e9fe4042a72f2345f644f239272b7e6" + ] + ], + "1": [ + "versions.yml:md5,92d3bda85e8d9517fce396c615141003" + ], + "index": [ + [ + [ + [ + "BS_CT.1.bt2:md5,10a8854e5eeb95629f46d24b0d8da70c", + "BS_CT.2.bt2:md5,bc5d407e6fce3e1cdb4b23ab2a20f707", + "BS_CT.3.bt2:md5,4ed93abba181d8dfab2e303e33114777", + "BS_CT.4.bt2:md5,6c4f549575e5882ff3a97ae10ae2e7be", + "BS_CT.rev.1.bt2:md5,d37d586b41b6a36efb25839961d242cb", + "BS_CT.rev.2.bt2:md5,48bf400de85cd7324fbf6bf38fe2dc95", + "genome_mfa.CT_conversion.fa:md5,903b9f357eea4a5f36e21e78e0fe1dfa" + ], + [ + "BS_GA.1.bt2:md5,a6fa4068ed10872568f32568c66cb600", + "BS_GA.2.bt2:md5,fc5b634e2f5137801e3801d62ad05f74", + "BS_GA.3.bt2:md5,4ed93abba181d8dfab2e303e33114777", + "BS_GA.4.bt2:md5,b1e855685ed634daa7df8e180c9b2fc4", + "BS_GA.rev.1.bt2:md5,17f51e65f44477962226a83b369b2bc4", + "BS_GA.rev.2.bt2:md5,d36044c5dfe37af0411f60d446585bc6", + "genome_mfa.GA_conversion.fa:md5,e529375ec2039112161465b5169fcd59" + ] + ], + "genome.fasta:md5,6e9fe4042a72f2345f644f239272b7e6" + ] + ], + "versions": [ + "versions.yml:md5,92d3bda85e8d9517fce396c615141003" + ] + } + ], + "timestamp": "2023-10-17T16:14:41.509500586" + } +} \ No newline at end of file diff --git a/modules/nf-core/bismark/genomepreparation/tests/tags.yml b/modules/nf-core/bismark/genomepreparation/tests/tags.yml new file mode 100644 index 00000000..279f91bb --- /dev/null +++ b/modules/nf-core/bismark/genomepreparation/tests/tags.yml @@ -0,0 +1,2 @@ +bismark/genomepreparation: + - modules/nf-core/bismark/genomepreparation/** diff --git a/modules/nf-core/bismark/methylationextractor/environment.yml b/modules/nf-core/bismark/methylationextractor/environment.yml new file mode 100644 index 00000000..33ca1190 --- /dev/null +++ b/modules/nf-core/bismark/methylationextractor/environment.yml @@ -0,0 +1,7 @@ +name: bismark_methylationextractor +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::bismark=0.24.0 diff --git a/modules/nf-core/bismark/methylationextractor/main.nf b/modules/nf-core/bismark/methylationextractor/main.nf index 2a3e5d22..44395155 100644 --- a/modules/nf-core/bismark/methylationextractor/main.nf +++ b/modules/nf-core/bismark/methylationextractor/main.nf @@ -2,7 +2,7 @@ process BISMARK_METHYLATIONEXTRACTOR { tag "$meta.id" label 'process_high' - conda "bioconda::bismark=0.24.0" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/bismark:0.24.0--hdfd78af_0' : 'biocontainers/bismark:0.24.0--hdfd78af_0' }" diff --git a/modules/nf-core/bismark/methylationextractor/meta.yml b/modules/nf-core/bismark/methylationextractor/meta.yml index 81b14144..ea13ae3a 100644 --- a/modules/nf-core/bismark/methylationextractor/meta.yml +++ b/modules/nf-core/bismark/methylationextractor/meta.yml @@ -31,7 +31,7 @@ input: description: BAM file containing read alignments pattern: "*.{bam}" - index: - type: dir + type: directory description: Bismark genome index directory pattern: "BismarkIndex" output: @@ -66,3 +66,5 @@ output: pattern: "versions.yml" authors: - "@phue" +maintainers: + - "@phue" diff --git a/modules/nf-core/bismark/methylationextractor/tests/main.nf.test b/modules/nf-core/bismark/methylationextractor/tests/main.nf.test new file mode 100644 index 00000000..46d3ae8c --- /dev/null +++ b/modules/nf-core/bismark/methylationextractor/tests/main.nf.test @@ -0,0 +1,48 @@ +nextflow_process { + + name "Test Process BISMARK_METHYLATIONEXTRACTOR" + script "../main.nf" + process "BISMARK_METHYLATIONEXTRACTOR" + tag "bismark" + tag "bismark/methylationextractor" + tag "modules" + tag "modules_nfcore" + + test("Should run bismark/methylationextractor without failures") { + + setup { + run("BISMARK_GENOMEPREPARATION") { + script "../../genomepreparation/main.nf" + process { + """ + input[0] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + """ + } + } + } + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_bam'], checkIfExists: true) + ] + input[1] = BISMARK_GENOMEPREPARATION.out.index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match()} + ) + } + + } + +} diff --git a/modules/nf-core/bismark/methylationextractor/tests/main.nf.test.snap b/modules/nf-core/bismark/methylationextractor/tests/main.nf.test.snap new file mode 100644 index 00000000..c435a88d --- /dev/null +++ b/modules/nf-core/bismark/methylationextractor/tests/main.nf.test.snap @@ -0,0 +1,119 @@ +{ + "Should run bismark/methylationextractor without failures": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.methylated.bedGraph.gz:md5,6d8484ab5f0df684466a0a2491aab3c0" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "CHG_OB_test.paired_end.methylated.txt.gz:md5,6b72fe72d5a14743f5bdb0e89c2a8db1", + "CHG_OT_test.paired_end.methylated.txt.gz:md5,bfe87776316f342c72a8811d6ac50251", + "CHH_OB_test.paired_end.methylated.txt.gz:md5,63ccf90597f4339918c3432b35d584be", + "CHH_OT_test.paired_end.methylated.txt.gz:md5,a6164bdea00c97ecfb76f0e224d8fb7b", + "CpG_OB_test.paired_end.methylated.txt.gz:md5,e923376d9fa8a6d4e76489782904bd90", + "CpG_OT_test.paired_end.methylated.txt.gz:md5,4296ac6d0a7832909c4775b8fee88afc" + ] + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.methylated.bismark.cov.gz:md5,6805ae041310ded6ce819dfb206be761" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.methylated_splitting_report.txt:md5,4ebaa7ff42aad09b4c7edd38150fef12" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.methylated.M-bias.txt:md5,0b100924d46b3c35115f1206f34c4a59" + ] + ], + "5": [ + "versions.yml:md5,b2efe40312b4b8fcd8276d788f89c1da" + ], + "bedgraph": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.methylated.bedGraph.gz:md5,6d8484ab5f0df684466a0a2491aab3c0" + ] + ], + "coverage": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.methylated.bismark.cov.gz:md5,6805ae041310ded6ce819dfb206be761" + ] + ], + "mbias": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.methylated.M-bias.txt:md5,0b100924d46b3c35115f1206f34c4a59" + ] + ], + "methylation_calls": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "CHG_OB_test.paired_end.methylated.txt.gz:md5,6b72fe72d5a14743f5bdb0e89c2a8db1", + "CHG_OT_test.paired_end.methylated.txt.gz:md5,bfe87776316f342c72a8811d6ac50251", + "CHH_OB_test.paired_end.methylated.txt.gz:md5,63ccf90597f4339918c3432b35d584be", + "CHH_OT_test.paired_end.methylated.txt.gz:md5,a6164bdea00c97ecfb76f0e224d8fb7b", + "CpG_OB_test.paired_end.methylated.txt.gz:md5,e923376d9fa8a6d4e76489782904bd90", + "CpG_OT_test.paired_end.methylated.txt.gz:md5,4296ac6d0a7832909c4775b8fee88afc" + ] + ] + ], + "report": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.methylated_splitting_report.txt:md5,4ebaa7ff42aad09b4c7edd38150fef12" + ] + ], + "versions": [ + "versions.yml:md5,b2efe40312b4b8fcd8276d788f89c1da" + ] + } + ], + "timestamp": "2023-10-17T10:55:16.009653232" + } +} \ No newline at end of file diff --git a/modules/nf-core/bismark/methylationextractor/tests/tags.yml b/modules/nf-core/bismark/methylationextractor/tests/tags.yml new file mode 100644 index 00000000..272e4df1 --- /dev/null +++ b/modules/nf-core/bismark/methylationextractor/tests/tags.yml @@ -0,0 +1,2 @@ +bismark/methylationextractor: + - modules/nf-core/bismark/methylationextractor/** diff --git a/modules/nf-core/bismark/report/environment.yml b/modules/nf-core/bismark/report/environment.yml new file mode 100644 index 00000000..2725a605 --- /dev/null +++ b/modules/nf-core/bismark/report/environment.yml @@ -0,0 +1,7 @@ +name: bismark_report +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::bismark=0.24.0 diff --git a/modules/nf-core/bismark/report/main.nf b/modules/nf-core/bismark/report/main.nf index 804a141d..6570f098 100644 --- a/modules/nf-core/bismark/report/main.nf +++ b/modules/nf-core/bismark/report/main.nf @@ -2,7 +2,7 @@ process BISMARK_REPORT { tag "$meta.id" label 'process_low' - conda "bioconda::bismark=0.24.0" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/bismark:0.24.0--hdfd78af_0' : 'biocontainers/bismark:0.24.0--hdfd78af_0' }" diff --git a/modules/nf-core/bismark/report/meta.yml b/modules/nf-core/bismark/report/meta.yml index 1f6be782..2307a28e 100644 --- a/modules/nf-core/bismark/report/meta.yml +++ b/modules/nf-core/bismark/report/meta.yml @@ -59,3 +59,5 @@ output: pattern: "versions.yml" authors: - "@phue" +maintainers: + - "@phue" diff --git a/modules/nf-core/bismark/report/tests/main.nf.test b/modules/nf-core/bismark/report/tests/main.nf.test new file mode 100644 index 00000000..196126ff --- /dev/null +++ b/modules/nf-core/bismark/report/tests/main.nf.test @@ -0,0 +1,90 @@ +nextflow_process { + + name "Test Process BISMARK_REPORT" + script "../main.nf" + process "BISMARK_REPORT" + tag "bismark" + tag "bismark/report" + tag "modules" + tag "modules_nfcore" + + test("Should run bismark/report without failures") { + + setup { + run("BISMARK_GENOMEPREPARATION") { + script "../../genomepreparation/main.nf" + process { + """ + input[0] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + """ + } + } + + run("BISMARK_ALIGN") { + script "../../align/main.nf" + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + [ + file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_methylated_2_fastq_gz'], checkIfExists: true) + ] + ] + input[1] = BISMARK_GENOMEPREPARATION.out.index + """ + } + } + + run("BISMARK_DEDUPLICATE") { + script "../../deduplicate/main.nf" + process { + """ + input[0] = BISMARK_ALIGN.out.bam + """ + } + } + + run("BISMARK_METHYLATIONEXTRACTOR") { + script "../../methylationextractor/main.nf" + process { + """ + input[0] = BISMARK_ALIGN.out.bam + input[1] = BISMARK_GENOMEPREPARATION.out.index + """ + } + } + } + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = BISMARK_ALIGN.out.report + .join(BISMARK_DEDUPLICATE.out.report) + .join(BISMARK_METHYLATIONEXTRACTOR.out.report) + .join(BISMARK_METHYLATIONEXTRACTOR.out.mbias) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions") }, + { + with(process.out.report) { + with(get(0)) { + assert get(1).endsWith('_PE_report.html') + assert path(get(1)).readLines().last().contains('') + } + } + } + ) + } + + } + +} diff --git a/modules/nf-core/bismark/report/tests/main.nf.test.snap b/modules/nf-core/bismark/report/tests/main.nf.test.snap new file mode 100644 index 00000000..dc05e655 --- /dev/null +++ b/modules/nf-core/bismark/report/tests/main.nf.test.snap @@ -0,0 +1,10 @@ +{ + "versions": { + "content": [ + [ + "versions.yml:md5,c2e2c0bd500e9ce95ae7ab82f667270b" + ] + ], + "timestamp": "2023-10-17T16:13:42.879192383" + } +} \ No newline at end of file diff --git a/modules/nf-core/bismark/report/tests/tags.yml b/modules/nf-core/bismark/report/tests/tags.yml new file mode 100644 index 00000000..c72a1f94 --- /dev/null +++ b/modules/nf-core/bismark/report/tests/tags.yml @@ -0,0 +1,2 @@ +bismark/report: + - modules/nf-core/bismark/report/** diff --git a/modules/nf-core/bismark/summary/environment.yml b/modules/nf-core/bismark/summary/environment.yml new file mode 100644 index 00000000..8c0fe3d2 --- /dev/null +++ b/modules/nf-core/bismark/summary/environment.yml @@ -0,0 +1,7 @@ +name: bismark_summary +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::bismark=0.24.0 diff --git a/modules/nf-core/bismark/summary/main.nf b/modules/nf-core/bismark/summary/main.nf index 399f960d..34cebffb 100644 --- a/modules/nf-core/bismark/summary/main.nf +++ b/modules/nf-core/bismark/summary/main.nf @@ -1,7 +1,7 @@ process BISMARK_SUMMARY { label 'process_low' - conda "bioconda::bismark=0.24.0" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/bismark:0.24.0--hdfd78af_0' : 'biocontainers/bismark:0.24.0--hdfd78af_0' }" diff --git a/modules/nf-core/bismark/summary/meta.yml b/modules/nf-core/bismark/summary/meta.yml index 96814826..6acf44e6 100644 --- a/modules/nf-core/bismark/summary/meta.yml +++ b/modules/nf-core/bismark/summary/meta.yml @@ -23,8 +23,8 @@ tools: licence: ["GPL-3.0-or-later"] input: - bam: - type: value - description: Array of Bismark alignment BAM filenames + type: list + description: List of Bismark alignment BAM filenames pattern: "*.bam" - align_report: type: file @@ -53,3 +53,5 @@ output: pattern: "versions.yml" authors: - "@phue" +maintainers: + - "@phue" diff --git a/modules/nf-core/bismark/summary/tests/main.nf.test b/modules/nf-core/bismark/summary/tests/main.nf.test new file mode 100644 index 00000000..e04f01f8 --- /dev/null +++ b/modules/nf-core/bismark/summary/tests/main.nf.test @@ -0,0 +1,91 @@ +nextflow_process { + + name "Test Process BISMARK_SUMMARY" + script "../main.nf" + process "BISMARK_SUMMARY" + tag "bismark" + tag "bismark/summary" + tag "modules" + tag "modules_nfcore" + + test("Should run bismark/summary without failures") { + + setup { + run("BISMARK_GENOMEPREPARATION") { + script "../../genomepreparation/main.nf" + process { + """ + input[0] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + """ + } + } + + run("BISMARK_ALIGN") { + script "../../align/main.nf" + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + [ + file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_methylated_2_fastq_gz'], checkIfExists: true) + ] + ] + input[1] = BISMARK_GENOMEPREPARATION.out.index + """ + } + } + + run("BISMARK_DEDUPLICATE") { + script "../../deduplicate/main.nf" + process { + """ + input[0] = BISMARK_ALIGN.out.bam + """ + } + } + + run("BISMARK_METHYLATIONEXTRACTOR") { + script "../../methylationextractor/main.nf" + process { + """ + input[0] = BISMARK_ALIGN.out.bam + input[1] = BISMARK_GENOMEPREPARATION.out.index + """ + } + } + } + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = BISMARK_ALIGN.out.bam.collect { meta, bam -> bam } + input[1] = BISMARK_ALIGN.out.report.collect { meta, report -> report } + input[2] = BISMARK_DEDUPLICATE.out.report.collect { meta, report -> report } + input[3] = BISMARK_METHYLATIONEXTRACTOR.out.report.collect { meta, report -> report } + input[4] = BISMARK_METHYLATIONEXTRACTOR.out.mbias.collect { meta, txt -> txt } + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions") }, + { + with(process.out.summary) { + assert get(0).size() == 2 + assert get(0).every { it.contains('bismark_summary_report') } + assert path(get(0).get(1)).readLines().first().contains('CpGs') + assert path(get(0).get(0)).readLines().last().contains('') + } + } + ) + } + + } + +} diff --git a/modules/nf-core/bismark/summary/tests/main.nf.test.snap b/modules/nf-core/bismark/summary/tests/main.nf.test.snap new file mode 100644 index 00000000..acb445c1 --- /dev/null +++ b/modules/nf-core/bismark/summary/tests/main.nf.test.snap @@ -0,0 +1,10 @@ +{ + "versions": { + "content": [ + [ + "versions.yml:md5,22bb5a457e4eef7ab3556e464263ce04" + ] + ], + "timestamp": "2023-10-17T15:12:35.102032381" + } +} \ No newline at end of file diff --git a/modules/nf-core/bismark/summary/tests/tags.yml b/modules/nf-core/bismark/summary/tests/tags.yml new file mode 100644 index 00000000..3d7ee037 --- /dev/null +++ b/modules/nf-core/bismark/summary/tests/tags.yml @@ -0,0 +1,2 @@ +bismark/summary: + - modules/nf-core/bismark/summary/** diff --git a/modules/nf-core/bwameth/align/environment.yml b/modules/nf-core/bwameth/align/environment.yml new file mode 100644 index 00000000..c2711df3 --- /dev/null +++ b/modules/nf-core/bwameth/align/environment.yml @@ -0,0 +1,7 @@ +name: bwameth_align +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::bwameth=0.2.2 diff --git a/modules/nf-core/bwameth/align/main.nf b/modules/nf-core/bwameth/align/main.nf index 47304035..72471cc8 100644 --- a/modules/nf-core/bwameth/align/main.nf +++ b/modules/nf-core/bwameth/align/main.nf @@ -2,7 +2,7 @@ process BWAMETH_ALIGN { tag "$meta.id" label 'process_high' - conda "bioconda::bwameth=0.2.2" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/bwameth:0.2.2--py_1' : 'biocontainers/bwameth:0.2.2--py_1' }" diff --git a/modules/nf-core/bwameth/align/meta.yml b/modules/nf-core/bwameth/align/meta.yml index 7d22bc84..041c026d 100644 --- a/modules/nf-core/bwameth/align/meta.yml +++ b/modules/nf-core/bwameth/align/meta.yml @@ -51,3 +51,5 @@ output: pattern: "versions.yml" authors: - "@phue" +maintainers: + - "@phue" diff --git a/modules/nf-core/bwameth/index/environment.yml b/modules/nf-core/bwameth/index/environment.yml new file mode 100644 index 00000000..4fb62092 --- /dev/null +++ b/modules/nf-core/bwameth/index/environment.yml @@ -0,0 +1,7 @@ +name: bwameth_index +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::bwameth=0.2.2 diff --git a/modules/nf-core/bwameth/index/main.nf b/modules/nf-core/bwameth/index/main.nf index 1c789885..563f8570 100644 --- a/modules/nf-core/bwameth/index/main.nf +++ b/modules/nf-core/bwameth/index/main.nf @@ -2,7 +2,7 @@ process BWAMETH_INDEX { tag "$fasta" label 'process_high' - conda "bioconda::bwameth=0.2.2" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/bwameth:0.2.2--py_1' : 'biocontainers/bwameth:0.2.2--py_1' }" diff --git a/modules/nf-core/bwameth/index/meta.yml b/modules/nf-core/bwameth/index/meta.yml index 903ae95c..731e6805 100644 --- a/modules/nf-core/bwameth/index/meta.yml +++ b/modules/nf-core/bwameth/index/meta.yml @@ -32,3 +32,5 @@ output: pattern: "versions.yml" authors: - "@phue" +maintainers: + - "@phue" diff --git a/modules/nf-core/cat/fastq/environment.yml b/modules/nf-core/cat/fastq/environment.yml new file mode 100644 index 00000000..bff93add --- /dev/null +++ b/modules/nf-core/cat/fastq/environment.yml @@ -0,0 +1,7 @@ +name: cat_fastq +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - conda-forge::sed=4.7 diff --git a/modules/nf-core/cat/fastq/main.nf b/modules/nf-core/cat/fastq/main.nf index 5021e6fc..3d963784 100644 --- a/modules/nf-core/cat/fastq/main.nf +++ b/modules/nf-core/cat/fastq/main.nf @@ -2,7 +2,7 @@ process CAT_FASTQ { tag "$meta.id" label 'process_single' - conda "conda-forge::sed=4.7" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : 'nf-core/ubuntu:20.04' }" diff --git a/modules/nf-core/cat/fastq/meta.yml b/modules/nf-core/cat/fastq/meta.yml index 8a39e309..db4ac3c7 100644 --- a/modules/nf-core/cat/fastq/meta.yml +++ b/modules/nf-core/cat/fastq/meta.yml @@ -34,7 +34,9 @@ output: type: file description: File containing software versions pattern: "versions.yml" - authors: - "@joseespinosa" - "@drpatelh" +maintainers: + - "@joseespinosa" + - "@drpatelh" diff --git a/modules/nf-core/cat/fastq/tests/main.nf.test b/modules/nf-core/cat/fastq/tests/main.nf.test new file mode 100644 index 00000000..f5f94182 --- /dev/null +++ b/modules/nf-core/cat/fastq/tests/main.nf.test @@ -0,0 +1,143 @@ +nextflow_process { + + name "Test Process CAT_FASTQ" + script "../main.nf" + process "CAT_FASTQ" + tag "modules" + tag "modules_nfcore" + tag "cat" + tag "cat/fastq" + + test("test_cat_fastq_single_end") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:true ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_1_fastq_gz'], checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.reads).match() }, + { assert path(process.out.versions.get(0)).getText().contains("cat") } + ) + } + } + + test("test_cat_fastq_paired_end") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_2_fastq_gz'], checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.reads).match() }, + { assert path(process.out.versions.get(0)).getText().contains("cat") } + ) + } + } + + test("test_cat_fastq_single_end_same_name") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:true ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.reads).match() }, + { assert path(process.out.versions.get(0)).getText().contains("cat") } + ) + } + } + + test("test_cat_fastq_paired_end_same_name") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.reads).match() }, + { assert path(process.out.versions.get(0)).getText().contains("cat") } + ) + } + } + + test("test_cat_fastq_single_end_single_file") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:true ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.reads).match() }, + { assert path(process.out.versions.get(0)).getText().contains("cat") } + ) + } + } +} diff --git a/modules/nf-core/cat/fastq/tests/main.nf.test.snap b/modules/nf-core/cat/fastq/tests/main.nf.test.snap new file mode 100644 index 00000000..ec2342e5 --- /dev/null +++ b/modules/nf-core/cat/fastq/tests/main.nf.test.snap @@ -0,0 +1,78 @@ +{ + "test_cat_fastq_single_end": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.merged.fastq.gz:md5,f9cf5e375f7de81a406144a2c70cc64d" + ] + ] + ], + "timestamp": "2023-10-17T23:19:12.990284837" + }, + "test_cat_fastq_single_end_same_name": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.merged.fastq.gz:md5,63f817db7a29a03eb538104495556f66" + ] + ] + ], + "timestamp": "2023-10-17T23:19:31.554568147" + }, + "test_cat_fastq_single_end_single_file": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.merged.fastq.gz:md5,e325ef7deb4023447a1f074e285761af" + ] + ] + ], + "timestamp": "2023-10-17T23:19:49.629360033" + }, + "test_cat_fastq_paired_end_same_name": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.merged.fastq.gz:md5,63f817db7a29a03eb538104495556f66", + "test_2.merged.fastq.gz:md5,fe9f266f43a6fc3dcab690a18419a56e" + ] + ] + ] + ], + "timestamp": "2023-10-17T23:19:40.711617539" + }, + "test_cat_fastq_paired_end": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.merged.fastq.gz:md5,f9cf5e375f7de81a406144a2c70cc64d", + "test_2.merged.fastq.gz:md5,77c8e966e130d8c6b6ec9be52fcb2bda" + ] + ] + ] + ], + "timestamp": "2023-10-18T07:53:20.923560211" + } +} \ No newline at end of file diff --git a/modules/nf-core/cat/fastq/tests/tags.yml b/modules/nf-core/cat/fastq/tests/tags.yml new file mode 100644 index 00000000..6ac43614 --- /dev/null +++ b/modules/nf-core/cat/fastq/tests/tags.yml @@ -0,0 +1,2 @@ +cat/fastq: + - modules/nf-core/cat/fastq/** diff --git a/modules/nf-core/fastqc/tests/main.nf.test b/modules/nf-core/fastqc/tests/main.nf.test index b9e8f926..ad9bc54f 100644 --- a/modules/nf-core/fastqc/tests/main.nf.test +++ b/modules/nf-core/fastqc/tests/main.nf.test @@ -3,23 +3,21 @@ nextflow_process { name "Test Process FASTQC" script "../main.nf" process "FASTQC" + tag "modules" tag "modules_nfcore" tag "fastqc" - test("Single-Read") { + test("sarscov2 single-end [fastq]") { when { - params { - outdir = "$outputDir" - } process { """ input[0] = [ - [ id: 'test', single_end:true ], - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) - ] + [ id: 'test', single_end:true ], + [ + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + ] ] """ } @@ -28,82 +26,195 @@ nextflow_process { then { assertAll ( { assert process.success }, + // NOTE The report contains the date inside it, which means that the md5sum is stable per day, but not longer than that. So you can't md5sum it. // looks like this:
Mon 2 Oct 2023
test.gz
// https://github.com/nf-core/modules/pull/3903#issuecomment-1743620039 - { assert process.out.html.get(0).get(1) ==~ ".*/test_fastqc.html" }, - { assert path(process.out.html.get(0).get(1)).getText().contains("File typeConventional base calls") }, - { assert snapshot(process.out.versions).match("versions") }, - { assert process.out.zip.get(0).get(1) ==~ ".*/test_fastqc.zip" } + + { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, + { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, + { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, + + { assert snapshot(process.out.versions).match("versions") } + ) + } + } + + test("sarscov2 paired-end [fastq]") { + + when { + process { + """ + input[0] = [ + [id: 'test', single_end: false], // meta map + [ + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + + { assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" }, + { assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" }, + { assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" }, + { assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" }, + { assert path(process.out.html[0][1][0]).text.contains("File typeConventional base calls") }, + { assert path(process.out.html[0][1][1]).text.contains("File typeConventional base calls") }, + + { assert snapshot(process.out.versions).match("versions") } + ) + } + } + + test("sarscov2 interleaved [fastq]") { + + when { + process { + """ + input[0] = [ + [id: 'test', single_end: false], // meta map + file(params.test_data['sarscov2']['illumina']['test_interleaved_fastq_gz'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + + { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, + { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, + { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, + + { assert snapshot(process.out.versions).match("versions") } + ) + } + } + + test("sarscov2 paired-end [bam]") { + + when { + process { + """ + input[0] = [ + [id: 'test', single_end: false], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + + { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, + { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, + { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, + + { assert snapshot(process.out.versions).match("versions") } ) } } -// TODO -// // -// // Test with paired-end data -// // -// workflow test_fastqc_paired_end { -// input = [ -// [id: 'test', single_end: false], // meta map -// [ -// file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), -// file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) -// ] -// ] - -// FASTQC ( input ) -// } - -// // -// // Test with interleaved data -// // -// workflow test_fastqc_interleaved { -// input = [ -// [id: 'test', single_end: false], // meta map -// file(params.test_data['sarscov2']['illumina']['test_interleaved_fastq_gz'], checkIfExists: true) -// ] - -// FASTQC ( input ) -// } - -// // -// // Test with bam data -// // -// workflow test_fastqc_bam { -// input = [ -// [id: 'test', single_end: false], // meta map -// file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) -// ] - -// FASTQC ( input ) -// } - -// // -// // Test with multiple samples -// // -// workflow test_fastqc_multiple { -// input = [ -// [id: 'test', single_end: false], // meta map -// [ -// file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), -// file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true), -// file(params.test_data['sarscov2']['illumina']['test2_1_fastq_gz'], checkIfExists: true), -// file(params.test_data['sarscov2']['illumina']['test2_2_fastq_gz'], checkIfExists: true) -// ] -// ] - -// FASTQC ( input ) -// } - -// // -// // Test with custom prefix -// // -// workflow test_fastqc_custom_prefix { -// input = [ -// [ id:'mysample', single_end:true ], // meta map -// file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) -// ] - -// FASTQC ( input ) -// } + + test("sarscov2 multiple [fastq]") { + + when { + process { + """ + input[0] = [ + [id: 'test', single_end: false], // meta map + [ + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_2_fastq_gz'], checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + + { assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" }, + { assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" }, + { assert process.out.html[0][1][2] ==~ ".*/test_3_fastqc.html" }, + { assert process.out.html[0][1][3] ==~ ".*/test_4_fastqc.html" }, + { assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" }, + { assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" }, + { assert process.out.zip[0][1][2] ==~ ".*/test_3_fastqc.zip" }, + { assert process.out.zip[0][1][3] ==~ ".*/test_4_fastqc.zip" }, + { assert path(process.out.html[0][1][0]).text.contains("File typeConventional base calls") }, + { assert path(process.out.html[0][1][1]).text.contains("File typeConventional base calls") }, + { assert path(process.out.html[0][1][2]).text.contains("File typeConventional base calls") }, + { assert path(process.out.html[0][1][3]).text.contains("File typeConventional base calls") }, + + { assert snapshot(process.out.versions).match("versions") } + ) + } + } + + test("sarscov2 custom_prefix") { + + when { + process { + """ + input[0] = [ + [ id:'mysample', single_end:true ], // meta map + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + + { assert process.out.html[0][1] ==~ ".*/mysample_fastqc.html" }, + { assert process.out.zip[0][1] ==~ ".*/mysample_fastqc.zip" }, + { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, + + { assert snapshot(process.out.versions).match("versions") } + ) + } + } + + test("sarscov2 single-end [fastq] - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id: 'test', single_end:true ], + [ + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.html.collect { file(it[1]).getName() } + + process.out.zip.collect { file(it[1]).getName() } + + process.out.versions ).match() } + ) + } + } + } diff --git a/modules/nf-core/fastqc/tests/main.nf.test.snap b/modules/nf-core/fastqc/tests/main.nf.test.snap index 636a32ce..5ef5afbd 100644 --- a/modules/nf-core/fastqc/tests/main.nf.test.snap +++ b/modules/nf-core/fastqc/tests/main.nf.test.snap @@ -1,10 +1,20 @@ { + "sarscov2 single-end [fastq] - stub": { + "content": [ + [ + "test.html", + "test.zip", + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ] + ], + "timestamp": "2023-12-29T02:48:05.126117287" + }, "versions": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], - "timestamp": "2023-10-09T23:40:54+0000" + "timestamp": "2023-12-29T02:46:49.507942667" } } \ No newline at end of file diff --git a/modules/nf-core/methyldackel/extract/environment.yml b/modules/nf-core/methyldackel/extract/environment.yml new file mode 100644 index 00000000..03f1b020 --- /dev/null +++ b/modules/nf-core/methyldackel/extract/environment.yml @@ -0,0 +1,7 @@ +name: methyldackel_extract +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::methyldackel=0.6.0 diff --git a/modules/nf-core/methyldackel/extract/main.nf b/modules/nf-core/methyldackel/extract/main.nf index 32951459..c824b6b1 100644 --- a/modules/nf-core/methyldackel/extract/main.nf +++ b/modules/nf-core/methyldackel/extract/main.nf @@ -2,7 +2,7 @@ process METHYLDACKEL_EXTRACT { tag "$meta.id" label 'process_medium' - conda "bioconda::methyldackel=0.6.0" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/methyldackel:0.6.0--h22771d5_0' : 'biocontainers/methyldackel:0.6.0--h22771d5_0' }" diff --git a/modules/nf-core/methyldackel/extract/meta.yml b/modules/nf-core/methyldackel/extract/meta.yml index 9d777bb1..7ce950c7 100644 --- a/modules/nf-core/methyldackel/extract/meta.yml +++ b/modules/nf-core/methyldackel/extract/meta.yml @@ -60,3 +60,5 @@ output: pattern: "versions.yml" authors: - "@phue" +maintainers: + - "@phue" diff --git a/modules/nf-core/methyldackel/mbias/environment.yml b/modules/nf-core/methyldackel/mbias/environment.yml new file mode 100644 index 00000000..f7cebb6f --- /dev/null +++ b/modules/nf-core/methyldackel/mbias/environment.yml @@ -0,0 +1,7 @@ +name: methyldackel_mbias +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::methyldackel=0.6.0 diff --git a/modules/nf-core/methyldackel/mbias/main.nf b/modules/nf-core/methyldackel/mbias/main.nf index b30d3391..eed21299 100644 --- a/modules/nf-core/methyldackel/mbias/main.nf +++ b/modules/nf-core/methyldackel/mbias/main.nf @@ -2,7 +2,7 @@ process METHYLDACKEL_MBIAS { tag "$meta.id" label 'process_low' - conda "bioconda::methyldackel=0.6.0" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/methyldackel:0.6.0--h22771d5_0' : 'biocontainers/methyldackel:0.6.0--h22771d5_0' }" diff --git a/modules/nf-core/methyldackel/mbias/meta.yml b/modules/nf-core/methyldackel/mbias/meta.yml index 75217232..e3b55f97 100644 --- a/modules/nf-core/methyldackel/mbias/meta.yml +++ b/modules/nf-core/methyldackel/mbias/meta.yml @@ -57,3 +57,5 @@ output: pattern: "versions.yml" authors: - "@phue" +maintainers: + - "@phue" diff --git a/modules/nf-core/picard/markduplicates/environment.yml b/modules/nf-core/picard/markduplicates/environment.yml new file mode 100644 index 00000000..58b795f5 --- /dev/null +++ b/modules/nf-core/picard/markduplicates/environment.yml @@ -0,0 +1,7 @@ +name: picard_markduplicates +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::picard=3.1.1 diff --git a/modules/nf-core/picard/markduplicates/main.nf b/modules/nf-core/picard/markduplicates/main.nf index 7ba8448f..80930cc4 100644 --- a/modules/nf-core/picard/markduplicates/main.nf +++ b/modules/nf-core/picard/markduplicates/main.nf @@ -2,15 +2,15 @@ process PICARD_MARKDUPLICATES { tag "$meta.id" label 'process_medium' - conda "bioconda::picard=3.0.0" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:3.0.0--hdfd78af_1' : - 'biocontainers/picard:3.0.0--hdfd78af_1' }" + 'https://depot.galaxyproject.org/singularity/picard:3.1.1--hdfd78af_0' : + 'biocontainers/picard:3.1.1--hdfd78af_0' }" input: tuple val(meta), path(bam) - path fasta - path fai + tuple val(meta2), path(fasta) + tuple val(meta3), path(fai) output: tuple val(meta), path("*.bam") , emit: bam @@ -30,6 +30,9 @@ process PICARD_MARKDUPLICATES { } else { avail_mem = (task.memory.mega*0.8).intValue() } + + if ("$bam" == "${prefix}.bam") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + """ picard \\ -Xmx${avail_mem}M \\ @@ -48,6 +51,7 @@ process PICARD_MARKDUPLICATES { stub: def prefix = task.ext.prefix ?: "${meta.id}" + if ("$bam" == "${prefix}.bam") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" """ touch ${prefix}.bam touch ${prefix}.bam.bai diff --git a/modules/nf-core/picard/markduplicates/meta.yml b/modules/nf-core/picard/markduplicates/meta.yml index 3f2357bb..1ab90c07 100644 --- a/modules/nf-core/picard/markduplicates/meta.yml +++ b/modules/nf-core/picard/markduplicates/meta.yml @@ -25,10 +25,20 @@ input: type: file description: BAM file pattern: "*.{bam,cram,sam}" + - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] - fasta: type: file description: Reference genome fasta file pattern: "*.{fasta,fa}" + - meta3: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] - fai: type: file description: Reference genome fasta index @@ -58,3 +68,8 @@ output: authors: - "@drpatelh" - "@projectoriented" + - "@ramprasadn" +maintainers: + - "@drpatelh" + - "@projectoriented" + - "@ramprasadn" diff --git a/modules/nf-core/picard/markduplicates/tests/main.nf.test b/modules/nf-core/picard/markduplicates/tests/main.nf.test new file mode 100644 index 00000000..b2bba094 --- /dev/null +++ b/modules/nf-core/picard/markduplicates/tests/main.nf.test @@ -0,0 +1,111 @@ +nextflow_process { + + name "Test Process PICARD_MARKDUPLICATES" + script "../main.nf" + process "PICARD_MARKDUPLICATES" + config "./nextflow.config" + tag "modules" + tag "modules_nfcore" + tag "picard" + tag "picard/markduplicates" + + test("sarscov2 - bam, fasta, fai - sorted bam") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], + file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + path(process.out.metrics.get(0).get(1)).readLines()[0..2], + process.out.versions + ).match() } + ) + } + } + + test("sarscov2 - bam, fasta, fai - unsorted bam") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], + file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + path(process.out.metrics.get(0).get(1)).readLines()[0..2], + process.out.versions + ).match() } + ) + } + } + + test("homo_sapiens - cram, fasta, fai") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + path(process.out.metrics.get(0).get(1)).readLines()[0..2], + process.out.versions + ).match() } + ) + } + } + +} diff --git a/modules/nf-core/picard/markduplicates/tests/main.nf.test.snap b/modules/nf-core/picard/markduplicates/tests/main.nf.test.snap new file mode 100644 index 00000000..cd788a4d --- /dev/null +++ b/modules/nf-core/picard/markduplicates/tests/main.nf.test.snap @@ -0,0 +1,44 @@ +{ + "sarscov2 - bam, fasta, fai - unsorted bam": { + "content": [ + "test.marked.bam", + [ + "## htsjdk.samtools.metrics.StringHeader", + "# MarkDuplicates --INPUT test.paired_end.bam --OUTPUT test.marked.bam --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --REFERENCE_SEQUENCE genome.fasta --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_QUALITY_SUM_STRATEGY false --USE_END_IN_UNPAIRED_READS false --USE_UNPAIRED_CLIPPED_END false --UNPAIRED_END_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", + "## htsjdk.samtools.metrics.StringHeader" + ], + [ + "versions.yml:md5,b699af51b1956f3810f8a7c066e0ab17" + ] + ], + "timestamp": "2023-11-28T10:50:37.735339781" + }, + "homo_sapiens - cram, fasta, fai": { + "content": [ + "test.marked.bam", + [ + "## htsjdk.samtools.metrics.StringHeader", + "# MarkDuplicates --INPUT test.paired_end.sorted.cram --OUTPUT test.marked.bam --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --REFERENCE_SEQUENCE genome.fasta --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_QUALITY_SUM_STRATEGY false --USE_END_IN_UNPAIRED_READS false --USE_UNPAIRED_CLIPPED_END false --UNPAIRED_END_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", + "## htsjdk.samtools.metrics.StringHeader" + ], + [ + "versions.yml:md5,b699af51b1956f3810f8a7c066e0ab17" + ] + ], + "timestamp": "2023-11-28T10:50:48.897954543" + }, + "sarscov2 - bam, fasta, fai - sorted bam": { + "content": [ + "test.marked.bam", + [ + "## htsjdk.samtools.metrics.StringHeader", + "# MarkDuplicates --INPUT test.paired_end.sorted.bam --OUTPUT test.marked.bam --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --REFERENCE_SEQUENCE genome.fasta --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_QUALITY_SUM_STRATEGY false --USE_END_IN_UNPAIRED_READS false --USE_UNPAIRED_CLIPPED_END false --UNPAIRED_END_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", + "## htsjdk.samtools.metrics.StringHeader" + ], + [ + "versions.yml:md5,b699af51b1956f3810f8a7c066e0ab17" + ] + ], + "timestamp": "2023-11-28T10:50:26.591387512" + } +} \ No newline at end of file diff --git a/modules/nf-core/picard/markduplicates/tests/nextflow.config b/modules/nf-core/picard/markduplicates/tests/nextflow.config new file mode 100644 index 00000000..02818dd6 --- /dev/null +++ b/modules/nf-core/picard/markduplicates/tests/nextflow.config @@ -0,0 +1,6 @@ +process { + withName: PICARD_MARKDUPLICATES { + ext.prefix = { "${meta.id}.marked" } + ext.args = '--ASSUME_SORT_ORDER queryname' + } +} diff --git a/modules/nf-core/picard/markduplicates/tests/tags.yml b/modules/nf-core/picard/markduplicates/tests/tags.yml new file mode 100644 index 00000000..4f213d62 --- /dev/null +++ b/modules/nf-core/picard/markduplicates/tests/tags.yml @@ -0,0 +1,2 @@ +picard/markduplicates: + - modules/nf-core/picard/markduplicates/** diff --git a/modules/nf-core/preseq/lcextrap/environment.yml b/modules/nf-core/preseq/lcextrap/environment.yml new file mode 100644 index 00000000..57b8b9c6 --- /dev/null +++ b/modules/nf-core/preseq/lcextrap/environment.yml @@ -0,0 +1,7 @@ +name: preseq_lcextrap +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::preseq=3.1.2 diff --git a/modules/nf-core/preseq/lcextrap/main.nf b/modules/nf-core/preseq/lcextrap/main.nf index 12546f0a..ebbf215f 100644 --- a/modules/nf-core/preseq/lcextrap/main.nf +++ b/modules/nf-core/preseq/lcextrap/main.nf @@ -3,7 +3,7 @@ process PRESEQ_LCEXTRAP { label 'process_single' label 'error_ignore' - conda "bioconda::preseq=3.1.2" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/preseq:3.1.2--h445547b_2': 'biocontainers/preseq:3.1.2--h445547b_2' }" diff --git a/modules/nf-core/preseq/lcextrap/meta.yml b/modules/nf-core/preseq/lcextrap/meta.yml index 1391961c..4b37a7be 100755 --- a/modules/nf-core/preseq/lcextrap/meta.yml +++ b/modules/nf-core/preseq/lcextrap/meta.yml @@ -10,9 +10,7 @@ tools: homepage: http://smithlabresearch.org/software/preseq/ documentation: http://smithlabresearch.org/wp-content/uploads/manual.pdf tool_dev_url: https://github.com/smithlabcode/preseq - licence: ["GPL"] - input: - meta: type: map @@ -23,7 +21,6 @@ input: type: file description: BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" - output: - meta: type: map @@ -42,7 +39,9 @@ output: type: file description: Log file containing stderr produced by Preseq pattern: "*.{log}" - authors: - "@drpatelh" - "@Emiller88" +maintainers: + - "@drpatelh" + - "@Emiller88" diff --git a/modules/nf-core/preseq/lcextrap/tests/main.nf.test b/modules/nf-core/preseq/lcextrap/tests/main.nf.test new file mode 100644 index 00000000..4d66da9c --- /dev/null +++ b/modules/nf-core/preseq/lcextrap/tests/main.nf.test @@ -0,0 +1,53 @@ +nextflow_process { + + name "Test Process PRESEQ_LCEXTRAP" + script "../main.nf" + process "PRESEQ_LCEXTRAP" + tag "modules" + tag "modules_nfcore" + tag "preseq" + tag "preseq/lcextrap" + + test("sarscov2 - single_end") { + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + [ file(params.test_data['sarscov2']['genome']['lc_extrap_mr'], checkIfExists: true) ] + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.log[0][1]).name).match("single_end - log") }, + { assert snapshot(process.out.lc_extrap).match("single_end - lc_extrap") }, + { assert snapshot(process.out.versions).match("single_end - versions") } + ) + } + } + + test("sarscov2 - paired_end") { + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ file(params.test_data['sarscov2']['genome']['lc_extrap_mr'], checkIfExists: true) ] + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.log[0][1]).name).match("paired_end - log") }, + { assert snapshot(process.out.lc_extrap).match("paired_end - lc_extrap") }, + { assert snapshot(process.out.versions).match("paired_end - versions") } + ) + } + }} \ No newline at end of file diff --git a/modules/nf-core/preseq/lcextrap/tests/main.nf.test.snap b/modules/nf-core/preseq/lcextrap/tests/main.nf.test.snap new file mode 100644 index 00000000..c59dea7f --- /dev/null +++ b/modules/nf-core/preseq/lcextrap/tests/main.nf.test.snap @@ -0,0 +1,58 @@ +{ + "single_end - lc_extrap": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.lc_extrap.txt:md5,1fa5cdd601079329618f61660bee00de" + ] + ] + ], + "timestamp": "2023-11-23T17:20:40.735535" + }, + "paired_end - log": { + "content": [ + "test.command.log" + ], + "timestamp": "2023-11-23T17:20:51.981746" + }, + "single_end - versions": { + "content": [ + [ + "versions.yml:md5,9a62ff1c212c53573808ccd2137b8922" + ] + ], + "timestamp": "2023-11-23T17:20:40.74601" + }, + "paired_end - versions": { + "content": [ + [ + "versions.yml:md5,9a62ff1c212c53573808ccd2137b8922" + ] + ], + "timestamp": "2023-11-23T17:20:52.02843" + }, + "single_end - log": { + "content": [ + "test.command.log" + ], + "timestamp": "2023-11-23T17:20:40.72985" + }, + "paired_end - lc_extrap": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.lc_extrap.txt:md5,10e5ea860e87fb6f5dc10f4f20c62040" + ] + ] + ], + "timestamp": "2023-11-23T17:20:51.998533" + } +} \ No newline at end of file diff --git a/modules/nf-core/preseq/lcextrap/tests/tags.yml b/modules/nf-core/preseq/lcextrap/tests/tags.yml new file mode 100644 index 00000000..b9e25ea7 --- /dev/null +++ b/modules/nf-core/preseq/lcextrap/tests/tags.yml @@ -0,0 +1,2 @@ +preseq/lcextrap: + - modules/nf-core/preseq/lcextrap/** diff --git a/modules/nf-core/qualimap/bamqc/environment.yml b/modules/nf-core/qualimap/bamqc/environment.yml new file mode 100644 index 00000000..8e46b029 --- /dev/null +++ b/modules/nf-core/qualimap/bamqc/environment.yml @@ -0,0 +1,7 @@ +name: qualimap_bamqc +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::qualimap=2.2.2d diff --git a/modules/nf-core/qualimap/bamqc/main.nf b/modules/nf-core/qualimap/bamqc/main.nf index fef7307a..7cf98266 100644 --- a/modules/nf-core/qualimap/bamqc/main.nf +++ b/modules/nf-core/qualimap/bamqc/main.nf @@ -2,7 +2,7 @@ process QUALIMAP_BAMQC { tag "$meta.id" label 'process_medium' - conda "bioconda::qualimap=2.2.2d" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/qualimap:2.2.2d--1' : 'biocontainers/qualimap:2.2.2d--1' }" diff --git a/modules/nf-core/qualimap/bamqc/meta.yml b/modules/nf-core/qualimap/bamqc/meta.yml index 303532eb..7756d497 100644 --- a/modules/nf-core/qualimap/bamqc/meta.yml +++ b/modules/nf-core/qualimap/bamqc/meta.yml @@ -36,7 +36,7 @@ output: Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - results: - type: dir + type: directory description: Qualimap results dir pattern: "*/*" - versions: @@ -45,3 +45,5 @@ output: pattern: "versions.yml" authors: - "@phue" +maintainers: + - "@phue" diff --git a/modules/nf-core/qualimap/bamqccram/environment.yml b/modules/nf-core/qualimap/bamqccram/environment.yml new file mode 100644 index 00000000..b3d0dfd7 --- /dev/null +++ b/modules/nf-core/qualimap/bamqccram/environment.yml @@ -0,0 +1,8 @@ +name: qualimap_bamqccram +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::qualimap=2.2.2d + - bioconda::samtools=1.16.1 diff --git a/modules/nf-core/qualimap/bamqccram/main.nf b/modules/nf-core/qualimap/bamqccram/main.nf index 327d8557..cc1af97d 100644 --- a/modules/nf-core/qualimap/bamqccram/main.nf +++ b/modules/nf-core/qualimap/bamqccram/main.nf @@ -2,7 +2,7 @@ process QUALIMAP_BAMQCCRAM { tag "$meta.id" label 'process_medium' - conda "bioconda::qualimap=2.2.2d bioconda::samtools=1.16.1" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/mulled-v2-d3934ca6bb4e61334891ffa2e9a4c87a530e3188:00d3c18496ddf07ea580fd00d1dd203cf31ab630-0' : 'biocontainers/mulled-v2-d3934ca6bb4e61334891ffa2e9a4c87a530e3188:00d3c18496ddf07ea580fd00d1dd203cf31ab630-0' }" diff --git a/modules/nf-core/qualimap/bamqccram/meta.yml b/modules/nf-core/qualimap/bamqccram/meta.yml index ea6c4d92..ec388b30 100644 --- a/modules/nf-core/qualimap/bamqccram/meta.yml +++ b/modules/nf-core/qualimap/bamqccram/meta.yml @@ -49,3 +49,5 @@ output: pattern: "versions.yml" authors: - "@FriederikeHanssen" +maintainers: + - "@FriederikeHanssen" diff --git a/modules/nf-core/samtools/faidx/environment.yml b/modules/nf-core/samtools/faidx/environment.yml new file mode 100644 index 00000000..01ccbcc7 --- /dev/null +++ b/modules/nf-core/samtools/faidx/environment.yml @@ -0,0 +1,7 @@ +name: samtools_faidx +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::samtools=1.18 diff --git a/modules/nf-core/samtools/faidx/main.nf b/modules/nf-core/samtools/faidx/main.nf index 4dd0e5b0..d3461627 100644 --- a/modules/nf-core/samtools/faidx/main.nf +++ b/modules/nf-core/samtools/faidx/main.nf @@ -2,18 +2,20 @@ process SAMTOOLS_FAIDX { tag "$fasta" label 'process_single' - conda "bioconda::samtools=1.17" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : - 'biocontainers/samtools:1.17--h00cdaf9_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.18--h50ea8bc_1' : + 'biocontainers/samtools:1.18--h50ea8bc_1' }" input: tuple val(meta), path(fasta) + tuple val(meta2), path(fai) output: - tuple val(meta), path ("*.fai"), emit: fai - tuple val(meta), path ("*.gzi"), emit: gzi, optional: true - path "versions.yml" , emit: versions + tuple val(meta), path ("*.{fa,fasta}") , emit: fa , optional: true + tuple val(meta), path ("*.fai") , emit: fai, optional: true + tuple val(meta), path ("*.gzi") , emit: gzi, optional: true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -23,8 +25,8 @@ process SAMTOOLS_FAIDX { """ samtools \\ faidx \\ - $args \\ - $fasta + $fasta \\ + $args cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -33,8 +35,12 @@ process SAMTOOLS_FAIDX { """ stub: + def match = (task.ext.args =~ /-o(?:utput)?\s(.*)\s?/).findAll() + def fastacmd = match[0] ? "touch ${match[0][1]}" : '' """ + ${fastacmd} touch ${fasta}.fai + cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/samtools/faidx/meta.yml b/modules/nf-core/samtools/faidx/meta.yml index fe2fe9a1..e189af28 100644 --- a/modules/nf-core/samtools/faidx/meta.yml +++ b/modules/nf-core/samtools/faidx/meta.yml @@ -3,6 +3,7 @@ description: Index FASTA file keywords: - index - fasta + - faidx tools: - samtools: description: | @@ -17,12 +18,21 @@ input: - meta: type: map description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + Groovy Map containing reference information + e.g. [ id:'test' ] - fasta: type: file description: FASTA file pattern: "*.{fa,fasta}" + - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] + - fai: + type: file + description: FASTA index file + pattern: "*.{fai}" output: - meta: type: map @@ -45,3 +55,7 @@ authors: - "@drpatelh" - "@ewels" - "@phue" +maintainers: + - "@drpatelh" + - "@ewels" + - "@phue" diff --git a/modules/nf-core/samtools/flagstat/environment.yml b/modules/nf-core/samtools/flagstat/environment.yml new file mode 100644 index 00000000..5efae053 --- /dev/null +++ b/modules/nf-core/samtools/flagstat/environment.yml @@ -0,0 +1,7 @@ +name: samtools_flagstat +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::samtools=1.18 diff --git a/modules/nf-core/samtools/flagstat/main.nf b/modules/nf-core/samtools/flagstat/main.nf index b75707ec..f1893d7c 100644 --- a/modules/nf-core/samtools/flagstat/main.nf +++ b/modules/nf-core/samtools/flagstat/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_FLAGSTAT { tag "$meta.id" label 'process_single' - conda "bioconda::samtools=1.17" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : - 'biocontainers/samtools:1.17--h00cdaf9_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.18--h50ea8bc_1' : + 'biocontainers/samtools:1.18--h50ea8bc_1' }" input: tuple val(meta), path(bam), path(bai) diff --git a/modules/nf-core/samtools/flagstat/meta.yml b/modules/nf-core/samtools/flagstat/meta.yml index 954225df..97991358 100644 --- a/modules/nf-core/samtools/flagstat/meta.yml +++ b/modules/nf-core/samtools/flagstat/meta.yml @@ -47,3 +47,5 @@ output: pattern: "versions.yml" authors: - "@drpatelh" +maintainers: + - "@drpatelh" diff --git a/modules/nf-core/samtools/flagstat/tests/main.nf.test b/modules/nf-core/samtools/flagstat/tests/main.nf.test new file mode 100644 index 00000000..c8dd8dc9 --- /dev/null +++ b/modules/nf-core/samtools/flagstat/tests/main.nf.test @@ -0,0 +1,36 @@ +nextflow_process { + + name "Test Process SAMTOOLS_FLAGSTAT" + script "../main.nf" + process "SAMTOOLS_FLAGSTAT" + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/flagstat" + + test("BAM") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.flagstat).match() }, + { assert path(process.out.versions.get(0)).getText().contains("samtools") } + ) + } + } +} diff --git a/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap b/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap new file mode 100644 index 00000000..880019f2 --- /dev/null +++ b/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap @@ -0,0 +1,16 @@ +{ + "BAM": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" + ] + ] + ], + "timestamp": "2023-11-14T15:49:22.577133" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/flagstat/tests/tags.yml b/modules/nf-core/samtools/flagstat/tests/tags.yml new file mode 100644 index 00000000..2d2b7255 --- /dev/null +++ b/modules/nf-core/samtools/flagstat/tests/tags.yml @@ -0,0 +1,2 @@ +samtools/flagstat: + - modules/nf-core/samtools/flagstat/** diff --git a/modules/nf-core/samtools/index/environment.yml b/modules/nf-core/samtools/index/environment.yml new file mode 100644 index 00000000..296ed99e --- /dev/null +++ b/modules/nf-core/samtools/index/environment.yml @@ -0,0 +1,7 @@ +name: samtools_index +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::samtools=1.18 diff --git a/modules/nf-core/samtools/index/main.nf b/modules/nf-core/samtools/index/main.nf index 0b20aa4b..8ad18fdc 100644 --- a/modules/nf-core/samtools/index/main.nf +++ b/modules/nf-core/samtools/index/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_INDEX { tag "$meta.id" label 'process_low' - conda "bioconda::samtools=1.17" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : - 'biocontainers/samtools:1.17--h00cdaf9_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.18--h50ea8bc_1' : + 'biocontainers/samtools:1.18--h50ea8bc_1' }" input: tuple val(meta), path(input) diff --git a/modules/nf-core/samtools/index/meta.yml b/modules/nf-core/samtools/index/meta.yml index 8bd2fa6f..01a4ee03 100644 --- a/modules/nf-core/samtools/index/meta.yml +++ b/modules/nf-core/samtools/index/meta.yml @@ -51,3 +51,7 @@ authors: - "@drpatelh" - "@ewels" - "@maxulysse" +maintainers: + - "@drpatelh" + - "@ewels" + - "@maxulysse" diff --git a/modules/nf-core/samtools/index/tests/csi.nextflow.config b/modules/nf-core/samtools/index/tests/csi.nextflow.config new file mode 100644 index 00000000..0ed260ef --- /dev/null +++ b/modules/nf-core/samtools/index/tests/csi.nextflow.config @@ -0,0 +1,7 @@ +process { + + withName: SAMTOOLS_INDEX { + ext.args = '-c' + } + +} diff --git a/modules/nf-core/samtools/index/tests/main.nf.test b/modules/nf-core/samtools/index/tests/main.nf.test new file mode 100644 index 00000000..c76a9169 --- /dev/null +++ b/modules/nf-core/samtools/index/tests/main.nf.test @@ -0,0 +1,87 @@ +nextflow_process { + + name "Test Process SAMTOOLS_INDEX" + script "../main.nf" + process "SAMTOOLS_INDEX" + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/index" + + test("sarscov2 [BAI]") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.bai).match("bai") }, + { assert path(process.out.versions.get(0)).getText().contains("samtools") } + ) + } + } + + test("homo_sapiens [CRAI]") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.crai).match("crai") }, + { assert path(process.out.versions.get(0)).getText().contains("samtools") } + ) + } + } + + test("homo_sapiens [CSI]") { + + config "./csi.nextflow.config" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert path(process.out.csi.get(0).get(1)).exists() }, + { assert path(process.out.versions.get(0)).getText().contains("samtools") } + ) + } + } +} diff --git a/modules/nf-core/samtools/index/tests/main.nf.test.snap b/modules/nf-core/samtools/index/tests/main.nf.test.snap new file mode 100644 index 00000000..b3baee7f --- /dev/null +++ b/modules/nf-core/samtools/index/tests/main.nf.test.snap @@ -0,0 +1,28 @@ +{ + "crai": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,14bc3bd5c89cacc8f4541f9062429029" + ] + ] + ], + "timestamp": "2023-11-15T15:17:37.30801" + }, + "bai": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.paired_end.sorted.bam.bai:md5,704c10dd1326482448ca3073fdebc2f4" + ] + ] + ], + "timestamp": "2023-11-15T15:17:30.869234" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/index/tests/tags.yml b/modules/nf-core/samtools/index/tests/tags.yml new file mode 100644 index 00000000..e0f58a7a --- /dev/null +++ b/modules/nf-core/samtools/index/tests/tags.yml @@ -0,0 +1,2 @@ +samtools/index: + - modules/nf-core/samtools/index/** diff --git a/modules/nf-core/samtools/sort/environment.yml b/modules/nf-core/samtools/sort/environment.yml new file mode 100644 index 00000000..cd50868c --- /dev/null +++ b/modules/nf-core/samtools/sort/environment.yml @@ -0,0 +1,7 @@ +name: samtools_sort +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::samtools=1.18 diff --git a/modules/nf-core/samtools/sort/main.nf b/modules/nf-core/samtools/sort/main.nf index 2b7753fd..4a666d42 100644 --- a/modules/nf-core/samtools/sort/main.nf +++ b/modules/nf-core/samtools/sort/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_SORT { tag "$meta.id" label 'process_medium' - conda "bioconda::samtools=1.17" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : - 'biocontainers/samtools:1.17--h00cdaf9_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.18--h50ea8bc_1' : + 'biocontainers/samtools:1.18--h50ea8bc_1' }" input: tuple val(meta), path(bam) diff --git a/modules/nf-core/samtools/sort/meta.yml b/modules/nf-core/samtools/sort/meta.yml index 07328431..2200de72 100644 --- a/modules/nf-core/samtools/sort/meta.yml +++ b/modules/nf-core/samtools/sort/meta.yml @@ -46,3 +46,6 @@ output: authors: - "@drpatelh" - "@ewels" +maintainers: + - "@drpatelh" + - "@ewels" diff --git a/modules/nf-core/samtools/sort/tests/main.nf.test b/modules/nf-core/samtools/sort/tests/main.nf.test new file mode 100644 index 00000000..abb80978 --- /dev/null +++ b/modules/nf-core/samtools/sort/tests/main.nf.test @@ -0,0 +1,73 @@ +nextflow_process { + + name "Test Process SAMTOOLS_SORT" + script "../main.nf" + process "SAMTOOLS_SORT" + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/sort" + + test("test_samtools_sort") { + + config "./nextflow.config" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + [ + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("test_samtools_sort_stub") { + + config "./nextflow.config" + options "-stub-run" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + [ + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + process.out.versions + ).match() } + ) + } + + } + +} diff --git a/modules/nf-core/samtools/sort/tests/main.nf.test.snap b/modules/nf-core/samtools/sort/tests/main.nf.test.snap new file mode 100644 index 00000000..ff722259 --- /dev/null +++ b/modules/nf-core/samtools/sort/tests/main.nf.test.snap @@ -0,0 +1,48 @@ +{ + "test_samtools_sort": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam:md5,ea6a0fef94eb534e901f107a05a33a06" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,33b6a403dc19a0d28e4219ccab0a1d80" + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam:md5,ea6a0fef94eb534e901f107a05a33a06" + ] + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,33b6a403dc19a0d28e4219ccab0a1d80" + ] + } + ], + "timestamp": "2023-12-04T11:11:22.005628301" + }, + "test_samtools_sort_stub": { + "content": [ + "test.sorted.bam", + [ + "versions.yml:md5,33b6a403dc19a0d28e4219ccab0a1d80" + ] + ], + "timestamp": "2023-12-04T17:47:22.314445935" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/sort/tests/nextflow.config b/modules/nf-core/samtools/sort/tests/nextflow.config new file mode 100644 index 00000000..d0f35086 --- /dev/null +++ b/modules/nf-core/samtools/sort/tests/nextflow.config @@ -0,0 +1,7 @@ +process { + + withName: SAMTOOLS_SORT { + ext.prefix = { "${meta.id}.sorted" } + } + +} diff --git a/modules/nf-core/samtools/sort/tests/tags.yml b/modules/nf-core/samtools/sort/tests/tags.yml new file mode 100644 index 00000000..cd63ea20 --- /dev/null +++ b/modules/nf-core/samtools/sort/tests/tags.yml @@ -0,0 +1,3 @@ +samtools/sort: + - modules/nf-core/samtools/sort/** + - tests/modules/nf-core/samtools/sort/** diff --git a/modules/nf-core/samtools/stats/environment.yml b/modules/nf-core/samtools/stats/environment.yml new file mode 100644 index 00000000..b89ce647 --- /dev/null +++ b/modules/nf-core/samtools/stats/environment.yml @@ -0,0 +1,7 @@ +name: samtools_stats +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::samtools=1.18 diff --git a/modules/nf-core/samtools/stats/main.nf b/modules/nf-core/samtools/stats/main.nf index eb7f098b..7539140a 100644 --- a/modules/nf-core/samtools/stats/main.nf +++ b/modules/nf-core/samtools/stats/main.nf @@ -2,14 +2,14 @@ process SAMTOOLS_STATS { tag "$meta.id" label 'process_single' - conda "bioconda::samtools=1.17" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : - 'biocontainers/samtools:1.17--h00cdaf9_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.18--h50ea8bc_1' : + 'biocontainers/samtools:1.18--h50ea8bc_1' }" input: tuple val(meta), path(input), path(input_index) - path fasta + tuple val(meta2), path(fasta) output: tuple val(meta), path("*.stats"), emit: stats diff --git a/modules/nf-core/samtools/stats/meta.yml b/modules/nf-core/samtools/stats/meta.yml index 1d68a5d8..735ff812 100644 --- a/modules/nf-core/samtools/stats/meta.yml +++ b/modules/nf-core/samtools/stats/meta.yml @@ -30,9 +30,14 @@ input: type: file description: BAI/CRAI file from alignment pattern: "*.{bai,crai}" + - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] - fasta: - type: optional file - description: Reference file the CRAM was created with + type: file + description: Reference file the CRAM was created with (optional) pattern: "*.{fasta,fa}" output: - meta: @@ -51,3 +56,8 @@ output: authors: - "@drpatelh" - "@FriederikeHanssen" + - "@ramprasadn" +maintainers: + - "@drpatelh" + - "@FriederikeHanssen" + - "@ramprasadn" diff --git a/modules/nf-core/samtools/stats/tests/main.nf.test b/modules/nf-core/samtools/stats/tests/main.nf.test new file mode 100644 index 00000000..20c3efe1 --- /dev/null +++ b/modules/nf-core/samtools/stats/tests/main.nf.test @@ -0,0 +1,78 @@ +nextflow_process { + + name "Test Process SAMTOOLS_STATS" + script "../main.nf" + process "SAMTOOLS_STATS" + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/stats" + + test("SAMTOOLS STATS Should run without failures") { + + when { + params { + + outdir = "$outputDir" + } + process { + """ + // define inputs of the process here. + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + + ] + input[1] = [[],[]] + """ + + } + } + + then { + assertAll( + {assert process.success}, + {assert snapshot(process.out).match()} + ) + } + + } + + test("SAMTOOLS CRAM Should run without failures") { + + when { + params { + + outdir = "$outputDir" + } + process { + """ + // define inputs of the process here + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram_crai'], checkIfExists: true) + + ] + input[1] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + + + } + + then { + assertAll( + {assert process.success}, + {assert snapshot(process.out).match()} + ) + } + + } + + +} diff --git a/modules/nf-core/samtools/stats/tests/main.nf.test.snap b/modules/nf-core/samtools/stats/tests/main.nf.test.snap new file mode 100644 index 00000000..025c83a5 --- /dev/null +++ b/modules/nf-core/samtools/stats/tests/main.nf.test.snap @@ -0,0 +1,64 @@ +{ + "SAMTOOLS STATS Should run without failures": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,045a48208b1c6f5b8af4347fe31f4def" + ] + ], + "1": [ + "versions.yml:md5,650a365c6635001436008350ae83337c" + ], + "stats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,045a48208b1c6f5b8af4347fe31f4def" + ] + ], + "versions": [ + "versions.yml:md5,650a365c6635001436008350ae83337c" + ] + } + ], + "timestamp": "2023-12-04T11:07:28.26821485" + }, + "SAMTOOLS CRAM Should run without failures": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,dfbfa130d4a6925ddd1931dcd8354a43" + ] + ], + "1": [ + "versions.yml:md5,650a365c6635001436008350ae83337c" + ], + "stats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,dfbfa130d4a6925ddd1931dcd8354a43" + ] + ], + "versions": [ + "versions.yml:md5,650a365c6635001436008350ae83337c" + ] + } + ], + "timestamp": "2023-12-04T11:07:50.356233402" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/stats/tests/tags.yml b/modules/nf-core/samtools/stats/tests/tags.yml new file mode 100644 index 00000000..7c28e30f --- /dev/null +++ b/modules/nf-core/samtools/stats/tests/tags.yml @@ -0,0 +1,2 @@ +samtools/stats: + - modules/nf-core/samtools/stats/** diff --git a/modules/nf-core/trimgalore/environment.yml b/modules/nf-core/trimgalore/environment.yml new file mode 100644 index 00000000..6cd0f51b --- /dev/null +++ b/modules/nf-core/trimgalore/environment.yml @@ -0,0 +1,7 @@ +name: trimgalore +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::trim-galore=0.6.7 diff --git a/modules/nf-core/trimgalore/main.nf b/modules/nf-core/trimgalore/main.nf index dcb77ae7..24ead871 100644 --- a/modules/nf-core/trimgalore/main.nf +++ b/modules/nf-core/trimgalore/main.nf @@ -2,7 +2,7 @@ process TRIMGALORE { tag "$meta.id" label 'process_high' - conda "bioconda::trim-galore=0.6.7" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/trim-galore:0.6.7--hdfd78af_0' : 'biocontainers/trim-galore:0.6.7--hdfd78af_0' }" diff --git a/modules/nf-core/trimgalore/meta.yml b/modules/nf-core/trimgalore/meta.yml index f84c4d77..e649088c 100644 --- a/modules/nf-core/trimgalore/meta.yml +++ b/modules/nf-core/trimgalore/meta.yml @@ -62,3 +62,7 @@ authors: - "@drpatelh" - "@ewels" - "@FelixKrueger" +maintainers: + - "@drpatelh" + - "@ewels" + - "@FelixKrueger" diff --git a/modules/nf-core/trimgalore/tests/main.nf.test b/modules/nf-core/trimgalore/tests/main.nf.test new file mode 100644 index 00000000..bc6812cc --- /dev/null +++ b/modules/nf-core/trimgalore/tests/main.nf.test @@ -0,0 +1,105 @@ +nextflow_process { + + name "Test Process TRIMGALORE" + script "../main.nf" + process "TRIMGALORE" + tag "modules" + tag "modules_nfcore" + tag "trimgalore" + + test("test_trimgalore_single_end") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ [ id:'test', single_end:true ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] + ] + """ + } + } + + then { + def read_lines = ["@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/1", + "TCATAAACCAAAGCACTCACAGTGTCAACAATTTCAGCAGGACAACGCCGACAAGTTCCGAGGAACATGTCTGGACCTATAGTTTTCATAAGTCTACACACTGAATTGAAATATTCTGGTTCTAGTGTGCCCTTAGTTAGCAATGTGCGT", + "AAAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEE + { assert path(process.out.reads.get(0).get(1)).linesGzip.contains(read_line) } + } + }, + { report1_lines.each { report1_line -> + { assert path(process.out.log.get(0).get(1)).getText().contains(report1_line) } + } + } + ) + } + } + + test("test_trimgalore_paired_end") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] + ] + """ + } + } + + then { + def read1_lines = ["@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/1", + "TCATAAACCAAAGCACTCACAGTGTCAACAATTTCAGCAGGACAACGCCGACAAGTTCCGAGGAACATGTCTGGACCTATAGTTTTCATAAGTCTACACACTGAATTGAAATATTCTGGTTCTAGTGTGCCCTTAGTTAGCAATGTGCGT", + "AAAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEE + { assert path(process.out.reads.get(0).get(1).get(0)).linesGzip.contains(read1_line) } + } + }, + { read2_lines.each { read2_line -> + { assert path(process.out.reads.get(0).get(1).get(1)).linesGzip.contains(read2_line) } + } + }, + { report1_lines.each { report1_line -> + { assert path(process.out.log.get(0).get(1).get(0)).getText().contains(report1_line) } + } + }, + { report2_lines.each { report2_line -> + { assert path(process.out.log.get(0).get(1).get(1)).getText().contains(report2_line) } + } + } + ) + } + } +} diff --git a/modules/nf-core/trimgalore/tests/main.nf.test.snap b/modules/nf-core/trimgalore/tests/main.nf.test.snap new file mode 100644 index 00000000..84feacca --- /dev/null +++ b/modules/nf-core/trimgalore/tests/main.nf.test.snap @@ -0,0 +1,148 @@ +{ + "test_trimgalore_single_end": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test_trimmed.fq.gz:md5,e0a7516b8ea8d6467d6306acb2cd13c4" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastq.gz_trimming_report.txt:md5,a1ab3958205f1ddf48af623242b5b429" + ] + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + + ], + "5": [ + "versions.yml:md5,47d966cbb31c80eb8f7fe860d55659b7" + ], + "html": [ + + ], + "log": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastq.gz_trimming_report.txt:md5,a1ab3958205f1ddf48af623242b5b429" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test_trimmed.fq.gz:md5,e0a7516b8ea8d6467d6306acb2cd13c4" + ] + ], + "unpaired": [ + + ], + "versions": [ + "versions.yml:md5,47d966cbb31c80eb8f7fe860d55659b7" + ], + "zip": [ + + ] + } + ], + "timestamp": "2023-10-17T15:24:57.782141441" + }, + "test_trimgalore_paired_end": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1_val_1.fq.gz:md5,e0a7516b8ea8d6467d6306acb2cd13c4", + "test_2_val_2.fq.gz:md5,f3d61189e6d10202da7b8686f1dbb71b" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastq.gz_trimming_report.txt:md5,315d40465412f9909bbaabf52269274d", + "test_2.fastq.gz_trimming_report.txt:md5,34436303da1c78811103427a2fb57f7b" + ] + ] + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + + ], + "5": [ + "versions.yml:md5,47d966cbb31c80eb8f7fe860d55659b7" + ], + "html": [ + + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastq.gz_trimming_report.txt:md5,315d40465412f9909bbaabf52269274d", + "test_2.fastq.gz_trimming_report.txt:md5,34436303da1c78811103427a2fb57f7b" + ] + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1_val_1.fq.gz:md5,e0a7516b8ea8d6467d6306acb2cd13c4", + "test_2_val_2.fq.gz:md5,f3d61189e6d10202da7b8686f1dbb71b" + ] + ] + ], + "unpaired": [ + + ], + "versions": [ + "versions.yml:md5,47d966cbb31c80eb8f7fe860d55659b7" + ], + "zip": [ + + ] + } + ], + "timestamp": "2023-10-17T15:25:08.513589909" + } +} \ No newline at end of file diff --git a/modules/nf-core/trimgalore/tests/tags.yml b/modules/nf-core/trimgalore/tests/tags.yml new file mode 100644 index 00000000..e9937691 --- /dev/null +++ b/modules/nf-core/trimgalore/tests/tags.yml @@ -0,0 +1,2 @@ +trimgalore: + - modules/nf-core/trimgalore/** diff --git a/modules/nf-core/untar/environment.yml b/modules/nf-core/untar/environment.yml index 2d52ce64..d6917da3 100644 --- a/modules/nf-core/untar/environment.yml +++ b/modules/nf-core/untar/environment.yml @@ -1,3 +1,4 @@ +name: untar channels: - conda-forge - bioconda diff --git a/modules/nf-core/untar/tests/main.nf.test b/modules/nf-core/untar/tests/main.nf.test new file mode 100644 index 00000000..d40db13d --- /dev/null +++ b/modules/nf-core/untar/tests/main.nf.test @@ -0,0 +1,77 @@ +nextflow_process { + + name "Test Process UNTAR" + script "../main.nf" + process "UNTAR" + + tag "modules" + tag "modules_nfcore" + tag "untar" + + test("test_untar") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ [], file(params.test_data['sarscov2']['genome']['kraken2_tar_gz'], checkIfExists: true) ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.untar).match("test_untar") }, + ) + } + + } + + test("test_untar_different_output_path") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ [], file(params.test_data['homo_sapiens']['illumina']['test_flowcell'], checkIfExists: true) ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.untar).match("test_untar_different_output_path") }, + ) + } + + } + + test("test_untar_onlyfiles") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ [], file(params.test_data['generic']['tar']['tar_gz'], checkIfExists: true) ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.untar).match("test_untar_onlyfiles") }, + ) + } + + } + +} diff --git a/modules/nf-core/untar/tests/main.nf.test.snap b/modules/nf-core/untar/tests/main.nf.test.snap new file mode 100644 index 00000000..146c8678 --- /dev/null +++ b/modules/nf-core/untar/tests/main.nf.test.snap @@ -0,0 +1,513 @@ +{ + "test_untar_different_output_path": { + "content": [ + [ + [ + [ + + ], + [ + [ + [ + [ + [ + [ + "s_1_1101.bcl:md5,ad01889e2ff43e2f194224e20bdb600c", + "s_1_1101.stats:md5,4bbbf103454b37fbc3138fadf1b4446b" + ], + [ + "s_1_1101.bcl:md5,565384bbe67a694dfd690bae6d1d30c2", + "s_1_1101.stats:md5,55e5abd8f129ff38ef169873547abdb8" + ], + [ + "s_1_1101.bcl:md5,650fa58a630a9148835ba79e323d4237", + "s_1_1101.stats:md5,77403669ca1b05340c390dff64425c1e" + ], + [ + "s_1_1101.bcl:md5,54471c9e97299cd141e202e204637702", + "s_1_1101.stats:md5,67b14c9a89b7f8556674a7524d5cfb2d" + ], + [ + "s_1_1101.bcl:md5,74e4f929fc7476c380fd9d741ddb6700", + "s_1_1101.stats:md5,5730a4c35463eaa12a06b6758710b98c" + ], + [ + "s_1_1101.bcl:md5,c785f472f4350c120c02c888c8189590", + "s_1_1101.stats:md5,fee4ec63895ea81007e06ee6a36ba5e0" + ], + [ + "s_1_1101.bcl:md5,b7ea50bb25f08d43c301741d77050a9b", + "s_1_1101.stats:md5,fa7c68f3122c74d14364e6f7b011af70" + ], + [ + "s_1_1101.bcl:md5,9d5087dc4bcae39d66486363d4f68ecf", + "s_1_1101.stats:md5,23cdceee4d82c4b8e7c60018b9276ace" + ], + [ + "s_1_1101.bcl:md5,581e0c5ee94e8f2de14b2b1d8e777530", + "s_1_1101.stats:md5,9a3536d573c97f66bb56b49463612607" + ], + [ + "s_1_1101.bcl:md5,296fc026bb34c67bbe2b44845fe0d1de", + "s_1_1101.stats:md5,a7f57a7770fb9c5ae2a0fb1ef403ec4f" + ], + [ + "s_1_1101.bcl:md5,2a3ca15531556c36d10d132a9e051de8", + "s_1_1101.stats:md5,2d0bcdb0a1b51d3d79e415db2ab2d3b1" + ], + [ + "s_1_1101.bcl:md5,1150d46a2ccd4ac58aee0585d3e4ffd7", + "s_1_1101.stats:md5,2e97550bd5b5864ffd0565bb7a3f6d40" + ], + [ + "s_1_1101.bcl:md5,0b85c4b3da0de95e7b862d849c5333ae", + "s_1_1101.stats:md5,6eab9746fbeb783b0cd70398f44e0c1a" + ], + [ + "s_1_1101.bcl:md5,e0e9c91f4698804d7a6d1058ef68b34f", + "s_1_1101.stats:md5,790022cdc7878a02b2ebd166e1ddf0a7" + ], + [ + "s_1_1101.bcl:md5,38cd0ad4de359e651c8ac0d5777ea625", + "s_1_1101.stats:md5,a1b1d5ea5371d326abb029774483c5e6" + ], + [ + "s_1_1101.bcl:md5,b0ddc05c4012ccba24e712a1cfec748f", + "s_1_1101.stats:md5,af3d232f839d720f76f40ba06caa2987" + ], + [ + "s_1_1101.bcl:md5,af32fcc5dc3b836cf7a5ba3db85a75dd", + "s_1_1101.stats:md5,f93f2c09bd4e486c74a5f6e2040f7296" + ], + [ + "s_1_1101.bcl:md5,54b7428e037ca87816107647d4a3d9db", + "s_1_1101.stats:md5,e5ac77a72cd7bed5e9bf03cccda0e48c" + ], + [ + "s_1_1101.bcl:md5,fc8b4eacd493bf3d0b20bc23998dc7ff", + "s_1_1101.stats:md5,190315e159e2f4bc4c057ded7470dc52" + ], + [ + "s_1_1101.bcl:md5,9484ecffda489927fce424ac6a44fa9d", + "s_1_1101.stats:md5,0825feeb457ecc9efcf6f8526ba32311" + ], + [ + "s_1_1101.bcl:md5,eec59e21036e31c95ce1e847bfb0a9c4", + "s_1_1101.stats:md5,9acc13f63c98e5a8445e7be70d49222b" + ], + [ + "s_1_1101.bcl:md5,a9fb24476f87cba4fba68e2b3c3f2c07", + "s_1_1101.stats:md5,dc0aa7db9790733291c3e6480ca2a0fc" + ], + [ + "s_1_1101.bcl:md5,ed950b3e82c500927c2e236c9df005c6", + "s_1_1101.stats:md5,dccb71ec47d1f9d33a192da6d5660a45" + ], + [ + "s_1_1101.bcl:md5,b3e992025e995ca56b5ea2820144ef47", + "s_1_1101.stats:md5,a6a829bf2cffb26ac5d9dc3012057699" + ], + [ + "s_1_1101.bcl:md5,89edc726a5a4e0b4ff8ca3899ed0232b", + "s_1_1101.stats:md5,5b9b4fd8110577a59b82d0c419519d29" + ], + [ + "s_1_1101.bcl:md5,4dc696149169f232c451225f563cb5cd", + "s_1_1101.stats:md5,d3514a71ea3adc60e2943c6b8f6e2598" + ], + [ + "s_1_1101.bcl:md5,35b992d0318afb7c825ceaa31b0755e6", + "s_1_1101.stats:md5,2826093acc175c16c3795de7c4ca8f07" + ], + [ + "s_1_1101.bcl:md5,7bc927f56a362e49c00b5d76ee048901", + "s_1_1101.stats:md5,e47d862b795fd6b88a31d7d482ab22f6" + ], + [ + "s_1_1101.bcl:md5,84742233ff2a651626fe9036f27f7cb2", + "s_1_1101.stats:md5,b78fad11d3c50bc76b722cdc03e3028b" + ], + [ + "s_1_1101.bcl:md5,3935341c86263a7938e8c49620ef39f8", + "s_1_1101.stats:md5,cc6585b2daac5354073d150874da9704" + ], + [ + "s_1_1101.bcl:md5,3627f4fd548bf6e64aaf08fba3a342be", + "s_1_1101.stats:md5,120ae4831ae004ff7d16728aef36e82f" + ], + [ + "s_1_1101.bcl:md5,07631014bc35124149fabd80ef19f933", + "s_1_1101.stats:md5,eadd63d91f47cc6db6b6f0a967a23927" + ], + [ + "s_1_1101.bcl:md5,a1149c80415dc2f34d768eeb397c43fb", + "s_1_1101.stats:md5,ca89a9def67611a9151c6ce685b7cce1" + ], + [ + "s_1_1101.bcl:md5,eb5f71d4741d2f40618756bc72eaf8b4", + "s_1_1101.stats:md5,90f48501e735e5915b843478e23d1ae2" + ], + [ + "s_1_1101.bcl:md5,9bf270fe3f6add1a591ebc24fff10078", + "s_1_1101.stats:md5,a4e429671d4098034293c638aa655e16" + ], + [ + "s_1_1101.bcl:md5,219bedcbd24bae54fe4cf05dae05282c", + "s_1_1101.stats:md5,dd97525b65b68207137d51fcf19132c7" + ], + [ + "s_1_1101.bcl:md5,5163bc00a68fd57ae50cae0b76350892", + "s_1_1101.stats:md5,b606a5368eff1f012f3ea5d11ccdf2e0" + ], + [ + "s_1_1101.bcl:md5,fc429195a5af59a59e0cc4c48e6c05ea", + "s_1_1101.stats:md5,d809aa19698053f90d639da4dcad8008" + ], + [ + "s_1_1101.bcl:md5,383340219a1dd77076a092a64a71a7e4", + "s_1_1101.stats:md5,b204a5cf256378679ffc906c15cc1bae" + ], + [ + "s_1_1101.bcl:md5,0c369540d3e24696cf1f9c55bab69315", + "s_1_1101.stats:md5,a2bc69a4031a22ce9621dcc623a0bf4b" + ], + [ + "s_1_1101.bcl:md5,3127abc8016ba8eb954f8f8015dff387", + "s_1_1101.stats:md5,5deafff31150b7bf757f814e49a53bc2" + ], + [ + "s_1_1101.bcl:md5,045f40c82de676bafec3d59f91376a7a", + "s_1_1101.stats:md5,890700edc20687c090ef52248c7884b1" + ], + [ + "s_1_1101.bcl:md5,78af269aa2b39a1d765703f0a4739a86", + "s_1_1101.stats:md5,303cf457aa1543a8208544f694cbc531" + ], + [ + "s_1_1101.bcl:md5,0ab8c781959b783b62888e9274364a46", + "s_1_1101.stats:md5,2605b0e8322f83aa4d0dae5da4ec7a7a" + ], + [ + "s_1_1101.bcl:md5,d0cf823ffe352e8b3f75d589544ab617", + "s_1_1101.stats:md5,efa3c0e01e3db71e12fd961cb2d03739" + ], + [ + "s_1_1101.bcl:md5,db4ca4ab7a01e03c246f9160c3758d82", + "s_1_1101.stats:md5,f61550d9e4a90df6b860e68f41f82f60" + ], + [ + "s_1_1101.bcl:md5,1af39a2c7e5ff20ece91cb8160b51d17", + "s_1_1101.stats:md5,d0e20879afcaf6dfcd88c73f1c5c78cf" + ], + [ + "s_1_1101.bcl:md5,4cf7123bb0fffcd79266df03aef01665", + "s_1_1101.stats:md5,29bff4075109a121b087116b58d7e927" + ], + [ + "s_1_1101.bcl:md5,aa9980428cb60cd6320f4b48f4dd0d74", + "s_1_1101.stats:md5,6b0e20bde93133117a8d1a6df3d6f37b" + ], + [ + "s_1_1101.bcl:md5,0f6e440374e15b9b491d52fb83a8adfe", + "s_1_1101.stats:md5,55cb5eb0ecdabd23dca39ab8c4607598" + ], + [ + "s_1_1101.bcl:md5,2c645d7bdaddaa403f6e304d36df9e4b", + "s_1_1101.stats:md5,53acf33d21f832779b400c2447386ce4" + ], + [ + "s_1_1101.bcl:md5,3bbf0863b423b770c879203644420206", + "s_1_1101.stats:md5,579bdc7293cac8c3d7407249cacf4c25" + ], + [ + "s_1_1101.bcl:md5,6658a08409e81d29cfeb2d096b491985", + "s_1_1101.stats:md5,bb559ffbea46d612f9933cefa84c4c03" + ], + [ + "s_1_1101.bcl:md5,1700d9a13d3d4f7643af2943ef838acb", + "s_1_1101.stats:md5,f01cb6050ebfb15da1e0399ebd791eb4" + ], + [ + "s_1_1101.bcl:md5,1ac7aa9ffae25eb103f755f33e4a39c6", + "s_1_1101.stats:md5,0b9d45d7929ccf336d5e5b95373ed3c2" + ], + [ + "s_1_1101.bcl:md5,812a97af2e983a53226e18c75190b06c", + "s_1_1101.stats:md5,d2410c7b0e506dab2972e77e2398de1e" + ], + [ + "s_1_1101.bcl:md5,c981e8e4dcc434956c2b86159da268bc", + "s_1_1101.stats:md5,e9c826e85361ce673f1f248786c9a611" + ], + [ + "s_1_1101.bcl:md5,88e09e99a0a4ef3357b203a41b22f77c", + "s_1_1101.stats:md5,ef06f2e5ad667bbd383f9ed6a05b7b42" + ], + [ + "s_1_1101.bcl:md5,461c8b146fc8a7938be38689978ecd09", + "s_1_1101.stats:md5,65115693935da66f9791b27136e22fb0" + ], + [ + "s_1_1101.bcl:md5,c7b827df5ce20e0f21916fe60860ca3f", + "s_1_1101.stats:md5,87be73613aeb507847f94d3cac5bb30a" + ], + [ + "s_1_1101.bcl:md5,7c4cc3dc9c8a1b0f15917b282dfb40ce", + "s_1_1101.stats:md5,bdd9181fa89debbfafe7b6ea3e064065" + ], + [ + "s_1_1101.bcl:md5,19f4debaf91e118aca8934517179ac33", + "s_1_1101.stats:md5,1143082719e136241d21b14a6b19b8a2" + ], + [ + "s_1_1101.bcl:md5,38aa256ad2d697d84b0b2c0e876a3eba", + "s_1_1101.stats:md5,64dd82f03df23f7f437eede2671ed4fe" + ], + [ + "s_1_1101.bcl:md5,b7929970378949571fed922c1b8cab32", + "s_1_1101.stats:md5,3d6d7985a41629fe196e4342d7fe36aa" + ], + [ + "s_1_1101.bcl:md5,fb2ed0bf6e89d79624ee78754e773491", + "s_1_1101.stats:md5,f34940810ff255aee79953496a12716d" + ], + [ + "s_1_1101.bcl:md5,4f8a8311f5f9c3a7629c1a973a7b280e", + "s_1_1101.stats:md5,4fd7cd28c09f4e152e7c2ad1ab541cd2" + ], + [ + "s_1_1101.bcl:md5,9eb46c903d0344e25af51f88cc311d60", + "s_1_1101.stats:md5,df3abd5f620d9e7f99496098d9fd3f7f" + ], + [ + "s_1_1101.bcl:md5,3ecbc17f3660e2014b58d7fe70ae62d5", + "s_1_1101.stats:md5,8e89a13c85a6d6ab3ccd251b66d1f165" + ], + [ + "s_1_1101.bcl:md5,5d59cc2499a77791233a64f73fe82894", + "s_1_1101.stats:md5,32ec99cd400f4b80cb26e2fa8e07ece0" + ], + [ + "s_1_1101.bcl:md5,1c052da47b9ae8554388f0fa3aade482", + "s_1_1101.stats:md5,d23f438772673688aa7bc92421dc6dce" + ], + [ + "s_1_1101.bcl:md5,1a52bd4f23130c0c96bc967ccd448a2b", + "s_1_1101.stats:md5,9b597e3388d59ef1f61aba30ac90ea79" + ], + [ + "s_1_1101.bcl:md5,8a1e84b79cf3f80794c20e3a0cc84688", + "s_1_1101.stats:md5,9561f7b6ef4b1849afc72b2bb49792bd" + ], + [ + "s_1_1101.bcl:md5,75c00111051f3fa95d04286823cb9109", + "s_1_1101.stats:md5,1fe786cdf8181767deafbd60b3c76610" + ], + [ + "s_1_1101.bcl:md5,529255d8deee0873ed5565e6d1a2ebda", + "s_1_1101.stats:md5,3fa7f467e97a75880f32d17b7429d316" + ], + [ + "s_1_1101.bcl:md5,ea4d960e3d9355d2149da71b88a21df4", + "s_1_1101.stats:md5,2540fe65586e8e800c1ddd8cddd1e8cd" + ], + [ + "s_1_1101.bcl:md5,0dfe1fd92a2dce2f23119aa483429744", + "s_1_1101.stats:md5,78257b2169fb9f0cf40966e06e847e86" + ], + [ + "s_1_1101.bcl:md5,f692ddc9aa3ab849271d07c666d0b3b9", + "s_1_1101.stats:md5,aa2ec6a3e3a9c116e34fe74a21e6459e" + ], + [ + "s_1_1101.bcl:md5,29cc4c239eae7c871c9a1adf92ebdb98", + "s_1_1101.stats:md5,263184813090acd740a5bf25304aed3a" + ], + [ + "s_1_1101.bcl:md5,e005af6a84925e326afbfe264241f047", + "s_1_1101.stats:md5,b6fb20868eebaffcc19daa694a449795" + ], + [ + "s_1_1101.bcl:md5,02f1a699b1ba9967accccf99a7af3d24", + "s_1_1101.stats:md5,4f007efacecaf26dc0e0231aede28754" + ], + [ + "s_1_1101.bcl:md5,df308c72a2dcc655cd95e98f5457187a", + "s_1_1101.stats:md5,130c4b07f4c14030bab012824cbe34da" + ], + [ + "s_1_1101.bcl:md5,f3ce10d8d2406b72355023bfa8c96822", + "s_1_1101.stats:md5,2638f4db393ed5b699ec2ce59ff0ec19" + ], + [ + "s_1_1101.bcl:md5,cc2f6d675ad1593ff96f734b172d249e", + "s_1_1101.stats:md5,f5b13f1e1ababc9e1a7a73b0b993cbf1" + ], + [ + "s_1_1101.bcl:md5,7938a0b21448305a951b023b1845b3a7", + "s_1_1101.stats:md5,fcd57511adabfc3ba1ac045165330006" + ], + [ + "s_1_1101.bcl:md5,44879bc6a38df1fee8def61868115041", + "s_1_1101.stats:md5,517e20e4b58a8023a37f9af62e0e2036" + ], + [ + "s_1_1101.bcl:md5,8749611e62406a7d2f34c610a55e56af", + "s_1_1101.stats:md5,8ccf24b3676ef84f2e513be8f2a9f3d1" + ], + [ + "s_1_1101.bcl:md5,a9846a037611cda3721958088f714c0e", + "s_1_1101.stats:md5,6438fa5a1892f328cab1605a95d80a3b" + ], + [ + "s_1_1101.bcl:md5,d6c4a2a726496476eb826532f974ed5f", + "s_1_1101.stats:md5,8c2c65b5e8b00dbf61ada65252aeb266" + ], + [ + "s_1_1101.bcl:md5,be3dde6cae7dd85855a6bf295ebfacfe", + "s_1_1101.stats:md5,93bc13f3b0749b2b8d8bcb0b1199f4f0" + ], + [ + "s_1_1101.bcl:md5,7c64514735a6cf1565b60647edd17d20", + "s_1_1101.stats:md5,4a0aa6c49b24f876415e5878cef7f805" + ], + [ + "s_1_1101.bcl:md5,3983b4043bc9df4b505202a5134ccf03", + "s_1_1101.stats:md5,1c9d9a8558adc1279ca27c96bc1b9758" + ], + [ + "s_1_1101.bcl:md5,a0b8d77f116ec95975f9253dcb768136", + "s_1_1101.stats:md5,c3992b786756e7ec42f65ef4b13b50d4" + ], + [ + "s_1_1101.bcl:md5,43c95ba35d06bb7c57fbd16f3d1cfd6c", + "s_1_1101.stats:md5,3cb69d04698c39f97f962e5bf1eea7f0" + ], + [ + "s_1_1101.bcl:md5,3dbeea0cad7052f19f53ff6f19dd4d90", + "s_1_1101.stats:md5,58bbc8254f0f5f4a244531e8e9c12a04" + ], + [ + "s_1_1101.bcl:md5,da56d088996376c898d855b6cd0a7dfc", + "s_1_1101.stats:md5,9f2d78af6908ce1576b89cdc059844ff" + ], + [ + "s_1_1101.bcl:md5,7b641a5565f095e9a6ffcad9e4305033", + "s_1_1101.stats:md5,3ada06c59b4fb41b83ab6abd0979e9fc" + ], + [ + "s_1_1101.bcl:md5,a3843d397a01d51657825bb652c191e5", + "s_1_1101.stats:md5,19341e52a4bfc7d9d48e9d2acc68c519" + ], + [ + "s_1_1101.bcl:md5,048e3ebfc8efeb8012def6b741c9060d", + "s_1_1101.stats:md5,88bd38deca1e87d700effab1fd099565" + ], + [ + "s_1_1101.bcl:md5,b340db0e07e829dd5da22371916a1a9e", + "s_1_1101.stats:md5,e44cfaddcc4ffb968e5b1a2f41ac48a5" + ], + [ + "s_1_1101.bcl:md5,e6011ec6eabbc2b8792deb283c621ce0", + "s_1_1101.stats:md5,090875dcd1a431af24bc631333f089c4" + ], + [ + "s_1_1101.bcl:md5,a08f216e3352345031ed100ec4245082", + "s_1_1101.stats:md5,97b949ef4b96219e1369f673cf5f8a6c" + ], + [ + "s_1_1101.bcl:md5,b43337c76fb037dfcf5f8f7bcb3618e5", + "s_1_1101.stats:md5,ddef585805e79951f69d23ab7354f69b" + ], + [ + "s_1_1101.bcl:md5,8c61fd004104397b360855e058bbf1bf", + "s_1_1101.stats:md5,0f8d253816d594dcfea3ccf48c826401" + ], + [ + "s_1_1101.bcl:md5,594d06310d328b188aa0b3edfff22cb2", + "s_1_1101.stats:md5,3160bf271b39aeb7590e4fd2984710ba" + ], + [ + "s_1_1101.bcl:md5,4c9eada67c9d55437211d83e111961d5", + "s_1_1101.stats:md5,2901b46ab16ec4863d30e4c84ec29c97" + ], + [ + "s_1_1101.bcl:md5,e03971ae5282f0accc0c1b7374d9ef1b", + "s_1_1101.stats:md5,60d2a19ce59bf70a21a28555484cead8" + ], + [ + "s_1_1101.bcl:md5,e1c6f7a06e63d149895d3e48e63df155", + "s_1_1101.stats:md5,44beb10af847ea3dddaf06dda7031126" + ], + [ + "s_1_1101.bcl:md5,960a99bf29a8f9d936e9b8582d46c9c6", + "s_1_1101.stats:md5,544cd1a7aaaa841914b40ece43399334" + ], + [ + "s_1_1101.bcl:md5,5706679f349fd4a6b6313bc2c41c7a42", + "s_1_1101.stats:md5,627eea844b26dae033848c2f9f69177b" + ], + [ + "s_1_1101.bcl:md5,21da5abc4b0402bbac14b5ab998b0b4f", + "s_1_1101.stats:md5,515bd140b095ad90473ca7a9a69877ab" + ], + "s_1_1101.control:md5,08a72e2198ae95150718e8adf011d105", + "s_1_1101.filter:md5,3a72bc73b323c8cb0ac5bfeb62d98989" + ] + ], + [ + "s_1_1101.locs:md5,0827ea802e5257cc5b20e757a33d4c98" + ], + "RTAConfiguration.xml:md5,c7d6e257bc374f142dc64b9d2281d4c9", + "config.xml:md5,9a4cc7ec01fefa2f1ce9bcb45bbad6e9" + ] + ], + [ + "ControlMetricsOut.bin:md5,6d77b38d0793a6e1ce1e85706e488953", + "CorrectedIntMetricsOut.bin:md5,2bbf84d3be72734addaa2fe794711434", + "ErrorMetricsOut.bin:md5,38c88def138e9bb832539911affdb286", + "ExtractionMetricsOut.bin:md5,7497c3178837eea8f09350b5cd252e99", + "IndexMetricsOut.bin:md5,d41d8cd98f00b204e9800998ecf8427e", + "QMetricsOut.bin:md5,7e9f198d53ebdfbb699a5f94cf1ed51c", + "TileMetricsOut.bin:md5,83891751ec1c91a425a524b476b6ca3c" + ], + "RunInfo.xml:md5,03038959f4dd181c86bc97ae71fe270a" + ] + ] + ] + ], + "timestamp": "2023-10-18T11:56:39.562418" + }, + "test_untar_onlyfiles": { + "content": [ + [ + [ + [ + + ], + [ + "hello.txt:md5,e59ff97941044f85df5297e1c302d260" + ] + ] + ] + ], + "timestamp": "2023-10-18T11:56:46.878844" + }, + "test_untar": { + "content": [ + [ + [ + [ + + ], + [ + "hash.k2d:md5,8b8598468f54a7087c203ad0190555d9", + "opts.k2d:md5,a033d00cf6759407010b21700938f543", + "taxo.k2d:md5,094d5891cdccf2f1468088855c214b2c" + ] + ] + ] + ], + "timestamp": "2023-10-18T11:56:08.16574" + } +} \ No newline at end of file diff --git a/modules/nf-core/untar/tests/tags.yml b/modules/nf-core/untar/tests/tags.yml new file mode 100644 index 00000000..feb6f15c --- /dev/null +++ b/modules/nf-core/untar/tests/tags.yml @@ -0,0 +1,2 @@ +untar: + - modules/nf-core/untar/** diff --git a/nextflow.config b/nextflow.config index b2bddb8a..b395e8df 100644 --- a/nextflow.config +++ b/nextflow.config @@ -17,6 +17,7 @@ params { igenomes_ignore = false // Qualimap options bamqc_regions_file = null + // MultiQC options multiqc_config = null multiqc_title = null @@ -24,16 +25,26 @@ params { max_multiqc_email_size = '25.MB' multiqc_methods_description = null - // Intermediate files + save_merged = false + save_trimmed = false save_reference = false save_align_intermeds = false unmapped = false - save_trimmed = false // Alignment options aligner = 'bismark' + non_directional = false + + // Methylation calling options + merge_cg = true + meth_cutoff = 1 comprehensive = false + no_overlap = true + ignore = 0 + ignore_3prime = 0 + ignore_r2 = 2 + ignore_3prime_r2 = 2 // Library presets pbat = false @@ -45,6 +56,7 @@ params { cegx = false epignome = false zymo = false + nomeseq = false // Trimming options clip_r1 = 0 @@ -54,8 +66,7 @@ params { nextseq_trim = 0 // Bismark options - non_directional = false - cytosine_report = false + local_alignment = false relax_mismatches = false num_mismatches = 0.6 // 0.6 will allow a penalty of bp * -0.6 @@ -69,16 +80,16 @@ params { ignore_3prime_r1 = 0 ignore_3prime_r2 = 2 known_splices = null - local_alignment = false minins = null maxins = null - nomeseq = false // bwa-meth options - min_depth = 0 ignore_flags = false methyl_kit = false + // Biscuit options + bs_conv_filter = 0.1 + // Skipping options skip_trimming = false skip_deduplication = false diff --git a/nextflow_schema.json b/nextflow_schema.json index a87bcb95..06c8bde8 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -10,7 +10,10 @@ "type": "object", "fa_icon": "fas fa-terminal", "description": "Define where the pipeline should find input data and save output data.", - "required": ["input", "outdir"], + "required": [ + "input", + "outdir" + ], "properties": { "input": { "type": "string", @@ -59,7 +62,20 @@ "save_reference": { "type": "boolean", "description": "Save reference(s) to results directory", - "fa_icon": "far fa-save" + "fa_icon": "far fa-save", + "help_text": "This can be helpful if you are generating an index for a species which does not already have one on iGenomes, and want to save time in subsequent runs." + }, + "save_merged": { + "type": "boolean", + "fa_icon": "fas fa-file-medical", + "description": "Save merged fastq(s) to results directory", + "help_text": "By default, merged (raw, untrimmed) FastQ files will not be saved to the results directory. Specify this flag (or set to true in your config file) to copy these files to the results directory when complete." + }, + "save_trimmed": { + "type": "boolean", + "description": "Save trimmed reads to results directory.", + "fa_icon": "fas fa-cut", + "help_text": "By default, trimmed FastQ files will not be saved to the results directory. Specify this flag (or set to true in your config file) to copy these files to the results directory when complete." }, "save_align_intermeds": { "type": "boolean", @@ -71,12 +87,6 @@ "description": "Bismark only - Save unmapped reads to FastQ files", "help_text": "Use the `--unmapped` flag to set the `--unmapped` flag with Bismark align and save the unmapped reads to FastQ files.", "fa_icon": "fas fa-recycle" - }, - "save_trimmed": { - "type": "boolean", - "description": "Save trimmed reads to results directory.", - "fa_icon": "fas fa-cut", - "help_text": "By default, trimmed FastQ files will not be saved to the results directory. Specify this flag (or set to true in your config file) to copy these files to the results directory when complete." } }, "fa_icon": "fas fa-save" @@ -125,6 +135,11 @@ "help_text": "Directory for a bwa-meth genome reference index. Only used when using the bwa-meth aligner.\n\nNote that this is not a complete path, but the directory containing the reference. For example, if you have file paths such as `/path/to/ref/genome.fa.bwameth.c2t.bwt`, you should specify `/path/to/ref/`.", "fa_icon": "far fa-dot-circle" }, + "biscuit_index": { + "type": "string", + "fa_icon": "fas fa-cookie-bite", + "description": "Path to a directory containing a Biscuit reference index" + }, "igenomes_base": { "type": "string", "description": "Directory / URL base for iGenomes references.", @@ -152,18 +167,82 @@ "default": "bismark", "description": "Alignment tool to use.", "fa_icon": "fas fa-dot-circle", - "enum": ["bismark", "bismark_hisat", "bwameth"], - "help_text": "The nf-core/methylseq package is actually two pipelines in one. The default workflow uses [Bismark](http://www.bioinformatics.babraham.ac.uk/projects/bismark/) with [Bowtie2](http://bowtie-bio.sourceforge.net/bowtie2/index.shtml) as alignment tool: unless specified otherwise, nf-core/methylseq will run this pipeline.\n\nSince bismark v0.21.0 it is also possible to use [HISAT2](https://ccb.jhu.edu/software/hisat2/index.shtml) as alignment tool. To run this workflow, invoke the pipeline with the command line flag `--aligner bismark_hisat`. HISAT2 also supports splice-aware alignment if analysis of RNA is desired (e.g. [SLAMseq](https://science.sciencemag.org/content/360/6390/800) experiments), a file containing a list of known splicesites can be provided with `--known_splices`.\n\nThe second workflow uses [BWA-Meth](https://github.com/brentp/bwa-meth) and [MethylDackel](https://github.com/dpryan79/methyldackel) instead of Bismark. To run this workflow, run the pipeline with the command line flag `--aligner bwameth`." + "enum": [ + "bismark", + "bismark_hisat", + "bwameth", + "biscuit" + ], + "help_text": "The nf-core/methylseq package is actually three pipelines in one. The default workflow uses [Bismark](http://www.bioinformatics.babraham.ac.uk/projects/bismark/) with [Bowtie2](http://bowtie-bio.sourceforge.net/bowtie2/index.shtml) as alignment tool: unless specified otherwise, nf-core/methylseq will run this pipeline.\n\nSince bismark v0.21.0 it is also possible to use [HISAT2](https://ccb.jhu.edu/software/hisat2/index.shtml) as alignment tool. To run this workflow, invoke the pipeline with the command line flag `--aligner bismark_hisat`. HISAT2 also supports splice-aware alignment if analysis of RNA is desired (e.g. [SLAMseq](https://science.sciencemag.org/content/360/6390/800) experiments), a file containing a list of known splicesites can be provided with `--known_splices`.\n\nThe second workflow uses [BWA-Meth](https://github.com/brentp/bwa-meth) and [MethylDackel](https://github.com/dpryan79/methyldackel). To run this workflow, run the pipeline with the command line flag `--aligner bwameth`.\n\nThe third workflow uses [Biscuit](https://huishenlab.github.io/biscuit/). To run this workflow, run the pipeline with the command line flag `--aligner biscuit`." + }, + "non_directional": { + "type": "boolean", + "description": "Run alignment against all four possible strands.", + "help_text": "All three aligners (Biscuit, Bismark, and bwa-meth) support 'directional' alignment, where reads are aligned against only the (converted) genome sequence ('original top' and 'original bottom' sequences). If your libraries are directional, this should result in faster and more accurate alignments.\nHowever, some library preparations produce library molecules which align against all four strands ('original top', 'original bottom', 'complement to original top', and 'complement to original bottom'). If your library is of this type, you should set this flag and use either the Bismark or Biscuit aligners (bwa-meth does not support non-directional alignment). \nSee [Biscuit](https://huishenlab.github.io/biscuit/docs/alignment#which-strand-to-map)\nor [Bismark](https://www.bioinformatics.babraham.ac.uk/projects/bismark/Bismark_User_Guide.pdf) docs for more details. \n\nNote that the `--single_cell` and `--zymo` parameters both set the `--non_directional` workflow flag automatically.", + "fa_icon": "fas fa-exchange-alt" + } + }, + "required": [ + "aligner" + ], + "fa_icon": "fas fa-braille" + }, + "methylation_calling_options": { + "title": "Methylation calling options", + "type": "object", + "description": "", + "default": "", + "fa_icon": "fas fa-balance-scale-left", + "properties": { + "merge_cg": { + "type": "boolean", + "description": "Set to false to report stranded methylation calls", + "help_text": "In many circumstances, it's desirable to merge the methylation data for the two paired cytosines in a CpG dinucleotide context. Such 'merged' data might also be referred to as 'unstranded methylation calls', as it does not differentiate between the two strands. \n\nIf this behavior is undesired, set this flag to `false` to retain information about strand-specific methylation. This has the following effects for each mapping tool:\n\n- Bismark: sets the `--cytosine_report` parameter for methylation extraction step\n- bwa-meth/MethylDackel: does not use the `--mergeContext` option in MethylDackel extract\n- biscuit: skips the `mergecg` step in the pipeline", + "fa_icon": "fas fa-clipboard", + "default": true + }, + "meth_cutoff": { + "type": "integer", + "description": "Minimum read depth to report a methylation call", + "help_text": "Sets the minimum required depth to report cytosine methylation information (default, 1, reports methylation at all covered sites). This flag has the following actions for the different mapping workflows:\n\n- Bismark: sets the `--cutoff` flag\n- bwa-meth: sets the `--minDepth` flag in MethylDackel `extract`\n- Biscuit: sets the `-k` flag in `biscuit pileup`", + "fa_icon": "fas fa-angle-double-down", + "default": 1 }, "comprehensive": { "type": "boolean", "description": "Output information for all cytosine contexts.", "fa_icon": "fas fa-arrows-alt", - "help_text": "By default, the pipeline only produces data for cytosine methylation states in CpG context. Specifying `--comprehensive` makes the pipeline give results for all cytosine contexts. Note that for large genomes (e.g. Human), these can be massive files. This is only recommended for small genomes (especially those that don't exhibit strong CpG context methylation specificity).\n\nIf specified, this flag instructs the Bismark methylation extractor to use the `--comprehensive` and `--merge_non_CpG` flags. This produces coverage files with information from about all strands and cytosine contexts merged into two files - one for CpG context and one for non-CpG context.\n\nIf using the bwa-meth workflow, the flag makes MethylDackel report CHG and CHH contexts as well." + "help_text": "By default, the pipeline only produces data for cytosine methylation states in CpG context. Specifying `--comprehensive` makes the pipeline give results for all cytosine contexts. Note that for large genomes (e.g. Human), these can be massive files. This is only recommended for small genomes (especially those that don't exhibit strong CpG context methylation specificity).\n\nThis flag has the following effects for each of the workflows:\n\nBismark: sets the `--comprehensive` and `--merge_non_CpG` flags. This produces coverage files with information from about all strands and cytosine contexts merged into two files - one for CpG context and one for non-CpG context.\nbwa-meth: sets the `--CHG` and `--CHH` flags in MethylDackel `extract`\nBiscuit: sets `-t c` in biscuit `pileup`" + }, + "ignore": { + "type": "integer", + "default": 0, + "fa_icon": "far fa-eye-slash", + "description": "Ignore methylation in the first n bases of 5' end of reads", + "help_text": "Methylation calls are frequently biased at the beginning and end of a read. Set this parameter to exclude methlation calls from the first few bases of a read. \n\n** Please note that the behavior of this flag differs in each aligner! **\n\nBismark: Ignore the first bp from the 5' end of **Read 1** of paired-end sequencing results only.\nbwa-meth: Ignore the first bp from the 5' end of **Read 1**\n\nBiscuit: Ignore the first bp from the 5' end of **all** reads." + }, + "ignore_3prime": { + "type": "integer", + "default": 0, + "fa_icon": "far fa-eye-slash", + "description": "Ignore methylation in the last n bases of 3' end of reads", + "help_text": "Methylation calls are frequently biased at the beginning and end of a read. Set this parameter to exclude methlation calls from the first few bases of a read. \n\n** Please note that the behavior of this flag differs in each aligner! **\n\nBismark: Ignore the last bp from the 3' end of **Read 1** of paired-end sequencing results only.\nbwa-meth: Ignore the last bp from the 3' end of **Read 1**\n\nBiscuit: Ignore the last bp from the 3' end of **all** reads." + }, + "ignore_r2": { + "type": "integer", + "default": 2, + "description": "Ignore methylation in first n bases of 5' end of R2", + "help_text": "Methylation calls are frequently biased at the beginning and end of a read. Set this parameter to exclude methlation calls from the first few bases of a read. \n\n** Please note that the behavior of this flag differs in each aligner! **\n\nBismark: Ignore the first bp from the 5' end of **Read 2** of paired-end sequencing results only.\nbwa-meth: Ignore the first bp from the 5' end of **Read 2**\n\nBiscuit: not supported (Biscuit does not currently discriminate between read 1 and read 2 for this option; use the `ignore` and `ignore_3prime` options to ignore methylation at the ends of both reads)", + "fa_icon": "far fa-eye-slash" + }, + "ignore_3prime_r2": { + "type": "integer", + "default": 2, + "description": "Ignore methylation in last n bases of 3' end of R2", + "help_text": "Methylation calls are frequently biased at the beginning and end of a read. Set this parameter to exclude methlation calls from the first few bases of a read. \n\n** Please note that the behavior of this flag differs in each aligner! **\n\nBismark: Ignore the last bp from the 3' end of **Read 2** of paired-end sequencing results only.\nbwa-meth: Ignore the last bp from the 3' end of **Read 2**\n\nBiscuit: not supported (Biscuit does not currently discriminate between read 1 and read 2 for this option; use the `ignore` and `ignore_3prime` options to ignore methylation at the ends of both reads)", + "fa_icon": "far fa-eye-slash" } - }, - "required": ["aligner"], - "fa_icon": "fas fa-braille" + } }, "special_library_types": { "title": "Special library types", @@ -224,6 +303,12 @@ "fa_icon": "fas fa-cut", "description": "Trimming preset for the Zymo kit.", "help_text": "Equivalent to `--clip_r1 10` `--clip_r2 10` `--three_prime_clip_r1 10` `--three_prime_clip_r2 10`.\n\nAlso sets the `--non_directional` flag for Bismark." + }, + "nomeseq": { + "type": "boolean", + "fa_icon": "fas fa-dna", + "description": "Sample is NOMe-seq or NMT-seq. Runs coverage2cytosine.", + "help_text": "Sets `--CX` during methylation extraction and `--nome` during the `coverage2cytosine` step.\n\nWill also force the coverage2cytosine step to run." } }, "fa_icon": "fas fa-prescription-bottle" @@ -261,7 +346,8 @@ "nextseq_trim": { "type": "integer", "default": 0, - "description": "Trim bases below this quality value from the 3' end of the read, ignoring high-quality G bases" + "description": "Trim bases below this quality value from the 3' end of the read, ignoring high-quality G bases", + "fa_icon": "fas fa-cut" } }, "fa_icon": "fas fa-cut", @@ -274,18 +360,6 @@ "default": "", "fa_icon": "fas fa-circle", "properties": { - "non_directional": { - "type": "boolean", - "description": "Run alignment against all four possible strands.", - "help_text": "By default, Bismark assumes that libraries are directional and does not align against complementary strands. If your library prep was not directional, use `--non_directional` to align against all four possible strands.\n\nNote that the `--single_cell` and `--zymo` parameters both set the `--non_directional` workflow flag automatically.", - "fa_icon": "fas fa-exchange-alt" - }, - "cytosine_report": { - "type": "boolean", - "description": "Output stranded cytosine report, following Bismark's bismark_methylation_extractor step.", - "help_text": "By default, Bismark does not produce stranded calls. With this option the output considers all Cs on both forward and reverse strands and reports their position, strand, trinucleotide context and methylation state.", - "fa_icon": "fas fa-clipboard" - }, "relax_mismatches": { "type": "boolean", "description": "Turn on to relax stringency for alignment (set allowed penalty with --num_mismatches).", @@ -299,12 +373,6 @@ "help_text": "Customise the penalty in the function used to filter reads based on mismatches. The parameter `--relax_mismatches` must also be specified.\n\nSee the parameter documentation for `--relax_mismatches` for an explanation.", "fa_icon": "fas fa-calculator" }, - "meth_cutoff": { - "type": "integer", - "description": "Specify a minimum read coverage to report a methylation call", - "help_text": "Use to discard any methylation calls with less than a given read coverage depth (in fold coverage) during Bismark's `bismark_methylation_extractor` step.", - "fa_icon": "fas fa-angle-double-down" - }, "no_overlap": { "type": "boolean", "default": true, @@ -319,13 +387,6 @@ "help_text": "Ignore the first bp from the 5' end of Read 1 (or single-end alignment files) when processing the methylation call string. This can remove e.g. a restriction enzyme site at the start of each read or any other source of bias (such as PBAT-Seq data).", "fa_icon": "far fa-eye-slash" }, - "ignore_r2": { - "type": "integer", - "default": 2, - "description": "Ignore methylation in first n bases of 5' end of R2", - "help_text": "Ignore the first bp from the 5' end of Read 2 of paired-end sequencing results only. Since the first couple of bases in Read 2 of BS-Seq experiments show a severe bias towards non-methylation as a result of end-repairing sonicated fragments with unmethylated cytosines (see M-bias plot), it is recommended that the first couple of bp of Read 2 are removed before starting downstream analysis. Please see the section on M-bias plots in the Bismark User Guide for more details.", - "fa_icon": "far fa-eye-slash" - }, "ignore_3prime_r1": { "type": "integer", "default": 0, @@ -333,13 +394,6 @@ "help_text": "Ignore the first bp from the 5' end of Read 2 of paired-end sequencing results only. Since the first couple of bases in Read 2 of BS-Seq experiments show a severe bias towards non-methylation as a result of end-repairing sonicated fragments with unmethylated cytosines (see M-bias plot), it is recommended that the first couple of bp of Read 2 are removed before starting downstream analysis. Please see the section on M-bias plots in the Bismark User Guide for more details.", "fa_icon": "far fa-eye-slash" }, - "ignore_3prime_r2": { - "type": "integer", - "default": 2, - "description": "Ignore methylation in last n bases of 3' end of R2", - "help_text": "Ignore the last bp from the 3' end of Read 1 (or single-end alignment files) when processing the methylation call string. This can remove unwanted biases from the end of reads.", - "fa_icon": "far fa-eye-slash" - }, "known_splices": { "type": "string", "format": "file-path", @@ -366,12 +420,6 @@ "fa_icon": "fas fa-expand-alt", "description": "The maximum insert size for valid paired-end alignments.", "help_text": "For example, if `--maxins 100` is specified and a paired-end alignment consists of two 20-bp alignments in the proper orientation with a 60-bp gap between them, that alignment is considered valid (as long as `--minins` is also satisfied). A 61-bp gap would not be valid in that case.\n\nDefault: not specified. Bismark default: `500`." - }, - "nomeseq": { - "type": "boolean", - "fa_icon": "fas fa-dna", - "description": "Sample is NOMe-seq or NMT-seq. Runs coverage2cytosine.", - "help_text": "Sets `--CX` during methylation extraction and `--nome` during the `coverage2cytosine` step.\n\nWill also force the coverage2cytosine step to run." } } }, @@ -381,12 +429,6 @@ "description": "", "default": "", "properties": { - "min_depth": { - "type": "integer", - "description": "Specify a minimum read coverage for MethylDackel to report a methylation call.", - "default": 0, - "fa_icon": "fas fa-angle-double-down" - }, "ignore_flags": { "type": "boolean", "description": "MethylDackel - ignore SAM flags", @@ -402,6 +444,22 @@ }, "fa_icon": "far fa-circle" }, + "biscuit_options": { + "title": "Biscuit options", + "type": "object", + "description": "", + "default": "", + "fa_icon": "fas fa-cookie-bite", + "properties": { + "bs_conv_filter": { + "type": "number", + "default": 0.1, + "description": "Discard reads with excessive CpH retention", + "help_text": "When the `biscuit` alignment option is selected, it is possible to remove reads that are likely to originate from molecules displaying poor bisulfite conversion. The default is 0.1, i.e. reads with more than 10% CpH methylation are discarded. Set to 1 to disable filtering.", + "fa_icon": "fas fa-filter" + } + } + }, "qualimap_options": { "title": "Qualimap Options", "type": "object", @@ -437,7 +495,8 @@ }, "skip_multiqc": { "type": "boolean", - "description": "Skip MultiQC" + "description": "Skip MultiQC", + "fa_icon": "fas fa-fast-forward" } }, "fa_icon": "fas fa-fast-forward" @@ -650,6 +709,9 @@ { "$ref": "#/definitions/alignment_options" }, + { + "$ref": "#/definitions/methylation_calling_options" + }, { "$ref": "#/definitions/special_library_types" }, @@ -662,6 +724,9 @@ { "$ref": "#/definitions/bwa_meth_options" }, + { + "$ref": "#/definitions/biscuit_options" + }, { "$ref": "#/definitions/qualimap_options" }, diff --git a/subworkflows/local/biscuit.nf b/subworkflows/local/biscuit.nf new file mode 100644 index 00000000..6346a958 --- /dev/null +++ b/subworkflows/local/biscuit.nf @@ -0,0 +1,168 @@ +/* + * biscuit subworkflow + */ + +include { BISCUIT_INDEX } from '../../modules/nf-core/biscuit/index/main' +include { BISCUIT_ALIGN } from '../../modules/nf-core/biscuit/align/main' +include { BISCUIT_BLASTER } from '../../modules/nf-core/biscuit/biscuitblaster/main' +include { BISCUIT_BSCONV } from '../../modules/nf-core/biscuit/bsconv/main' +include { SAMTOOLS_INDEX as SAMTOOLS_INDEX_BSCONV } from '../../modules/nf-core/samtools/index/main' +include { BISCUIT_PILEUP } from '../../modules/nf-core/biscuit/pileup/main' +include { BISCUIT_QC } from '../../modules/nf-core/biscuit/qc/main' +include { BISCUIT_VCF2BED as BISCUIT_VCF2BED_METH } from '../../modules/nf-core/biscuit/vcf2bed/main' +include { BISCUIT_MERGECG as BISCUIT_MERGECG_METH } from '../../modules/nf-core/biscuit/mergecg/main' +if (params.nomeseq) { + include { BISCUIT_VCF2BED as BISCUIT_VCF2BED_NOME } from '../../modules/nf-core/biscuit/vcf2bed/main' + include { BISCUIT_MERGECG as BISCUIT_MERGECG_NOME } from '../../modules/nf-core/biscuit/mergecg/main' +} + +workflow BISCUIT { + take: + reads // channel: [ val(meta), [ reads ] ] + biscuit_index // channel : /path/to/biscuit/index + skip_deduplication + merge_cg + + main: + versions = Channel.empty() + + /* + * If we're using the --pbat option, biscuit will be set to -b 1. + * However, that would force the reads to align to the opposite strands we want, + * so we have to reverse the read order in the list (read 2 first, then read 1) + */ + if (params.pbat) { + reads = reads.map{meta, reads -> meta.single_end ? [meta, reads] : [meta, reads.reverse()]} + } + + /* + * Align with biscuit; mark duplicates unless params.skip_deduplication + */ + if (skip_deduplication){ + BISCUIT_ALIGN ( + reads, + biscuit_index + ) + versions = versions.mix(BISCUIT_ALIGN.out.versions) + BISCUIT_ALIGN.out.bam + .mix(BISCUIT_ALIGN.out.bai) + .groupTuple(by: 0, size: 2, sort: {a, b -> a.toString() =~ /\.bai$/ ? 1: -1}) // make sure the bam is always before its index + .map{ meta, bam_bai -> [ meta, bam_bai[0], bam_bai[1] ] } + .set{ alignments } + } else { + BISCUIT_BLASTER ( + reads, + biscuit_index + ) + versions = versions.mix(BISCUIT_BLASTER.out.versions) + BISCUIT_BLASTER.out.bam + .mix(BISCUIT_BLASTER.out.bai) + .groupTuple(by: 0, size: 2, sort: {a, b -> a.toString() =~ /\.bai$/ ? 1: -1}) + .map{ meta, bam_bai -> [ meta, bam_bai[0], bam_bai[1] ] } + .set{ alignments } + } + + /* + * Filter out reads with poor bisulfite conversion + */ + if (params.bs_conv_filter < 1) { + BISCUIT_BSCONV ( + alignments, + biscuit_index + ) + + SAMTOOLS_INDEX_BSCONV ( BISCUIT_BSCONV.out.bsconv_bam ) + + BISCUIT_BSCONV.out.bsconv_bam + .mix(SAMTOOLS_INDEX_BSCONV.out.bai) + .groupTuple(by: 0, size: 2, sort: {a, b -> a.toString() =~ /\.bai$/ ? 1: -1}) // make sure bam is always before bai + .map{ meta, bam_bai -> [ meta, bam_bai[0], bam_bai[1] ] } + .set{ alignments } + versions = versions.mix(BISCUIT_BSCONV.out.versions) + versions = versions.mix(SAMTOOLS_INDEX_BSCONV.out.versions) + } + + /* + * Extract all snp and methlyation information + */ + BISCUIT_PILEUP ( + alignments.map{ meta, bam, bai -> [ meta, bam, bai, [], [] ] }, // add in blank lists to cover 'optional' pileup inputs + biscuit_index + ) + versions = versions.mix(BISCUIT_PILEUP.out.versions) + + /* + * Extract methlation information + */ + BISCUIT_VCF2BED_METH ( + BISCUIT_PILEUP.out.vcf + ) + versions = versions.mix(BISCUIT_VCF2BED_METH.out.versions) + + /* + * Extract accessibility information + */ + if (params.nomeseq) { + BISCUIT_VCF2BED_NOME ( + BISCUIT_PILEUP.out.vcf + ) + nome_bed = BISCUIT_VCF2BED_NOME.out.bed + versions = versions.mix(BISCUIT_VCF2BED_NOME.out.versions) + } + + /* + * Merge information from neighboring C and G in CpG context + */ + if (params.merge_cg) { + BISCUIT_MERGECG_METH ( + BISCUIT_VCF2BED_METH.out.bed, + biscuit_index + ) + me_bed = BISCUIT_MERGECG_METH.out.mergecg_bed + versions = versions.mix(BISCUIT_MERGECG_METH.out.versions) + + if (params.nomeseq) { + BISCUIT_MERGECG_NOME ( + BISCUIT_VCF2BED_NOME.out.bed, + biscuit_index + ) + nome_bed = BISCUIT_MERGECG_NOME.out.mergecg_bed + versions = versions.mix(BISCUIT_MERGECG_NOME.out.versions) + } + } else { + me_bed = BISCUIT_VCF2BED_METH.out.bed + } + + /* + * QC alignments + */ + BISCUIT_QC ( + alignments.map{meta, bam, bai -> [meta, bam]}, + biscuit_index + ) + versions = versions.mix(BISCUIT_QC.out.versions) + + /* + * Collect MultiQC inputs + */ + if (!params.skip_multiqc) { + BISCUIT_QC.out.biscuit_qc_reports.collect{ it[1] } + .set{ multiqc_files } + } else { + multiqc_files = Channel.empty() + } + + emit: + bam = alignments.map{meta, bam, bai -> [ meta, bam]} + dedup = alignments.map{meta, bam, bai -> [ meta, bam]} + mqc = multiqc_files // path: *{html,txt} + versions +} + + +// TODO: +// include SNP information? + + + + diff --git a/subworkflows/local/bismark.nf b/subworkflows/local/bismark.nf index 797da7a4..2edfe547 100644 --- a/subworkflows/local/bismark.nf +++ b/subworkflows/local/bismark.nf @@ -15,7 +15,7 @@ workflow BISMARK { reads // channel: [ val(meta), [ reads ] ] bismark_index // channel: /path/to/BismarkIndex/ skip_deduplication // boolean: whether to deduplicate alignments - cytosine_report // boolean: whether the run coverage2cytosine + merge_cg // boolean: whether the run coverage2cytosine main: versions = Channel.empty() @@ -65,7 +65,7 @@ workflow BISMARK { /* * Run coverage2cytosine */ - if (cytosine_report) { + if (merge_cg) { BISMARK_COVERAGE2CYTOSINE ( BISMARK_METHYLATIONEXTRACTOR.out.coverage, bismark_index diff --git a/subworkflows/local/prepare_genome.nf b/subworkflows/local/prepare_genome.nf index 877541ea..4d95baab 100644 --- a/subworkflows/local/prepare_genome.nf +++ b/subworkflows/local/prepare_genome.nf @@ -6,6 +6,7 @@ include { UNTAR } from '../../modules/nf-core/untar/main' include { BISMARK_GENOMEPREPARATION } from '../../modules/nf-core/bismark/genomepreparation/main' include { BWAMETH_INDEX } from '../../modules/nf-core/bwameth/index/main' include { SAMTOOLS_FAIDX } from '../../modules/nf-core/samtools/faidx/main' +include { BISCUIT_INDEX } from '../../modules/nf-core/biscuit/index/main' workflow PREPARE_GENOME { @@ -15,6 +16,7 @@ workflow PREPARE_GENOME { ch_bismark_index = Channel.empty() ch_bwameth_index = Channel.empty() ch_fasta_index = Channel.empty() + ch_biscuit_index = Channel.empty() // FASTA, if supplied if (params.fasta) { @@ -69,11 +71,40 @@ workflow PREPARE_GENOME { ch_versions = ch_versions.mix(SAMTOOLS_FAIDX.out.versions) } } + // Aligner: biscuit + else if ( params.aligner == "biscuit" ){ + + /* + * Generate biscuit index if not supplied + */ + if (params.biscuit_index) { + biscuit_index = file(params.biscuit_index) + } else { + BISCUIT_INDEX(params.fasta) + biscuit_index = BISCUIT_INDEX.out.index + versions = versions.mix(BISCUIT_INDEX.out.versions) + } + } + // Aligner: biscuit + else if ( params.aligner == "biscuit" ){ + + /* + * Generate biscuit index if not supplied + */ + if (params.biscuit_index) { + biscuit_index = file(params.biscuit_index) + } else { + BISCUIT_INDEX(params.fasta) + biscuit_index = BISCUIT_INDEX.out.index + versions = versions.mix(BISCUIT_INDEX.out.versions) + } + } emit: fasta = ch_fasta // channel: path(genome.fasta) bismark_index = ch_bismark_index // channel: path(genome.fasta) bwameth_index = ch_bwameth_index // channel: path(genome.fasta) + biscuit_index = ch_biscuit_index // channel: path(genome.fasta) fasta_index = ch_fasta_index // channel: path(genome.fasta) versions = ch_versions.ifEmpty(null) // channel: [ versions.yml ] diff --git a/tests/bismark/main.nf.test b/tests/bismark/main.nf.test new file mode 100644 index 00000000..f1cbe50e --- /dev/null +++ b/tests/bismark/main.nf.test @@ -0,0 +1,111 @@ +import com.askimed.nf.test.util.FileUtil; + +nextflow_pipeline { + + name "bismark" + script "main.nf" + + test("Single End") { + when { + params { + aligner = "bismark" + save_reference = true + outdir = "$outputDir" + } + } + + then { + // Clean up anything from previous runs + FileUtil.deleteDirectory(new File(".nf-test/indexes/")); + new File(".nf-test/indexes/").mkdirs() + // Copy the ref genome to a stable location for next tests + FileUtil.copyDirectory( + new File("$outputDir/bismark/reference_genome/BismarkIndex/").getAbsolutePath(), + new File(".nf-test/indexes/BismarkIndex/").getAbsolutePath() + ) + + // Test results + assert workflow.success + assert snapshot(workflow.trace.tasks().size()).match() + // FIXME assert snapshot(workflow).match() + assert new File("$outputDir/multiqc/bismark/multiqc_report.html").exists() + + assert new File("$outputDir/bismark/methylation_calls/splitting_report/SRR389222_sub1_trimmed_bismark_bt2.deduplicated_splitting_report.txt").exists() + assert new File("$outputDir/bismark/methylation_calls/splitting_report/SRR389222_sub2_trimmed_bismark_bt2.deduplicated_splitting_report.txt").exists() + assert path("$outputDir/bismark/methylation_calls/splitting_report/SRR389222_sub2_trimmed_bismark_bt2.deduplicated_splitting_report.txt").md5 == "3038a90a6e513c3b1c0de540439eb101" + } + } + + test("Single End with index") { + when { + params { + aligner = "bismark" + // Generated by previous test + bismark_index = ".nf-test/indexes/BismarkIndex/" + merge_cg = true + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert snapshot(workflow.trace.tasks().size()).match() + // FIXME assert snapshot(workflow).match() + } + } + + test("Single End RRBS") { + when { + params { + aligner = "bismark" + skip_trimming = true + save_reference = true + rrbs = true + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert snapshot(workflow.trace.tasks().size()).match() + // FIXME assert snapshot(workflow).match() + } + } + + test("Single End RRBS with index") { + when { + params { + aligner = "bismark" + skip_trimming = true + rrbs = true + save_reference = true + // Generated by previous test + bismark_index = ".nf-test/indexes/BismarkIndex/" + merge_cg = true + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert snapshot(workflow.trace.tasks().size()).match() + // FIXME assert snapshot(workflow).match() + } + } + + test("Single End NOMe-seq") { + when { + params { + aligner = "bismark" + nomeseq = true + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert snapshot(workflow.trace.tasks().size()).match() + } + } + +} diff --git a/workflows/methylseq.nf b/workflows/methylseq.nf index a351316e..7fe03488 100644 --- a/workflows/methylseq.nf +++ b/workflows/methylseq.nf @@ -45,6 +45,10 @@ if( params.aligner =~ /bismark/ ){ else if ( params.aligner == 'bwameth' ){ include { BWAMETH } from '../subworkflows/local/bwameth' } +// Aligner: biscuit +else if ( params.aligner == "biscuit" ){ + include { BISCUIT } from '../subworkflows/local/biscuit' +} /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -143,8 +147,6 @@ workflow METHYLSEQ { reads = ch_cat_fastq } - - /* * SUBWORKFLOW: Align reads, deduplicate and extract methylation with Bismark */ @@ -159,7 +161,7 @@ workflow METHYLSEQ { reads, PREPARE_GENOME.out.bismark_index, params.skip_deduplication || params.rrbs, - params.cytosine_report || params.nomeseq + params.merge_cg || params.nomeseq ) ch_versions = ch_versions.mix(BISMARK.out.versions.unique{ it.baseName }) ch_bam = BISMARK.out.bam @@ -181,6 +183,20 @@ workflow METHYLSEQ { ch_dedup = BWAMETH.out.dedup ch_aligner_mqc = BWAMETH.out.mqc } + // Aligner: biscuit + else if ( params.aligner == "biscuit" ){ + + BISCUIT( + reads, + PREPARE_GENOME.out.biscuit_index, + params.skip_deduplication || params.rrbs, + params.merge_cg || params.nomeseq + ) + versions = versions.mix(BISCUIT.out.versions.unique{ it.baseName }) + ch_bam = BISCUIT.out.bam + ch_dedup = BISCUIT.out.dedup + ch_aligner_mqc = BISCUIT.out.mqc + } /* * MODULE: Qualimap BamQC @@ -221,7 +237,7 @@ workflow METHYLSEQ { ch_multiqc_files = ch_multiqc_files.mix(PRESEQ_LCEXTRAP.out.log.collect{ it[1] }.ifEmpty([])) ch_multiqc_files = ch_multiqc_files.mix(ch_aligner_mqc.ifEmpty([])) if (!params.skip_trimming) { - ch_multiqc_files = ch_multiqc_files.mix(TRIMGALORE.out.log.collect{ it[1] }) + ch_multiqc_files = ch_multiqc_files.mix(TRIMGALORE.out.zip.collect{ it[1] }) } ch_multiqc_files = ch_multiqc_files.mix(FASTQC.out.zip.collect{ it[1] }.ifEmpty([]))