diff --git a/.nf-core.yml b/.nf-core.yml index e0b85a77..114ce459 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -1,2 +1,4 @@ repository_type: pipeline +lint: + subworkflow_changes: false nf_core_version: "2.14.1" diff --git a/CHANGELOG.md b/CHANGELOG.md index e5b7e078..7913c6c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ Initial release of nf-core/phaseimpute, created with the [nf-core](https://nf-co ### `Added` +- [#20](https://github.com/nf-core/phaseimpute/pull/20) - Added automatic detection of vcf contigs for the reference panel and automatic renaming available +- [#22](https://github.com/nf-core/phaseimpute/pull/20) - Add validation step for concordance analysis. Input channels changed to match inputs steps. Outdir folder organised by steps. Modules config by subworkflows. +- [#26](https://github.com/nf-core/phaseimpute/pull/26) - Added QUILT method + ### `Changed` - [#18](https://github.com/nf-core/phaseimpute/pull/18) @@ -17,9 +21,7 @@ Initial release of nf-core/phaseimpute, created with the [nf-core](https://nf-co - correct meta map propagation - Test impute and test sim works - [#19](https://github.com/nf-core/phaseimpute/pull/19) - Changed reference panel to accept a csv, update modules and subworkflows (glimpse1/2 and shapeit5) -- [#20](https://github.com/nf-core/phaseimpute/pull/20) - Added automatic detection of vcf contigs for the reference panel and automatic renaming available -- [#22](https://github.com/nf-core/phaseimpute/pull/20) - Add validation step for concordance analysis. Input channels changed to match inputs steps. Outdir folder organised by steps. Modules config by subworkflows. -- [#26](https://github.com/nf-core/phaseimpute/pull/26) - Added QUILT method +- [#51](https://github.com/nf-core/phaseimpute/pull/51) - Update all process and fix linting errors. Remove fastqc added by the template. ### `Fixed` diff --git a/modules.json b/modules.json index d3c2bc4c..101f6723 100644 --- a/modules.json +++ b/modules.json @@ -7,13 +7,13 @@ "nf-core": { "bcftools/annotate": { "branch": "master", - "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", + "git_sha": "2ad29c2aed06d815d9f68ad7ba20b3b1c574ce9c", "installed_by": ["modules"], "patch": "modules/nf-core/bcftools/annotate/bcftools-annotate.diff" }, "bcftools/concat": { "branch": "master", - "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", + "git_sha": "b42fec6f7c6e5d0716685cabb825ef6bf6e386b5", "installed_by": ["modules"], "patch": "modules/nf-core/bcftools/concat/bcftools-concat.diff" }, @@ -25,16 +25,11 @@ "bcftools/index": { "branch": "master", "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", - "installed_by": [ - "modules", - "multiple_impute_glimpse2", - "vcf_impute_glimpse", - "vcf_phase_shapeit5" - ] + "installed_by": ["multiple_impute_glimpse2", "vcf_impute_glimpse", "vcf_phase_shapeit5"] }, "bcftools/mpileup": { "branch": "master", - "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", + "git_sha": "e7df38a545d7d72083eededabd8849f731a01502", "installed_by": ["modules"], "patch": "modules/nf-core/bcftools/mpileup/bcftools-mpileup.diff" }, @@ -64,14 +59,9 @@ "git_sha": "de45447d060b8c8b98575bc637a4a575fd0638e1", "installed_by": ["modules"] }, - "fastqc": { - "branch": "master", - "git_sha": "285a50500f9e02578d90b3ce6382ea3c30216acd", - "installed_by": ["modules"] - }, "gawk": { "branch": "master", - "git_sha": "da4d05d04e65227d4307e87940842f1a14de62c7", + "git_sha": "b42fec6f7c6e5d0716685cabb825ef6bf6e386b5", "installed_by": ["modules"] }, "glimpse/chunk": { @@ -101,7 +91,7 @@ }, "glimpse2/ligate": { "branch": "master", - "git_sha": "ee7fee68281944b002bd27a8ff3f19200b4d3fad", + "git_sha": "09d793219114004f268b98663b12f8062097a8c5", "installed_by": ["multiple_impute_glimpse2"] }, "glimpse2/phase": { @@ -205,6 +195,11 @@ "branch": "master", "git_sha": "7e56daae390ff896b292ddc70823447683a79936", "installed_by": ["subworkflows"] + }, + "vcf_phase_shapeit5": { + "branch": "master", + "git_sha": "dcf17cc0ed8fd5ea57e61a13e0147cddb5c1ee30", + "installed_by": ["subworkflows"] } } } diff --git a/modules/nf-core/bcftools/annotate/main.nf b/modules/nf-core/bcftools/annotate/main.nf index a65855ab..b93faeab 100644 --- a/modules/nf-core/bcftools/annotate/main.nf +++ b/modules/nf-core/bcftools/annotate/main.nf @@ -54,8 +54,10 @@ process BCFTOOLS_ANNOTATE { args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" : args.contains("--output-type v") || args.contains("-Ov") ? "vcf" : "vcf" + + def create_cmd = extension.endsWith(".gz") ? "echo '' | gzip >" : "touch" """ - touch ${prefix}.${extension} + ${create_cmd} ${prefix}.${extension} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/bcftools/annotate/tests/bcf.config b/modules/nf-core/bcftools/annotate/tests/bcf.config new file mode 100644 index 00000000..b8496b33 --- /dev/null +++ b/modules/nf-core/bcftools/annotate/tests/bcf.config @@ -0,0 +1,6 @@ +process { + withName: 'BCFTOOLS_ANNOTATE' { + ext.args = "-x ID,INFO/DP,FORMAT/DP --output-type u" + ext.prefix = { "${meta.id}_ann" } + } +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/annotate/tests/main.nf.test b/modules/nf-core/bcftools/annotate/tests/main.nf.test new file mode 100644 index 00000000..9abf9475 --- /dev/null +++ b/modules/nf-core/bcftools/annotate/tests/main.nf.test @@ -0,0 +1,108 @@ +nextflow_process { + + name "Test Process BCFTOOLS_ANNOTATE" + script "../main.nf" + process "BCFTOOLS_ANNOTATE" + + tag "modules" + tag "modules_nfcore" + tag "bcftools" + tag "bcftools/annotate" + + test("sarscov2 - [vcf, tbi, vcf2, tbi2, []] - vcf_output") { + + config "./vcf.config" + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true), + [] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf.collect { it.collect { it instanceof Map ? it : file(it).name }}, + process.out.versions + ).match("vcf") } + ) + } + + } + + + test("sarscov2 - [vcf, [], [], [], header] - bcf_output") { + + config "./bcf.config" + + when { + process { + """ + vcf = Channel.of([ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + [], + [], + [] + ]) + + header = Channel.of( + '##INFO=', + '##INFO=' + ) + .collectFile(name:"headers.vcf", newLine:true) + + input[0] = vcf.combine(header) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf.collect { it.collect { it instanceof Map ? it : file(it).name }}, + process.out.versions + ).match("bcf") } + ) + } + + } + + test("sarscov2 - [vcf, tbi, vcf2, tbi2, []] - stub") { + + config "./vcf.config" + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true), + [] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match("stub") } + ) + } + + } + +} diff --git a/modules/nf-core/bcftools/annotate/tests/main.nf.test.snap b/modules/nf-core/bcftools/annotate/tests/main.nf.test.snap new file mode 100644 index 00000000..72b06878 --- /dev/null +++ b/modules/nf-core/bcftools/annotate/tests/main.nf.test.snap @@ -0,0 +1,79 @@ +{ + "bcf": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_ann.bcf" + ] + ], + [ + "versions.yml:md5,ea2b798edb5c1c0d46938f313a97a901" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-05-03T09:21:58.526449656" + }, + "vcf": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz" + ] + ], + [ + "versions.yml:md5,ea2b798edb5c1c0d46938f313a97a901" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-05-02T16:47:47.127427579" + }, + "stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + "versions.yml:md5,ea2b798edb5c1c0d46938f313a97a901" + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,ea2b798edb5c1c0d46938f313a97a901" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-05-02T16:43:43.707474961" + } +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/annotate/tests/tags.yml b/modules/nf-core/bcftools/annotate/tests/tags.yml new file mode 100644 index 00000000..f97a1afc --- /dev/null +++ b/modules/nf-core/bcftools/annotate/tests/tags.yml @@ -0,0 +1,2 @@ +bcftools/annotate: + - "modules/nf-core/bcftools/annotate/**" diff --git a/modules/nf-core/bcftools/annotate/tests/vcf.config b/modules/nf-core/bcftools/annotate/tests/vcf.config new file mode 100644 index 00000000..cb809f61 --- /dev/null +++ b/modules/nf-core/bcftools/annotate/tests/vcf.config @@ -0,0 +1,6 @@ +process { + withName: 'BCFTOOLS_ANNOTATE' { + ext.prefix = { "${meta.id}_vcf" } + ext.args = "-x ID,INFO/DP,FORMAT/DP --output-type z" + } +} diff --git a/modules/nf-core/bcftools/concat/main.nf b/modules/nf-core/bcftools/concat/main.nf index e3281f46..432d7ab0 100644 --- a/modules/nf-core/bcftools/concat/main.nf +++ b/modules/nf-core/bcftools/concat/main.nf @@ -39,7 +39,7 @@ process BCFTOOLS_CONCAT { stub: prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.vcf.gz + echo "" | gzip > ${prefix}.vcf.gz cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/bcftools/concat/tests/main.nf.test b/modules/nf-core/bcftools/concat/tests/main.nf.test index bf1a5f3f..d5d9f787 100644 --- a/modules/nf-core/bcftools/concat/tests/main.nf.test +++ b/modules/nf-core/bcftools/concat/tests/main.nf.test @@ -34,10 +34,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out.vcf, - process.out.versions - ).match() } + { assert snapshot(process.out).match() } ) } @@ -63,10 +60,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out.vcf, - process.out.versions - ).match() } + { assert snapshot(process.out).match() } ) } @@ -96,10 +90,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - file(process.out.vcf[0][1]).name, - process.out.versions - ).match() } + { assert snapshot(process.out).match() } ) } diff --git a/modules/nf-core/bcftools/concat/tests/main.nf.test.snap b/modules/nf-core/bcftools/concat/tests/main.nf.test.snap index 7344e6e3..90d3fc06 100644 --- a/modules/nf-core/bcftools/concat/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/concat/tests/main.nf.test.snap @@ -1,43 +1,101 @@ { "sarscov2 - [[vcf1, vcf2], []]": { "content": [ - [ - [ - { - "id": "test3" - }, - "test3.vcf.gz:md5,4bcd0afd89f56c5d433f6b6abc44d0a6" + { + "0": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], + "1": [ + "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" + ], + "vcf": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], + "versions": [ + "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" ] - ], - [ - "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" - ] + } ], - "timestamp": "2023-11-29T13:52:27.03724666" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-05-03T13:22:49.766749302" }, "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]]": { "content": [ - [ - [ - { - "id": "test3" - }, - "test3.vcf.gz:md5,4bcd0afd89f56c5d433f6b6abc44d0a6" + { + "0": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], + "1": [ + "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" + ], + "vcf": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], + "versions": [ + "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" ] - ], - [ - "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" - ] + } ], - "timestamp": "2023-11-29T13:52:21.468988293" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-05-03T13:22:41.119912312" }, "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - stub": { "content": [ - "test3.vcf.gz", - [ - "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" - ] + { + "0": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" + ], + "vcf": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" + ] + } ], - "timestamp": "2023-11-29T13:41:04.716017811" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-05-03T13:22:59.90466392" } } \ No newline at end of file diff --git a/modules/nf-core/bcftools/mpileup/main.nf b/modules/nf-core/bcftools/mpileup/main.nf index 48a567e5..d8b6a9b3 100644 --- a/modules/nf-core/bcftools/mpileup/main.nf +++ b/modules/nf-core/bcftools/mpileup/main.nf @@ -56,4 +56,18 @@ process BCFTOOLS_MPILEUP { bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.bcftools_stats.txt + echo "" | gzip > ${prefix}.vcf.gz + touch ${prefix}.vcf.gz.tbi + echo "" | gzip > ${prefix}.mpileup.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/bcftools/mpileup/tests/main.nf.test b/modules/nf-core/bcftools/mpileup/tests/main.nf.test index 6478bbc2..dc35c542 100644 --- a/modules/nf-core/bcftools/mpileup/tests/main.nf.test +++ b/modules/nf-core/bcftools/mpileup/tests/main.nf.test @@ -33,13 +33,43 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out.vcf, - process.out.tbi, - process.out.stats, - process.out.mpileup, - process.out.versions - ).match() } + { assert snapshot(file(process.out.vcf[0][1]).name).match("bam_fasta_false.vcf.gz") }, + { assert snapshot(file(process.out.tbi[0][1]).name).match("bam_fasta_false.vcf.gz.tbi") }, + { assert snapshot(file(process.out.stats[0][1]).name).match("bam_fasta_false.bcftools_stats.txt") }, + { assert snapshot(process.out.versions).match("bam_fasta_false_versions") } + ) + } + + } + + test("sarscov2 - [bam, []], fasta, false stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + [] + ] + input[1] = [ + [ id:'sarscov2' ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.vcf[0][1]).name).match("bam_fasta_false_stub.vcf.gz") }, + { assert snapshot(file(process.out.tbi[0][1]).name).match("bam_fasta_false_stub.vcf.gz.tbi") }, + { assert snapshot(file(process.out.stats[0][1]).name).match("bam_fasta_false_stub.bcftools_stats.txt") }, + { assert snapshot(process.out.versions).match("bam_fasta_false_stub_versions") } ) } @@ -67,13 +97,45 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out.vcf, - process.out.tbi, - process.out.stats, - process.out.mpileup, - process.out.versions - ).match() } + { assert snapshot(file(process.out.vcf[0][1]).name).match("bam_bed_fasta_true_stub.vcf.gz") }, + { assert snapshot(file(process.out.tbi[0][1]).name).match("bam_bed_fasta_true_stub.vcf.gz.tbi") }, + { assert snapshot(file(process.out.stats[0][1]).name).match("bam_bed_fasta_true_stub.bcftools_stats.txt") }, + { assert snapshot(file(process.out.mpileup[0][1]).name).match("bam_bed_fasta_true_stub.mpileup.gz") }, + { assert snapshot(process.out.versions).match("bam_bed_fasta_true_stub_versions") } + ) + } + + } + + test("sarscov2 - [bam, []], fasta, true stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + [] + ] + input[1] = [ + [ id:'sarscov2' ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = true + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.vcf[0][1]).name).match("bam_bed_fasta_true.vcf.gz") }, + { assert snapshot(file(process.out.tbi[0][1]).name).match("bam_bed_fasta_true.vcf.gz.tbi") }, + { assert snapshot(file(process.out.stats[0][1]).name).match("bam_bed_fasta_true.bcftools_stats.txt") }, + { assert snapshot(file(process.out.mpileup[0][1]).name).match("bam_bed_fasta_true.mpileup.gz") }, + { assert snapshot(process.out.versions).match("bam_bed_fasta_true_versions") } ) } @@ -101,13 +163,43 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out.vcf, - process.out.tbi, - process.out.stats, - process.out.mpileup, - process.out.versions - ).match() } + { assert snapshot(file(process.out.vcf[0][1]).name).match("bam_bed_fasta_false.vcf.gz") }, + { assert snapshot(file(process.out.tbi[0][1]).name).match("bam_bed_fasta_false.vcf.gz.tbi") }, + { assert snapshot(file(process.out.stats[0][1]).name).match("bam_bed_fasta_false.bcftools_stats.txt") }, + { assert snapshot(process.out.versions).match("bam_bed_fasta_false_versions") } + ) + } + + } + + test("sarscov2 - [bam, bed], fasta, false stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + ] + input[1] = [ + [ id:'sarscov2' ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.vcf[0][1]).name).match("bam_bed_fasta_false_stub.vcf.gz") }, + { assert snapshot(file(process.out.tbi[0][1]).name).match("bam_bed_fasta_false_stub.vcf.gz.tbi") }, + { assert snapshot(file(process.out.stats[0][1]).name).match("bam_bed_fasta_false_stub.bcftools_stats.txt") }, + { assert snapshot(process.out.versions).match("bam_bed_fasta_false_stub_versions") } ) } diff --git a/modules/nf-core/bcftools/mpileup/tests/main.nf.test.snap b/modules/nf-core/bcftools/mpileup/tests/main.nf.test.snap index ef80ab1b..8b8d5eab 100644 --- a/modules/nf-core/bcftools/mpileup/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/mpileup/tests/main.nf.test.snap @@ -1,112 +1,274 @@ { - "sarscov2 - [bam, []], fasta, true": { + "bam_bed_fasta_true.vcf.gz.tbi": { + "content": [ + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:45.172966" + }, + "bam_bed_fasta_false_stub.vcf.gz": { + "content": [ + "test.vcf.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:57.815085" + }, + "bam_fasta_false_stub.vcf.gz.tbi": { + "content": [ + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:39:15.731277" + }, + "bam_bed_fasta_false_stub.bcftools_stats.txt": { + "content": [ + "test.bcftools_stats.txt" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:57.844573" + }, + "bam_bed_fasta_true_stub.mpileup.gz": { + "content": [ + "test.mpileup.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:39.462382" + }, + "bam_bed_fasta_true.vcf.gz": { + "content": [ + "test.vcf.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:45.146525" + }, + "bam_bed_fasta_true_stub.vcf.gz": { + "content": [ + "test.vcf.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:39.42754" + }, + "bam_fasta_false_versions": { "content": [ - [ - [ - { - "id": "test" - }, - "test.vcf.gz:md5,0f2f2c8488e97e7f13979380d5d3b6b5" - ] - ], - [ - [ - { - "id": "test" - }, - "test.vcf.gz.tbi:md5,34cb2eeb73f4d2b98218acecebd92704" - ] - ], - [ - [ - { - "id": "test" - }, - "test.bcftools_stats.txt:md5,a988fbcd2ea5d1ce30970dcb60a77ed7" - ] - ], - [ - [ - { - "id": "test" - }, - "test.mpileup.gz:md5,73b4a00398bddab2cd065b40d17ca4dc" - ] - ], [ "versions.yml:md5,e09c59d941374bb293aadc36e2f29dbf" ] ], - "timestamp": "2023-11-29T14:11:54.549517279" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:39:10.137483" }, - "sarscov2 - [bam, bed], fasta, false": { + "bam_fasta_false_stub.bcftools_stats.txt": { + "content": [ + "test.bcftools_stats.txt" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:39:15.746204" + }, + "bam_bed_fasta_false_versions": { "content": [ - [ - [ - { - "id": "test" - }, - "test.vcf.gz:md5,687244dbf71d05b3b973ab08ecf05310" - ] - ], - [ - [ - { - "id": "test" - }, - "test.vcf.gz.tbi:md5,3785df15f3d7faf35f3ad70d167a50f7" - ] - ], - [ - [ - { - "id": "test" - }, - "test.bcftools_stats.txt:md5,f8c5ab149c4bf0e5f51c518346cb87b5" - ] - ], - [ - - ], [ "versions.yml:md5,e09c59d941374bb293aadc36e2f29dbf" ] ], - "timestamp": "2023-11-29T14:12:00.865439661" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:51.772936" }, - "sarscov2 - [bam, []], fasta, false": { + "bam_bed_fasta_false.vcf.gz": { + "content": [ + "test.vcf.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:51.72798" + }, + "bam_bed_fasta_true_versions": { "content": [ [ - [ - { - "id": "test" - }, - "test.vcf.gz:md5,0f2f2c8488e97e7f13979380d5d3b6b5" - ] - ], - [ - [ - { - "id": "test" - }, - "test.vcf.gz.tbi:md5,34cb2eeb73f4d2b98218acecebd92704" - ] - ], + "versions.yml:md5,e09c59d941374bb293aadc36e2f29dbf" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:45.20135" + }, + "bam_fasta_false.vcf.gz": { + "content": [ + "test.vcf.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:39:10.051991" + }, + "bam_fasta_false.bcftools_stats.txt": { + "content": [ + "test.bcftools_stats.txt" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:39:10.123726" + }, + "bam_bed_fasta_false.bcftools_stats.txt": { + "content": [ + "test.bcftools_stats.txt" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:51.761517" + }, + "bam_bed_fasta_false_stub.vcf.gz.tbi": { + "content": [ + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:57.832271" + }, + "bam_bed_fasta_false.vcf.gz.tbi": { + "content": [ + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:51.748389" + }, + "bam_fasta_false_stub.vcf.gz": { + "content": [ + "test.vcf.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:39:15.709802" + }, + "bam_bed_fasta_true_stub.bcftools_stats.txt": { + "content": [ + "test.bcftools_stats.txt" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:39.453121" + }, + "bam_fasta_false.vcf.gz.tbi": { + "content": [ + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:39:10.108027" + }, + "bam_fasta_false_stub_versions": { + "content": [ [ - [ - { - "id": "test" - }, - "test.bcftools_stats.txt:md5,a988fbcd2ea5d1ce30970dcb60a77ed7" - ] - ], + "versions.yml:md5,e09c59d941374bb293aadc36e2f29dbf" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:39:15.770612" + }, + "bam_bed_fasta_true.bcftools_stats.txt": { + "content": [ + "test.bcftools_stats.txt" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:45.18304" + }, + "bam_bed_fasta_true_stub.vcf.gz.tbi": { + "content": [ + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:39.442077" + }, + "bam_bed_fasta_false_stub_versions": { + "content": [ [ - - ], + "versions.yml:md5,e09c59d941374bb293aadc36e2f29dbf" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:57.868309" + }, + "bam_bed_fasta_true.mpileup.gz": { + "content": [ + "test.mpileup.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:45.192888" + }, + "bam_bed_fasta_true_stub_versions": { + "content": [ [ "versions.yml:md5,e09c59d941374bb293aadc36e2f29dbf" ] ], - "timestamp": "2023-11-29T14:11:47.814900494" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:39.470988" } } \ No newline at end of file diff --git a/modules/nf-core/fastqc/main.nf b/modules/nf-core/fastqc/main.nf deleted file mode 100644 index d79f1c86..00000000 --- a/modules/nf-core/fastqc/main.nf +++ /dev/null @@ -1,61 +0,0 @@ -process FASTQC { - tag "$meta.id" - label 'process_medium' - - conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/fastqc:0.12.1--hdfd78af_0' : - 'biocontainers/fastqc:0.12.1--hdfd78af_0' }" - - input: - tuple val(meta), path(reads) - - output: - tuple val(meta), path("*.html"), emit: html - tuple val(meta), path("*.zip") , emit: zip - 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}" - // Make list of old name and new name pairs to use for renaming in the bash while loop - def old_new_pairs = reads instanceof Path || reads.size() == 1 ? [[ reads, "${prefix}.${reads.extension}" ]] : reads.withIndex().collect { entry, index -> [ entry, "${prefix}_${index + 1}.${entry.extension}" ] } - def rename_to = old_new_pairs*.join(' ').join(' ') - def renamed_files = old_new_pairs.collect{ old_name, new_name -> new_name }.join(' ') - - def memory_in_mb = MemoryUnit.of("${task.memory}").toUnit('MB') - // FastQC memory value allowed range (100 - 10000) - def fastqc_memory = memory_in_mb > 10000 ? 10000 : (memory_in_mb < 100 ? 100 : memory_in_mb) - - """ - printf "%s %s\\n" $rename_to | while read old_name new_name; do - [ -f "\${new_name}" ] || ln -s \$old_name \$new_name - done - - fastqc \\ - $args \\ - --threads $task.cpus \\ - --memory $fastqc_memory \\ - $renamed_files - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - fastqc: \$( fastqc --version | sed '/FastQC v/!d; s/.*v//' ) - END_VERSIONS - """ - - stub: - def prefix = task.ext.prefix ?: "${meta.id}" - """ - touch ${prefix}.html - touch ${prefix}.zip - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - fastqc: \$( fastqc --version | sed '/FastQC v/!d; s/.*v//' ) - END_VERSIONS - """ -} diff --git a/modules/nf-core/gawk/main.nf b/modules/nf-core/gawk/main.nf index f856a1f8..578b448c 100644 --- a/modules/nf-core/gawk/main.nf +++ b/modules/nf-core/gawk/main.nf @@ -41,10 +41,11 @@ process GAWK { stub: prefix = task.ext.prefix ?: "${meta.id}" - suffix = task.ext.suffix ?: "${input.getExtension}" + suffix = task.ext.suffix ?: "${input.getExtension()}" + def create_cmd = suffix.endsWith("gz") ? "echo '' | gzip >" : "touch" """ - touch ${prefix}.${suffix} + ${create_cmd} ${prefix}.${suffix} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/glimpse2/ligate/main.nf b/modules/nf-core/glimpse2/ligate/main.nf index e58b5939..8c6256cf 100644 --- a/modules/nf-core/glimpse2/ligate/main.nf +++ b/modules/nf-core/glimpse2/ligate/main.nf @@ -22,7 +22,7 @@ process GLIMPSE2_LIGATE { def prefix = task.ext.prefix ?: "${meta.id}" def suffix = task.ext.suffix ?: "vcf.gz" """ - printf "%s\\n" $input_list | tr -d '[],' > all_files.txt + printf "%s\\n" $input_list | tr -d '[],' | sort -V > all_files.txt GLIMPSE2_ligate \\ $args \\ diff --git a/subworkflows/nf-core/vcf_phase_shapeit5/main.nf b/subworkflows/nf-core/vcf_phase_shapeit5/main.nf index 51061373..400f9d97 100644 --- a/subworkflows/nf-core/vcf_phase_shapeit5/main.nf +++ b/subworkflows/nf-core/vcf_phase_shapeit5/main.nf @@ -1,8 +1,8 @@ -include { BEDTOOLS_MAKEWINDOWS } from '../../../modules/nf-core/bedtools/makewindows/main.nf' -include { SHAPEIT5_PHASECOMMON } from '../../../modules/nf-core/shapeit5/phasecommon/main' -include { SHAPEIT5_LIGATE } from '../../../modules/nf-core/shapeit5/ligate/main' -include { BCFTOOLS_INDEX as VCF_BCFTOOLS_INDEX_1 } from '../../../modules/nf-core/bcftools/index/main.nf' -include { BCFTOOLS_INDEX as VCF_BCFTOOLS_INDEX_2 } from '../../../modules/nf-core/bcftools/index/main.nf' +include { BEDTOOLS_MAKEWINDOWS } from '../../../modules/nf-core/bedtools/makewindows/main.nf' +include { SHAPEIT5_PHASECOMMON } from '../../../modules/nf-core/shapeit5/phasecommon/main' +include { SHAPEIT5_LIGATE } from '../../../modules/nf-core/shapeit5/ligate/main' +include { BCFTOOLS_INDEX as VCF_BCFTOOLS_INDEX_1 } from '../../../modules/nf-core/bcftools/index/main.nf' +include { BCFTOOLS_INDEX as VCF_BCFTOOLS_INDEX_2 } from '../../../modules/nf-core/bcftools/index/main.nf' workflow VCF_PHASE_SHAPEIT5 { @@ -90,7 +90,7 @@ workflow VCF_PHASE_SHAPEIT5 { emit: bed = BEDTOOLS_MAKEWINDOWS.out.bed // channel: [ val(meta), bed ] variants_phased = SHAPEIT5_LIGATE.out.merged_variants // channel: [ val(meta), vcf ] - variants_index = VCF_BCFTOOLS_INDEX_2.out.csi // channel: [ val(meta), csi ] + variants_index = VCF_BCFTOOLS_INDEX_2.out.csi // channel: [ val(meta), csi ] versions = ch_versions // channel: [ versions.yml ] }