diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c177600d..872deea8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,7 @@ jobs: - "ANNOTATE_SVS" - "RANK_VARIANTS" - "CALL_REPEAT_EXPANSIONS" + - "METHYLATION" profile: - "docker" diff --git a/CHANGELOG.md b/CHANGELOG.md index fa438f14..6bd88ef5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#445](https://github.com/genomic-medicine-sweden/nallo/pull/445) - Added FOUND_IN tag and nf-test to rank variants - [#446](https://github.com/genomic-medicine-sweden/nallo/pull/446) - Added the vcfstatsreport from DeepVariant to snv calling - [#450](https://github.com/genomic-medicine-sweden/nallo/pull/450) - Added ranking of SVs (and CNVs) +- [#451](https://github.com/genomic-medicine-sweden/nallo/pull/451) - Added support for running methylation subworkflow without phasing +- [#451](https://github.com/genomic-medicine-sweden/nallo/pull/451) - Added nf-test to methylation ### `Changed` @@ -75,6 +77,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#441](https://github.com/genomic-medicine-sweden/nallo/pull/441) - Changed the minimap2 preset for hifi reads back to `map-hifi` - [#443](https://github.com/genomic-medicine-sweden/nallo/pull/443) - Refactored reference channel assignments - [#443](https://github.com/genomic-medicine-sweden/nallo/pull/443) - Updated schemas for `vep_plugin_files` and `snp_db` +- [#451](https://github.com/genomic-medicine-sweden/nallo/pull/451) - Simplified methylation subworkflow - [#474](https://github.com/genomic-medicine-sweden/nallo/pull/474) - Updated VEP and CADD channels to fix bugs introduced in [#443](https://github.com/genomic-medicine-sweden/nallo/pull/443) - [#479](https://github.com/genomic-medicine-sweden/nallo/pull/479) - Replaced bgzip tabix with bcftools sort in rank variants to fix [#457](https://github.com/genomic-medicine-sweden/nallo/issues/457) - [#484](https://github.com/genomic-medicine-sweden/nallo/pull/484) - Updated metro map and added SVG version diff --git a/conf/modules/methylation.config b/conf/modules/methylation.config index b6c79cec..5f5e0390 100644 --- a/conf/modules/methylation.config +++ b/conf/modules/methylation.config @@ -24,51 +24,27 @@ process { ] } - withName: '.*:METHYLATION:MODKIT_PILEUP_UNPHASED' { + withName: '.*:METHYLATION:MODKIT_PILEUP' { ext.args = { [ "${params.extra_modkit_options}", '--combine-mods', '--cpg', '--combine-strands', + !params.skip_phasing_wf ? '--partition-tag HP' : '', ].join(' ') } ext.prefix = { "${meta.id}_modkit_pileup" } publishDir = [ - path: { "${params.outdir}/methylation/modkit/pileup/unphased/${meta.id}" }, + path: { "${params.outdir}/methylation/modkit/pileup/${meta.id}" }, mode: params.publish_dir_mode, saveAs: { filename -> filename.endsWith('.log') ? filename : null } ] } - withName: '.*:METHYLATION:MODKIT_PILEUP_PHASED' { - ext.args = { [ - "${params.extra_modkit_options}", - '--combine-mods', - '--cpg', - '--combine-strands', - '--partition-tag HP' - ].join(' ') } - ext.prefix = { "${meta.id}_modkit_pileup_phased" } - publishDir = [ - path: { "${params.outdir}/methylation/modkit/pileup/phased/${meta.id}" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.endsWith('.log') ? filename : null } - ] - - } - - withName: '.*:METHYLATION:BGZIP_MODKIT_PILEUP_UNPHASED' { - ext.prefix = { "${input.simpleName}" } - publishDir = [ - path: { "${params.outdir}/methylation/modkit/pileup/unphased/${meta.id}" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] - } - withName: '.*:METHYLATION:BGZIP_MODKIT_PILEUP_PHASED' { + withName: '.*:METHYLATION:TABIX_BGZIPTABIX' { ext.prefix = { "${input.simpleName}" } publishDir = [ - path: { "${params.outdir}/methylation/modkit/pileup/phased/${meta.id}" }, + path: { "${params.outdir}/methylation/modkit/pileup/${meta.id}" }, mode: params.publish_dir_mode, saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] diff --git a/docs/output.md b/docs/output.md index cd80bdb8..85de861f 100644 --- a/docs/output.md +++ b/docs/output.md @@ -36,14 +36,14 @@ If the pipeline is run with phasing, the aligned reads will be happlotagged usin ## Methylation pileups -[Modkit](https://github.com/nanoporetech/modkit) is used to create methylation pileups, producing bedMethyl files for both haplotagged and ungrouped reads. Additionaly, methylation information can be viewed in the BAM files, for example in IGV. - -| Path | Description | -| ----------------------------------------------------------------------------------- | --------------------------------------------------------- | -| `methylation/modkit/pileup/phased/{sample}/*.modkit_pileup_phased_*.bed.gz` | bedMethyl file with summary counts from haplotagged reads | -| `methylation/modkit/pileup/phased/{sample}/*.modkit_pileup_phased_ungrouped.bed.gz` | bedMethyl file for ungrouped reads | -| `methylation/modkit/pileup/unphased/{sample}/*.modkit_pileup.bed.gz` | bedMethyl file with summary counts from all reads | -| `methylation/modkit/pileup/unphased/{sample}/*.bed.gz.tbi` | Index of the corresponding bedMethyl file | +[Modkit](https://github.com/nanoporetech/modkit) is used to create methylation pileups, producing bedMethyl files for both haplotagged and ungrouped reads. Additionally, methylation information can be viewed in the BAM files, for example in IGV. + +| Path | Description | +| ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `methylation/modkit/pileup/{sample}/*.modkit_pileup_phased_*.bed.gz` | bedMethyl file with summary counts from haplotagged reads (if phasing is turned on) | +| `methylation/modkit/pileup/{sample}/*.modkit_pileup_phased_ungrouped.bed.gz` | bedMethyl file for ungrouped reads (if phasing is turned on) | +| `methylation/modkit/pileup/{sample}/*.modkit_pileup.bed.gz` | bedMethyl file with summary counts from all reads (if phasing is turned off) | +| `methylation/modkit/pileup/{sample}/*.bed.gz.tbi` | Index of the corresponding bedMethyl file | ## MultiQC diff --git a/docs/usage.md b/docs/usage.md index 870f3344..1252c08c 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -200,7 +200,7 @@ Turned off with `--skip_phasing_wf`. ### Methylation -This subworkflow relies on mapping, short variant calling and phasing subworkflows, but requires no additional files. +This subworkflow relies on mapping and short variant calling subworkflows, but requires no additional files. Turned off with `--skip_methylation_wf`. diff --git a/modules/local/whatshap/stats/main.nf b/modules/local/whatshap/stats/main.nf index 7e2bb2be..c2074328 100644 --- a/modules/local/whatshap/stats/main.nf +++ b/modules/local/whatshap/stats/main.nf @@ -38,7 +38,7 @@ process WHATSHAP_STATS { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.stats.tsv.gz + touch ${prefix}.stats.tsv touch ${prefix}.blocks.tsv cat <<-END_VERSIONS > versions.yml diff --git a/subworkflows/local/methylation.nf b/subworkflows/local/methylation.nf deleted file mode 100644 index 6541a9f4..00000000 --- a/subworkflows/local/methylation.nf +++ /dev/null @@ -1,38 +0,0 @@ -include { MODKIT_PILEUP as MODKIT_PILEUP_UNPHASED } from '../../modules/nf-core/modkit/pileup/main' -include { MODKIT_PILEUP as MODKIT_PILEUP_PHASED } from '../../modules/nf-core/modkit/pileup/main' -include { TABIX_BGZIPTABIX as BGZIP_MODKIT_PILEUP_UNPHASED } from '../../modules/nf-core/tabix/bgziptabix/main' -include { TABIX_BGZIPTABIX as BGZIP_MODKIT_PILEUP_PHASED } from '../../modules/nf-core/tabix/bgziptabix/main' - -workflow METHYLATION { - - take: - ch_haplotagged_bam_bai // channel: [ val(meta), bam, bai ] - ch_fasta // channel: [ val(meta), fasta ] - ch_fai // channel: [ val(meta), fai ] - ch_bed // channel: [ val(meta), bed ] - - main: - ch_versions = Channel.empty() - - // Run modkit pileup once without dividing by HP-tag and once with - MODKIT_PILEUP_UNPHASED (ch_haplotagged_bam_bai, ch_fasta, ch_bed) - ch_versions = ch_versions.mix(MODKIT_PILEUP_UNPHASED.out.versions) - - MODKIT_PILEUP_PHASED (ch_haplotagged_bam_bai, ch_fasta, ch_bed) - ch_versions = ch_versions.mix(MODKIT_PILEUP_PHASED.out.versions) - - // Bgzip and index output "BED" - BGZIP_MODKIT_PILEUP_UNPHASED ( MODKIT_PILEUP_UNPHASED.out.bed ) - ch_versions = ch_versions.mix(BGZIP_MODKIT_PILEUP_UNPHASED.out.versions) - - MODKIT_PILEUP_PHASED.out.bed - .transpose() - .set { ch_bgzip_modkit_pileup_phased_in } - - BGZIP_MODKIT_PILEUP_PHASED ( ch_bgzip_modkit_pileup_phased_in ) - ch_versions = ch_versions.mix(BGZIP_MODKIT_PILEUP_PHASED.out.versions) - - emit: - versions = ch_versions // channel: [ versions.yml ] -} - diff --git a/subworkflows/local/methylation/main.nf b/subworkflows/local/methylation/main.nf new file mode 100644 index 00000000..261af3f1 --- /dev/null +++ b/subworkflows/local/methylation/main.nf @@ -0,0 +1,32 @@ +include { MODKIT_PILEUP } from '../../../modules/nf-core/modkit/pileup/main' +include { TABIX_BGZIPTABIX } from '../../../modules/nf-core/tabix/bgziptabix/main' + +workflow METHYLATION { + + take: + ch_bam_bai // channel: [ val(meta), bam, bai ] + ch_fasta // channel: [ val(meta), fasta ] + ch_fai // channel: [ val(meta), fai ] + ch_bed // channel: [ val(meta), bed ] + + main: + ch_versions = Channel.empty() + + // Performs pileups per haplotype if the phasing workflow is on, set in config + MODKIT_PILEUP (ch_bam_bai, ch_fasta, ch_bed) + ch_versions = ch_versions.mix(MODKIT_PILEUP.out.versions) + + + MODKIT_PILEUP.out.bed + .transpose() + .set { ch_bgzip_modkit_pileup_in } + + TABIX_BGZIPTABIX ( ch_bgzip_modkit_pileup_in ) + ch_versions = ch_versions.mix(TABIX_BGZIPTABIX.out.versions) + + emit: + bed = TABIX_BGZIPTABIX.out.gz_tbi.map { meta, bed, tbi -> [ meta, bed ] } // channel: [ val(meta), path(bed) ] + tbi = TABIX_BGZIPTABIX.out.gz_tbi.map { meta, bed, tbi -> [ meta, tbi ] } // channel: [ val(meta), path(tbi) ] + versions = ch_versions // channel: [ versions.yml ] +} + diff --git a/subworkflows/local/methylation/tests/main.nf.test b/subworkflows/local/methylation/tests/main.nf.test new file mode 100644 index 00000000..7d5e6933 --- /dev/null +++ b/subworkflows/local/methylation/tests/main.nf.test @@ -0,0 +1,261 @@ +nextflow_workflow { + + name "Test Workflow METHYLATION" + script "../main.nf" + config "./nextflow.config" + workflow "METHYLATION" + + setup { + run("PREPARE_GENOME") { + script "../../prepare_genome.nf" + process { + """ + input[0] = Channel.of([ + [ id:'hg38' ], + file(params.pipelines_testdata_base_path + 'reference/hg38.test.fa.gz', checkIfExists: true) + ]) + input[1] = true + input[2] = Channel.empty() + input[3] = false + """ + } + } + run("MINIMAP2_ALIGN") { + script "../../../../modules/nf-core/minimap2/align/main.nf" + process { + """ + input[0] = [ + [ id: 'test', num_intervals:1 ], + file(params.pipelines_testdata_base_path + 'testdata/HG002_PacBio_Revio.fastq.gz', checkIfExists: true) + ] + input[1] = PREPARE_GENOME.out.fasta + input[2] = true + input[3] = 'csi' + input[4] = false + input[5] = false + """ + } + } + run("SHORT_VARIANT_CALLING") { + script "../../short_variant_calling/main.nf" + process { + """ + input[0] = MINIMAP2_ALIGN.out.bam + .join(MINIMAP2_ALIGN.out.index) + .join(Channel.of([ + [ id: 'test', num_intervals:1 ], + file(params.pipelines_testdata_base_path + 'reference/test_data.bed', checkIfExists: true) + ])) + input[1] = PREPARE_GENOME.out.fasta + input[2] = PREPARE_GENOME.out.fai + input[3] = [[],[]] + input[4] = [[],[]] + """ + } + } + run("PHASING") { + script "../../phasing.nf" + process { + """ + input[0] = SHORT_VARIANT_CALLING.out.snp_calls_vcf + input[1] = SHORT_VARIANT_CALLING.out.snp_calls_tbi + input[2] = MINIMAP2_ALIGN.out.bam + .join(MINIMAP2_ALIGN.out.index) + .map { meta, bam, bai -> + [ [ id : meta.id ], bam, bai ] + } + input[3] = PREPARE_GENOME.out.fasta + input[4] = PREPARE_GENOME.out.fai + """ + } + } + } + + test("1 sample - [] phased") { + when { + params { + skip_phasing_wf = false + } + workflow { + """ + input[0] = PHASING.out.haplotagged_bam_bai + input[1] = PREPARE_GENOME.out.fasta + input[2] = PREPARE_GENOME.out.fai + input[3] = [[],[]] + """ + } + } + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("1 sample - [] unphased") { + when { + params { + skip_phasing_wf = true + } + workflow { + """ + input[0] = MINIMAP2_ALIGN.out.bam.join(MINIMAP2_ALIGN.out.index) + input[1] = PREPARE_GENOME.out.fasta + input[2] = PREPARE_GENOME.out.fai + input[3] = [[],[]] + """ + } + } + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("1 sample - bed phased") { + when { + params { + skip_phasing_wf = false + } + workflow { + """ + input[0] = PHASING.out.haplotagged_bam_bai + input[1] = PREPARE_GENOME.out.fasta + input[2] = PREPARE_GENOME.out.fai + input[3] = Channel.of('chr20\t2650000\t2660000') + .collectFile(name: 'chr20.bed', newLine: true) + .map{ file -> [ [ id:'chr20'], file ] } + """ + } + } + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("1 sample - bed unphased") { + when { + params { + skip_phasing_wf = true + } + workflow { + """ + input[0] = MINIMAP2_ALIGN.out.bam.join(MINIMAP2_ALIGN.out.index) + input[1] = PREPARE_GENOME.out.fasta + input[2] = PREPARE_GENOME.out.fai + input[3] = Channel.of('chr20\t2650000\t2660000') + .collectFile(name: 'chr20.bed', newLine: true) + .map{ file -> [ [ id:'chr20'], file ] } + """ + } + } + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("1 sample - [] phased - stub") { + options "-stub" + when { + params { + skip_phasing_wf = false + } + workflow { + """ + input[0] = PHASING.out.haplotagged_bam_bai + input[1] = PREPARE_GENOME.out.fasta + input[2] = PREPARE_GENOME.out.fai + input[3] = [[],[]] + """ + } + } + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("1 sample - bed phased - stub") { + options "-stub" + when { + params { + skip_phasing_wf = false + } + workflow { + """ + input[0] = PHASING.out.haplotagged_bam_bai + input[1] = PREPARE_GENOME.out.fasta + input[2] = PREPARE_GENOME.out.fai + input[3] = Channel.of('chr20\t2650000\t2660000') + .collectFile(name: 'chr20.bed', newLine: true) + .map{ file -> [ [ id:'chr20'], file ] } + """ + } + } + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("1 sample - [] unphased - stub") { + options "-stub" + when { + params { + skip_phasing_wf = true + } + workflow { + """ + input[0] = MINIMAP2_ALIGN.out.bam.join(MINIMAP2_ALIGN.out.index) + input[1] = PREPARE_GENOME.out.fasta + input[2] = PREPARE_GENOME.out.fai + input[3] = [[],[]] + """ + } + } + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("1 sample - bed unphased - stub") { + options "-stub" + when { + params { + skip_phasing_wf = true + } + workflow { + """ + input[0] = MINIMAP2_ALIGN.out.bam.join(MINIMAP2_ALIGN.out.index) + input[1] = PREPARE_GENOME.out.fasta + input[2] = PREPARE_GENOME.out.fai + input[3] = Channel.of('chr20\t2650000\t2660000') + .collectFile(name: 'chr20.bed', newLine: true) + .map{ file -> [ [ id:'chr20'], file ] } + """ + } + } + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } +} diff --git a/subworkflows/local/methylation/tests/main.nf.test.snap b/subworkflows/local/methylation/tests/main.nf.test.snap new file mode 100644 index 00000000..a96efcdf --- /dev/null +++ b/subworkflows/local/methylation/tests/main.nf.test.snap @@ -0,0 +1,504 @@ +{ + "1 sample - [] phased": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_modkit_pileup_1.bed.gz:md5,b980e56ca6d65d09892b069a7d51b827" + ], + [ + { + "id": "test" + }, + "test_modkit_pileup_2.bed.gz:md5,32a5e2148266fefba8159d98f5f5dd87" + ], + [ + { + "id": "test" + }, + "test_modkit_pileup_ungrouped.bed.gz:md5,bfeda9731d6d52508301ddf939302676" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test_modkit_pileup_1.bed.gz.tbi:md5,45800db86a2845fe961f536484369f61" + ], + [ + { + "id": "test" + }, + "test_modkit_pileup_2.bed.gz.tbi:md5,14f729ebf5ce7d265df85b21c30a67af" + ], + [ + { + "id": "test" + }, + "test_modkit_pileup_ungrouped.bed.gz.tbi:md5,d08da21ae562fcc3c3361a916439c552" + ] + ], + "2": [ + "versions.yml:md5,69dd5e76cc5e61cd0324b7412fc0546b", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711" + ], + "bed": [ + [ + { + "id": "test" + }, + "test_modkit_pileup_1.bed.gz:md5,b980e56ca6d65d09892b069a7d51b827" + ], + [ + { + "id": "test" + }, + "test_modkit_pileup_2.bed.gz:md5,32a5e2148266fefba8159d98f5f5dd87" + ], + [ + { + "id": "test" + }, + "test_modkit_pileup_ungrouped.bed.gz:md5,bfeda9731d6d52508301ddf939302676" + ] + ], + "tbi": [ + [ + { + "id": "test" + }, + "test_modkit_pileup_1.bed.gz.tbi:md5,45800db86a2845fe961f536484369f61" + ], + [ + { + "id": "test" + }, + "test_modkit_pileup_2.bed.gz.tbi:md5,14f729ebf5ce7d265df85b21c30a67af" + ], + [ + { + "id": "test" + }, + "test_modkit_pileup_ungrouped.bed.gz.tbi:md5,d08da21ae562fcc3c3361a916439c552" + ] + ], + "versions": [ + "versions.yml:md5,69dd5e76cc5e61cd0324b7412fc0546b", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-11-01T16:42:19.164909715" + }, + "1 sample - bed unphased - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "num_intervals": 1 + }, + "test_modkit_pileup.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "num_intervals": 1 + }, + "test_modkit_pileup.bed.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,69dd5e76cc5e61cd0324b7412fc0546b", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711" + ], + "bed": [ + [ + { + "id": "test", + "num_intervals": 1 + }, + "test_modkit_pileup.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "tbi": [ + [ + { + "id": "test", + "num_intervals": 1 + }, + "test_modkit_pileup.bed.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,69dd5e76cc5e61cd0324b7412fc0546b", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-31T15:06:21.337874852" + }, + "1 sample - [] unphased - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "num_intervals": 1 + }, + "test_modkit_pileup.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "num_intervals": 1 + }, + "test_modkit_pileup.bed.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,69dd5e76cc5e61cd0324b7412fc0546b", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711" + ], + "bed": [ + [ + { + "id": "test", + "num_intervals": 1 + }, + "test_modkit_pileup.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "tbi": [ + [ + { + "id": "test", + "num_intervals": 1 + }, + "test_modkit_pileup.bed.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,69dd5e76cc5e61cd0324b7412fc0546b", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-31T15:05:51.048367417" + }, + "1 sample - [] phased - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_modkit_pileup.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test_modkit_pileup.bed.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,69dd5e76cc5e61cd0324b7412fc0546b", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711" + ], + "bed": [ + [ + { + "id": "test" + }, + "test_modkit_pileup.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "tbi": [ + [ + { + "id": "test" + }, + "test_modkit_pileup.bed.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,69dd5e76cc5e61cd0324b7412fc0546b", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-31T15:32:25.389277494" + }, + "1 sample - [] unphased": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "num_intervals": 1 + }, + "test_modkit_pileup.bed.gz:md5,d3252e8b77241fe25edbcfd520b86159" + ] + ], + "1": [ + [ + { + "id": "test", + "num_intervals": 1 + }, + "test_modkit_pileup.bed.gz.tbi:md5,d34b6e7ed5a3010fba35ea9b58672dfd" + ] + ], + "2": [ + "versions.yml:md5,69dd5e76cc5e61cd0324b7412fc0546b", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711" + ], + "bed": [ + [ + { + "id": "test", + "num_intervals": 1 + }, + "test_modkit_pileup.bed.gz:md5,d3252e8b77241fe25edbcfd520b86159" + ] + ], + "tbi": [ + [ + { + "id": "test", + "num_intervals": 1 + }, + "test_modkit_pileup.bed.gz.tbi:md5,d34b6e7ed5a3010fba35ea9b58672dfd" + ] + ], + "versions": [ + "versions.yml:md5,69dd5e76cc5e61cd0324b7412fc0546b", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-11-01T16:43:20.61904287" + }, + "1 sample - bed phased": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_modkit_pileup_1.bed.gz:md5,a0d9e7dd172fcbd0bbb19690b3570a3d" + ], + [ + { + "id": "test" + }, + "test_modkit_pileup_ungrouped.bed.gz:md5,59353caa892772acc71cbdef07cca17d" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test_modkit_pileup_1.bed.gz.tbi:md5,1b46636405409529be7df321af87acd2" + ], + [ + { + "id": "test" + }, + "test_modkit_pileup_ungrouped.bed.gz.tbi:md5,600db7bbfb1580cc2af629324e206045" + ] + ], + "2": [ + "versions.yml:md5,69dd5e76cc5e61cd0324b7412fc0546b", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711" + ], + "bed": [ + [ + { + "id": "test" + }, + "test_modkit_pileup_1.bed.gz:md5,a0d9e7dd172fcbd0bbb19690b3570a3d" + ], + [ + { + "id": "test" + }, + "test_modkit_pileup_ungrouped.bed.gz:md5,59353caa892772acc71cbdef07cca17d" + ] + ], + "tbi": [ + [ + { + "id": "test" + }, + "test_modkit_pileup_1.bed.gz.tbi:md5,1b46636405409529be7df321af87acd2" + ], + [ + { + "id": "test" + }, + "test_modkit_pileup_ungrouped.bed.gz.tbi:md5,600db7bbfb1580cc2af629324e206045" + ] + ], + "versions": [ + "versions.yml:md5,69dd5e76cc5e61cd0324b7412fc0546b", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-11-01T16:44:23.18659219" + }, + "1 sample - bed phased - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_modkit_pileup.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test_modkit_pileup.bed.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,69dd5e76cc5e61cd0324b7412fc0546b", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711" + ], + "bed": [ + [ + { + "id": "test" + }, + "test_modkit_pileup.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "tbi": [ + [ + { + "id": "test" + }, + "test_modkit_pileup.bed.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,69dd5e76cc5e61cd0324b7412fc0546b", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-31T15:32:58.055229101" + }, + "1 sample - bed unphased": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "num_intervals": 1 + }, + "test_modkit_pileup.bed.gz:md5,1bd6be90eb9c11b4cc9fa43dea4160ac" + ] + ], + "1": [ + [ + { + "id": "test", + "num_intervals": 1 + }, + "test_modkit_pileup.bed.gz.tbi:md5,1983a3dfe9722ff9213cddcf6772d461" + ] + ], + "2": [ + "versions.yml:md5,69dd5e76cc5e61cd0324b7412fc0546b", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711" + ], + "bed": [ + [ + { + "id": "test", + "num_intervals": 1 + }, + "test_modkit_pileup.bed.gz:md5,1bd6be90eb9c11b4cc9fa43dea4160ac" + ] + ], + "tbi": [ + [ + { + "id": "test", + "num_intervals": 1 + }, + "test_modkit_pileup.bed.gz.tbi:md5,1983a3dfe9722ff9213cddcf6772d461" + ] + ], + "versions": [ + "versions.yml:md5,69dd5e76cc5e61cd0324b7412fc0546b", + "versions.yml:md5,dc8e3f1d4b20b910f5148d89337e5711" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-11-01T16:45:25.026984417" + } +} \ No newline at end of file diff --git a/subworkflows/local/methylation/tests/nextflow.config b/subworkflows/local/methylation/tests/nextflow.config new file mode 100644 index 00000000..45b920fe --- /dev/null +++ b/subworkflows/local/methylation/tests/nextflow.config @@ -0,0 +1,75 @@ +params { + preset = "pacbio" + phaser = "longphase" +} + +process { + + withName: 'SHORT_VARIANT_CALLING:DEEPVARIANT' { + ext.args = { [ + '--model_type PACBIO', + "--sample_name=${meta.id}", + '-vcf_stats_report=False' + ].join(' ') } + } + + withName: 'SHORT_VARIANT_CALLING:BCFTOOLS_CONCAT' { + ext.prefix = { "${meta.id}_concat" } + ext.args = [ + '--no-version', + '--allow-overlaps' + ].join(' ') + } + + withName: 'SHORT_VARIANT_CALLING:BCFTOOLS_NORM_SINGLESAMPLE' { + ext.prefix = { "${meta.id}_norm_singlesample" } + ext.args = [ + '--no-version', + '-m -', + '-w 10000', + '--output-type z', + '--write-index=tbi', + ].join(' ') + } + + withName: 'SHORT_VARIANT_CALLING:BCFTOOLS_FILLTAGS' { + ext.prefix = { "${meta.id}_ac" } + ext.args = [ + '--no-version', + '--output-type u' + ].join(' ') + } + + withName: 'MINIMAP2_ALIGN' { + ext.args = [ + '-x map-hifi', + '-y' + ].join(' ') + } + + withName: 'METHYLATION:MODKIT_PILEUP' { + ext.args = { [ + '--combine-mods', + '--cpg', + '--combine-strands', + !params.skip_phasing_wf ? '--partition-tag HP' : '', + ].join(' ') } + ext.prefix = { "${meta.id}_modkit_pileup" } + } + + withName: 'METHYLATION:TABIX_BGZIPTABIX' { + ext.prefix = { "${input.simpleName}" } + } + withName: 'PHASING:LONGPHASE_PHASE' { + ext.prefix = { "${meta.id}_phased" } + ext.args = [ + '--pb', + '--indels' + ].join(' ') + } + + withName: 'PHASING:LONGPHASE_HAPLOTAG' { + ext.prefix = { "${meta.id}_haplotagged" } + } + +} diff --git a/subworkflows/local/utils_nfcore_nallo_pipeline/main.nf b/subworkflows/local/utils_nfcore_nallo_pipeline/main.nf index 1a04cf76..db858cdb 100644 --- a/subworkflows/local/utils_nfcore_nallo_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_nallo_pipeline/main.nf @@ -62,7 +62,7 @@ def workflowDependencies = [ rank_variants : ["mapping", "snv_calling", "snv_annotation"], repeat_calling : ["mapping", "snv_calling", "phasing"], repeat_annotation: ["mapping", "snv_calling", "phasing", "repeat_calling"], - methylation : ["mapping", "snv_calling", "phasing"], + methylation : ["mapping", "snv_calling"] ] // diff --git a/tests/samplesheet.nf.test.snap b/tests/samplesheet.nf.test.snap index e5199e7a..3fbdad9a 100644 --- a/tests/samplesheet.nf.test.snap +++ b/tests/samplesheet.nf.test.snap @@ -1,7 +1,7 @@ { "test profile": { "content": [ - 113, + 111, { "ADD_FOUND_IN_TAG": { "bcftools": 1.2, @@ -57,12 +57,6 @@ "BEDTOOLS_SORT": { "bedtools": "2.31.1" }, - "BGZIP_MODKIT_PILEUP_PHASED": { - "tabix": 1.2 - }, - "BGZIP_MODKIT_PILEUP_UNPHASED": { - "tabix": 1.2 - }, "COMPRESS_STRANGER": { "bcftools": 1.2 }, @@ -142,10 +136,7 @@ "MINIMAP2_INDEX_DIPCALL": { "minimap2": "2.28-r1209" }, - "MODKIT_PILEUP_PHASED": { - "modkit": "0.3.0" - }, - "MODKIT_PILEUP_UNPHASED": { + "MODKIT_PILEUP": { "modkit": "0.3.0" }, "MOSDEPTH": { @@ -277,18 +268,13 @@ "methylation", "methylation/modkit", "methylation/modkit/pileup", - "methylation/modkit/pileup/phased", - "methylation/modkit/pileup/phased/HG002_Revio", - "methylation/modkit/pileup/phased/HG002_Revio/HG002_Revio_modkit_pileup_phased_1.bed.gz", - "methylation/modkit/pileup/phased/HG002_Revio/HG002_Revio_modkit_pileup_phased_1.bed.gz.tbi", - "methylation/modkit/pileup/phased/HG002_Revio/HG002_Revio_modkit_pileup_phased_2.bed.gz", - "methylation/modkit/pileup/phased/HG002_Revio/HG002_Revio_modkit_pileup_phased_2.bed.gz.tbi", - "methylation/modkit/pileup/phased/HG002_Revio/HG002_Revio_modkit_pileup_phased_ungrouped.bed.gz", - "methylation/modkit/pileup/phased/HG002_Revio/HG002_Revio_modkit_pileup_phased_ungrouped.bed.gz.tbi", - "methylation/modkit/pileup/unphased", - "methylation/modkit/pileup/unphased/HG002_Revio", - "methylation/modkit/pileup/unphased/HG002_Revio/HG002_Revio_modkit_pileup.bed.gz", - "methylation/modkit/pileup/unphased/HG002_Revio/HG002_Revio_modkit_pileup.bed.gz.tbi", + "methylation/modkit/pileup/HG002_Revio", + "methylation/modkit/pileup/HG002_Revio/HG002_Revio_modkit_pileup_1.bed.gz", + "methylation/modkit/pileup/HG002_Revio/HG002_Revio_modkit_pileup_1.bed.gz.tbi", + "methylation/modkit/pileup/HG002_Revio/HG002_Revio_modkit_pileup_2.bed.gz", + "methylation/modkit/pileup/HG002_Revio/HG002_Revio_modkit_pileup_2.bed.gz.tbi", + "methylation/modkit/pileup/HG002_Revio/HG002_Revio_modkit_pileup_ungrouped.bed.gz", + "methylation/modkit/pileup/HG002_Revio/HG002_Revio_modkit_pileup_ungrouped.bed.gz.tbi", "multiqc", "multiqc/multiqc_data", "multiqc/multiqc_data/mosdepth_cov_dist.txt", @@ -423,14 +409,12 @@ "HG002_Revio.hap2.var.gz:md5,9ba9303b30730e419138e177c7d1e0c2", "HG002_Revio.pair.vcf.gz:md5,1909dffa43850282fe7e5ae2b2d273a7", "test.zip:md5,a0abe28a72b11b68126040dd38fa8e37", - "HG002_Revio_modkit_pileup_phased_1.bed.gz:md5,ac9bfc455d0b697a4bd565b510c155e0", - "HG002_Revio_modkit_pileup_phased_1.bed.gz.tbi:md5,5a9ac375a0ce33af002e0073635a3425", - "HG002_Revio_modkit_pileup_phased_2.bed.gz:md5,b2c6c3fc27d34b7c588a4a4b3e9611b0", - "HG002_Revio_modkit_pileup_phased_2.bed.gz.tbi:md5,2ad55c2f604cbdf6a784b2dd99b25cb1", - "HG002_Revio_modkit_pileup_phased_ungrouped.bed.gz:md5,04ee840c02e04238b9432bc374a1afe1", - "HG002_Revio_modkit_pileup_phased_ungrouped.bed.gz.tbi:md5,e1418c8075da8831a52e0cd56ceb910e", - "HG002_Revio_modkit_pileup.bed.gz:md5,a52bb9ab393e682d0b7118ef2efe5c15", - "HG002_Revio_modkit_pileup.bed.gz.tbi:md5,08312c13316ed9b4b582897c210ecb58", + "HG002_Revio_modkit_pileup_1.bed.gz:md5,ac9bfc455d0b697a4bd565b510c155e0", + "HG002_Revio_modkit_pileup_1.bed.gz.tbi:md5,5a9ac375a0ce33af002e0073635a3425", + "HG002_Revio_modkit_pileup_2.bed.gz:md5,b2c6c3fc27d34b7c588a4a4b3e9611b0", + "HG002_Revio_modkit_pileup_2.bed.gz.tbi:md5,2ad55c2f604cbdf6a784b2dd99b25cb1", + "HG002_Revio_modkit_pileup_ungrouped.bed.gz:md5,04ee840c02e04238b9432bc374a1afe1", + "HG002_Revio_modkit_pileup_ungrouped.bed.gz.tbi:md5,e1418c8075da8831a52e0cd56ceb910e", "mosdepth_cov_dist.txt:md5,62011d1135dafcf05d7f6d5750d20c9f", "mosdepth_cumcov_dist.txt:md5,eeb7f82eb03344d26a99b6596a1c7413", "mosdepth_perchrom.txt:md5,53806d793d5627e60648daebb6606723", @@ -552,6 +536,6 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-30T17:17:40.017945721" + "timestamp": "2024-10-31T16:12:33.482377002" } } \ No newline at end of file diff --git a/tests/samplesheet_multisample_bam.nf.test.snap b/tests/samplesheet_multisample_bam.nf.test.snap index aa71fd46..cb232f89 100644 --- a/tests/samplesheet_multisample_bam.nf.test.snap +++ b/tests/samplesheet_multisample_bam.nf.test.snap @@ -1,7 +1,7 @@ { "samplesheet_multisample_bam | --phaser hiphase": { "content": [ - 160, + 156, { "ADD_FOUND_IN_TAG": { "bcftools": 1.2, @@ -57,12 +57,6 @@ "BEDTOOLS_SORT": { "bedtools": "2.31.1" }, - "BGZIP_MODKIT_PILEUP_PHASED": { - "tabix": 1.2 - }, - "BGZIP_MODKIT_PILEUP_UNPHASED": { - "tabix": 1.2 - }, "COMPRESS_STRANGER": { "bcftools": 1.2 }, @@ -139,10 +133,7 @@ "MINIMAP2_INDEX_DIPCALL": { "minimap2": "2.28-r1209" }, - "MODKIT_PILEUP_PHASED": { - "modkit": "0.3.0" - }, - "MODKIT_PILEUP_UNPHASED": { + "MODKIT_PILEUP": { "modkit": "0.3.0" }, "MOSDEPTH": { @@ -295,28 +286,20 @@ "methylation", "methylation/modkit", "methylation/modkit/pileup", - "methylation/modkit/pileup/phased", - "methylation/modkit/pileup/phased/HG002_Revio_A", - "methylation/modkit/pileup/phased/HG002_Revio_A/HG002_Revio_A_modkit_pileup_phased_1.bed.gz", - "methylation/modkit/pileup/phased/HG002_Revio_A/HG002_Revio_A_modkit_pileup_phased_1.bed.gz.tbi", - "methylation/modkit/pileup/phased/HG002_Revio_A/HG002_Revio_A_modkit_pileup_phased_2.bed.gz", - "methylation/modkit/pileup/phased/HG002_Revio_A/HG002_Revio_A_modkit_pileup_phased_2.bed.gz.tbi", - "methylation/modkit/pileup/phased/HG002_Revio_A/HG002_Revio_A_modkit_pileup_phased_ungrouped.bed.gz", - "methylation/modkit/pileup/phased/HG002_Revio_A/HG002_Revio_A_modkit_pileup_phased_ungrouped.bed.gz.tbi", - "methylation/modkit/pileup/phased/HG002_Revio_B", - "methylation/modkit/pileup/phased/HG002_Revio_B/HG002_Revio_B_modkit_pileup_phased_1.bed.gz", - "methylation/modkit/pileup/phased/HG002_Revio_B/HG002_Revio_B_modkit_pileup_phased_1.bed.gz.tbi", - "methylation/modkit/pileup/phased/HG002_Revio_B/HG002_Revio_B_modkit_pileup_phased_2.bed.gz", - "methylation/modkit/pileup/phased/HG002_Revio_B/HG002_Revio_B_modkit_pileup_phased_2.bed.gz.tbi", - "methylation/modkit/pileup/phased/HG002_Revio_B/HG002_Revio_B_modkit_pileup_phased_ungrouped.bed.gz", - "methylation/modkit/pileup/phased/HG002_Revio_B/HG002_Revio_B_modkit_pileup_phased_ungrouped.bed.gz.tbi", - "methylation/modkit/pileup/unphased", - "methylation/modkit/pileup/unphased/HG002_Revio_A", - "methylation/modkit/pileup/unphased/HG002_Revio_A/HG002_Revio_A_modkit_pileup.bed.gz", - "methylation/modkit/pileup/unphased/HG002_Revio_A/HG002_Revio_A_modkit_pileup.bed.gz.tbi", - "methylation/modkit/pileup/unphased/HG002_Revio_B", - "methylation/modkit/pileup/unphased/HG002_Revio_B/HG002_Revio_B_modkit_pileup.bed.gz", - "methylation/modkit/pileup/unphased/HG002_Revio_B/HG002_Revio_B_modkit_pileup.bed.gz.tbi", + "methylation/modkit/pileup/HG002_Revio_A", + "methylation/modkit/pileup/HG002_Revio_A/HG002_Revio_A_modkit_pileup_1.bed.gz", + "methylation/modkit/pileup/HG002_Revio_A/HG002_Revio_A_modkit_pileup_1.bed.gz.tbi", + "methylation/modkit/pileup/HG002_Revio_A/HG002_Revio_A_modkit_pileup_2.bed.gz", + "methylation/modkit/pileup/HG002_Revio_A/HG002_Revio_A_modkit_pileup_2.bed.gz.tbi", + "methylation/modkit/pileup/HG002_Revio_A/HG002_Revio_A_modkit_pileup_ungrouped.bed.gz", + "methylation/modkit/pileup/HG002_Revio_A/HG002_Revio_A_modkit_pileup_ungrouped.bed.gz.tbi", + "methylation/modkit/pileup/HG002_Revio_B", + "methylation/modkit/pileup/HG002_Revio_B/HG002_Revio_B_modkit_pileup_1.bed.gz", + "methylation/modkit/pileup/HG002_Revio_B/HG002_Revio_B_modkit_pileup_1.bed.gz.tbi", + "methylation/modkit/pileup/HG002_Revio_B/HG002_Revio_B_modkit_pileup_2.bed.gz", + "methylation/modkit/pileup/HG002_Revio_B/HG002_Revio_B_modkit_pileup_2.bed.gz.tbi", + "methylation/modkit/pileup/HG002_Revio_B/HG002_Revio_B_modkit_pileup_ungrouped.bed.gz", + "methylation/modkit/pileup/HG002_Revio_B/HG002_Revio_B_modkit_pileup_ungrouped.bed.gz.tbi", "multiqc", "multiqc/multiqc_data", "multiqc/multiqc_data/mosdepth_cov_dist.txt", @@ -527,22 +510,18 @@ "HG002_Revio_B.hap2.var.gz:md5,f09b01fcb43bf64f92ca7ec8a2380c25", "HG002_Revio_B.pair.vcf.gz:md5,676492865a9d4765835638d52651af73", "test.zip:md5,d3fc0769a4c707953cdb3fade9450660", - "HG002_Revio_A_modkit_pileup_phased_1.bed.gz:md5,7af3b6246d0c007aec686714b96a0f7f", - "HG002_Revio_A_modkit_pileup_phased_1.bed.gz.tbi:md5,b7083ebf6ba176ed5a472ad653c5be27", - "HG002_Revio_A_modkit_pileup_phased_2.bed.gz:md5,a2e1291b468361412899cf811022fe72", - "HG002_Revio_A_modkit_pileup_phased_2.bed.gz.tbi:md5,d1c192d65d8fa8cbb8ffa2e545282fde", - "HG002_Revio_A_modkit_pileup_phased_ungrouped.bed.gz:md5,9a077eb24b17d6511e849c5b533cda64", - "HG002_Revio_A_modkit_pileup_phased_ungrouped.bed.gz.tbi:md5,f569a923cc5204df5dc495354ab83a13", - "HG002_Revio_B_modkit_pileup_phased_1.bed.gz:md5,d8c15e30192ce878d17dffcc0981658a", - "HG002_Revio_B_modkit_pileup_phased_1.bed.gz.tbi:md5,2d400d38de3f45871bffac0ca0d3d7d3", - "HG002_Revio_B_modkit_pileup_phased_2.bed.gz:md5,a2e1291b468361412899cf811022fe72", - "HG002_Revio_B_modkit_pileup_phased_2.bed.gz.tbi:md5,d1c192d65d8fa8cbb8ffa2e545282fde", - "HG002_Revio_B_modkit_pileup_phased_ungrouped.bed.gz:md5,49d9380eb739081b7a0b4dfa7756d09c", - "HG002_Revio_B_modkit_pileup_phased_ungrouped.bed.gz.tbi:md5,f569a923cc5204df5dc495354ab83a13", - "HG002_Revio_A_modkit_pileup.bed.gz:md5,a52bb9ab393e682d0b7118ef2efe5c15", - "HG002_Revio_A_modkit_pileup.bed.gz.tbi:md5,08312c13316ed9b4b582897c210ecb58", - "HG002_Revio_B_modkit_pileup.bed.gz:md5,60f856e145343697ff581e91fda288ff", - "HG002_Revio_B_modkit_pileup.bed.gz.tbi:md5,d04e7a6fb67e9b5a8342ae979bc0e5cd", + "HG002_Revio_A_modkit_pileup_1.bed.gz:md5,7af3b6246d0c007aec686714b96a0f7f", + "HG002_Revio_A_modkit_pileup_1.bed.gz.tbi:md5,b7083ebf6ba176ed5a472ad653c5be27", + "HG002_Revio_A_modkit_pileup_2.bed.gz:md5,a2e1291b468361412899cf811022fe72", + "HG002_Revio_A_modkit_pileup_2.bed.gz.tbi:md5,d1c192d65d8fa8cbb8ffa2e545282fde", + "HG002_Revio_A_modkit_pileup_ungrouped.bed.gz:md5,9a077eb24b17d6511e849c5b533cda64", + "HG002_Revio_A_modkit_pileup_ungrouped.bed.gz.tbi:md5,f569a923cc5204df5dc495354ab83a13", + "HG002_Revio_B_modkit_pileup_1.bed.gz:md5,d8c15e30192ce878d17dffcc0981658a", + "HG002_Revio_B_modkit_pileup_1.bed.gz.tbi:md5,2d400d38de3f45871bffac0ca0d3d7d3", + "HG002_Revio_B_modkit_pileup_2.bed.gz:md5,a2e1291b468361412899cf811022fe72", + "HG002_Revio_B_modkit_pileup_2.bed.gz.tbi:md5,d1c192d65d8fa8cbb8ffa2e545282fde", + "HG002_Revio_B_modkit_pileup_ungrouped.bed.gz:md5,49d9380eb739081b7a0b4dfa7756d09c", + "HG002_Revio_B_modkit_pileup_ungrouped.bed.gz.tbi:md5,f569a923cc5204df5dc495354ab83a13", "mosdepth_cov_dist.txt:md5,41793745406425cfa02d558875df8d16", "mosdepth_cumcov_dist.txt:md5,c53933e0b572d115ecd35a5adb3e0a04", "mosdepth_perchrom.txt:md5,9fd9c40c7a6be06a338f2039a5d91fb8", @@ -754,6 +733,6 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-30T17:19:17.8692492" + "timestamp": "2024-10-31T16:14:41.962593731" } } \ No newline at end of file diff --git a/tests/samplesheet_multisample_ont_bam.nf.test.snap b/tests/samplesheet_multisample_ont_bam.nf.test.snap index a06ff946..f186dfa3 100644 --- a/tests/samplesheet_multisample_ont_bam.nf.test.snap +++ b/tests/samplesheet_multisample_ont_bam.nf.test.snap @@ -1,7 +1,7 @@ { "samplesheet_multisample_ont_bam | --preset ONT_R10 --phaser whatshap --parallel_alignments 1 --parallel_snv 1": { "content": [ - 107, + 103, { "ADD_FOUND_IN_TAG": { "bcftools": 1.2, @@ -51,12 +51,6 @@ "BEDTOOLS_SORT": { "bedtools": "2.31.1" }, - "BGZIP_MODKIT_PILEUP_PHASED": { - "tabix": 1.2 - }, - "BGZIP_MODKIT_PILEUP_UNPHASED": { - "tabix": 1.2 - }, "CRAMINO": { "cramino": "0.14.5" }, @@ -112,10 +106,7 @@ "MINIMAP2_INDEX": { "minimap2": "2.28-r1209" }, - "MODKIT_PILEUP_PHASED": { - "modkit": "0.3.0" - }, - "MODKIT_PILEUP_UNPHASED": { + "MODKIT_PILEUP": { "modkit": "0.3.0" }, "MOSDEPTH": { @@ -209,28 +200,20 @@ "methylation", "methylation/modkit", "methylation/modkit/pileup", - "methylation/modkit/pileup/phased", - "methylation/modkit/pileup/phased/HG002_ONT_A", - "methylation/modkit/pileup/phased/HG002_ONT_A/HG002_ONT_A_modkit_pileup_phased_1.bed.gz", - "methylation/modkit/pileup/phased/HG002_ONT_A/HG002_ONT_A_modkit_pileup_phased_1.bed.gz.tbi", - "methylation/modkit/pileup/phased/HG002_ONT_A/HG002_ONT_A_modkit_pileup_phased_2.bed.gz", - "methylation/modkit/pileup/phased/HG002_ONT_A/HG002_ONT_A_modkit_pileup_phased_2.bed.gz.tbi", - "methylation/modkit/pileup/phased/HG002_ONT_A/HG002_ONT_A_modkit_pileup_phased_ungrouped.bed.gz", - "methylation/modkit/pileup/phased/HG002_ONT_A/HG002_ONT_A_modkit_pileup_phased_ungrouped.bed.gz.tbi", - "methylation/modkit/pileup/phased/HG002_ONT_B", - "methylation/modkit/pileup/phased/HG002_ONT_B/HG002_ONT_B_modkit_pileup_phased_1.bed.gz", - "methylation/modkit/pileup/phased/HG002_ONT_B/HG002_ONT_B_modkit_pileup_phased_1.bed.gz.tbi", - "methylation/modkit/pileup/phased/HG002_ONT_B/HG002_ONT_B_modkit_pileup_phased_2.bed.gz", - "methylation/modkit/pileup/phased/HG002_ONT_B/HG002_ONT_B_modkit_pileup_phased_2.bed.gz.tbi", - "methylation/modkit/pileup/phased/HG002_ONT_B/HG002_ONT_B_modkit_pileup_phased_ungrouped.bed.gz", - "methylation/modkit/pileup/phased/HG002_ONT_B/HG002_ONT_B_modkit_pileup_phased_ungrouped.bed.gz.tbi", - "methylation/modkit/pileup/unphased", - "methylation/modkit/pileup/unphased/HG002_ONT_A", - "methylation/modkit/pileup/unphased/HG002_ONT_A/HG002_ONT_A_modkit_pileup.bed.gz", - "methylation/modkit/pileup/unphased/HG002_ONT_A/HG002_ONT_A_modkit_pileup.bed.gz.tbi", - "methylation/modkit/pileup/unphased/HG002_ONT_B", - "methylation/modkit/pileup/unphased/HG002_ONT_B/HG002_ONT_B_modkit_pileup.bed.gz", - "methylation/modkit/pileup/unphased/HG002_ONT_B/HG002_ONT_B_modkit_pileup.bed.gz.tbi", + "methylation/modkit/pileup/HG002_ONT_A", + "methylation/modkit/pileup/HG002_ONT_A/HG002_ONT_A_modkit_pileup_1.bed.gz", + "methylation/modkit/pileup/HG002_ONT_A/HG002_ONT_A_modkit_pileup_1.bed.gz.tbi", + "methylation/modkit/pileup/HG002_ONT_A/HG002_ONT_A_modkit_pileup_2.bed.gz", + "methylation/modkit/pileup/HG002_ONT_A/HG002_ONT_A_modkit_pileup_2.bed.gz.tbi", + "methylation/modkit/pileup/HG002_ONT_A/HG002_ONT_A_modkit_pileup_ungrouped.bed.gz", + "methylation/modkit/pileup/HG002_ONT_A/HG002_ONT_A_modkit_pileup_ungrouped.bed.gz.tbi", + "methylation/modkit/pileup/HG002_ONT_B", + "methylation/modkit/pileup/HG002_ONT_B/HG002_ONT_B_modkit_pileup_1.bed.gz", + "methylation/modkit/pileup/HG002_ONT_B/HG002_ONT_B_modkit_pileup_1.bed.gz.tbi", + "methylation/modkit/pileup/HG002_ONT_B/HG002_ONT_B_modkit_pileup_2.bed.gz", + "methylation/modkit/pileup/HG002_ONT_B/HG002_ONT_B_modkit_pileup_2.bed.gz.tbi", + "methylation/modkit/pileup/HG002_ONT_B/HG002_ONT_B_modkit_pileup_ungrouped.bed.gz", + "methylation/modkit/pileup/HG002_ONT_B/HG002_ONT_B_modkit_pileup_ungrouped.bed.gz.tbi", "multiqc", "multiqc/multiqc_data", "multiqc/multiqc_data/mosdepth_cov_dist.txt", @@ -372,22 +355,18 @@ ], [ "test.zip:md5,779efd29ec2cc66bef05c173c44e4168", - "HG002_ONT_A_modkit_pileup_phased_1.bed.gz:md5,2be86a42ac0384ac6d27fdf6e65304b7", - "HG002_ONT_A_modkit_pileup_phased_1.bed.gz.tbi:md5,a7955eabc34456dce834a2c966071eaa", - "HG002_ONT_A_modkit_pileup_phased_2.bed.gz:md5,ec565bd66fc73d380b7f9eb768369a65", - "HG002_ONT_A_modkit_pileup_phased_2.bed.gz.tbi:md5,e6eb3c61b79a4abd0fd952f710d6eab3", - "HG002_ONT_A_modkit_pileup_phased_ungrouped.bed.gz:md5,b42b812e1dced6242ed206754c7b3f3e", - "HG002_ONT_A_modkit_pileup_phased_ungrouped.bed.gz.tbi:md5,0c232dffb9651d934b179f95365931db", - "HG002_ONT_B_modkit_pileup_phased_1.bed.gz:md5,2be86a42ac0384ac6d27fdf6e65304b7", - "HG002_ONT_B_modkit_pileup_phased_1.bed.gz.tbi:md5,a7955eabc34456dce834a2c966071eaa", - "HG002_ONT_B_modkit_pileup_phased_2.bed.gz:md5,ec565bd66fc73d380b7f9eb768369a65", - "HG002_ONT_B_modkit_pileup_phased_2.bed.gz.tbi:md5,e6eb3c61b79a4abd0fd952f710d6eab3", - "HG002_ONT_B_modkit_pileup_phased_ungrouped.bed.gz:md5,42dcaedf8c379a4e5dee0822d5e8aca4", - "HG002_ONT_B_modkit_pileup_phased_ungrouped.bed.gz.tbi:md5,3d97d016882c99e4e21112fc76ceb2a2", - "HG002_ONT_A_modkit_pileup.bed.gz:md5,e04d51deb9019e67e7ddd7f1bd82a580", - "HG002_ONT_A_modkit_pileup.bed.gz.tbi:md5,1e198df01c63afea13ef9d04e2d03684", - "HG002_ONT_B_modkit_pileup.bed.gz:md5,95a96ceddc795c9c5c4a8d9e6f9d3b5b", - "HG002_ONT_B_modkit_pileup.bed.gz.tbi:md5,8276c6feeac0be16274198831c75023d", + "HG002_ONT_A_modkit_pileup_1.bed.gz:md5,2be86a42ac0384ac6d27fdf6e65304b7", + "HG002_ONT_A_modkit_pileup_1.bed.gz.tbi:md5,a7955eabc34456dce834a2c966071eaa", + "HG002_ONT_A_modkit_pileup_2.bed.gz:md5,ec565bd66fc73d380b7f9eb768369a65", + "HG002_ONT_A_modkit_pileup_2.bed.gz.tbi:md5,e6eb3c61b79a4abd0fd952f710d6eab3", + "HG002_ONT_A_modkit_pileup_ungrouped.bed.gz:md5,b42b812e1dced6242ed206754c7b3f3e", + "HG002_ONT_A_modkit_pileup_ungrouped.bed.gz.tbi:md5,0c232dffb9651d934b179f95365931db", + "HG002_ONT_B_modkit_pileup_1.bed.gz:md5,2be86a42ac0384ac6d27fdf6e65304b7", + "HG002_ONT_B_modkit_pileup_1.bed.gz.tbi:md5,a7955eabc34456dce834a2c966071eaa", + "HG002_ONT_B_modkit_pileup_2.bed.gz:md5,ec565bd66fc73d380b7f9eb768369a65", + "HG002_ONT_B_modkit_pileup_2.bed.gz.tbi:md5,e6eb3c61b79a4abd0fd952f710d6eab3", + "HG002_ONT_B_modkit_pileup_ungrouped.bed.gz:md5,42dcaedf8c379a4e5dee0822d5e8aca4", + "HG002_ONT_B_modkit_pileup_ungrouped.bed.gz.tbi:md5,3d97d016882c99e4e21112fc76ceb2a2", "mosdepth_cov_dist.txt:md5,1eb2a5c39fd4b8dd814049b65b007037", "mosdepth_cumcov_dist.txt:md5,5ad1d589df3fa7fe5d21fc95001573a9", "mosdepth_perchrom.txt:md5,86a907217d64d4c2717885403058580f", @@ -498,6 +477,6 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-30T17:20:47.644972969" + "timestamp": "2024-10-31T16:16:52.848104929" } } \ No newline at end of file diff --git a/workflows/nallo.nf b/workflows/nallo.nf index d89de0ef..312ae3e0 100644 --- a/workflows/nallo.nf +++ b/workflows/nallo.nf @@ -450,15 +450,6 @@ workflow NALLO { ch_multiqc_files = ch_multiqc_files.mix(PHASING.out.stats.collect{it[1]}.ifEmpty([])) - // - // Create methylation pileups with modkit - // - if(!params.skip_methylation_wf) { - - METHYLATION( PHASING.out.haplotagged_bam_bai, fasta, fai, ch_input_bed ) - ch_versions = ch_versions.mix(METHYLATION.out.versions) - } - // // Call repeat expansions with TRGT // @@ -476,6 +467,19 @@ workflow NALLO { } } } + + // + // Create methylation pileups with modkit + // + if (!params.skip_methylation_wf) { + METHYLATION ( + !params.skip_phasing_wf ? PHASING.out.haplotagged_bam_bai : bam_bai, + fasta, + fai, + ch_input_bed, + ) + ch_versions = ch_versions.mix(METHYLATION.out.versions) + } } // Merge SVs and CNVs if we've called both SVs and CNVs