diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4771574..c4ca534 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: profile: "conda" - isMaster: false profile: "singularity" - shard: [1, 2, 3, 4, 5, 6] + shard: [1, 2, 3, 4, 5] steps: - name: Check out pipeline code uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 diff --git a/modules.json b/modules.json index faee1cb..db37526 100644 --- a/modules.json +++ b/modules.json @@ -72,7 +72,7 @@ }, "manta/convertinversion": { "branch": "master", - "git_sha": "1e2b7fb7106852388610c0360d234b0829eb980e", + "git_sha": "81880787133db07d9b4c1febd152c090eb8325dc", "installed_by": ["modules"] }, "multiqc": { diff --git a/modules/nf-core/manta/convertinversion/environment.yml b/modules/nf-core/manta/convertinversion/environment.yml index c238cf4..3aa535e 100644 --- a/modules/nf-core/manta/convertinversion/environment.yml +++ b/modules/nf-core/manta/convertinversion/environment.yml @@ -1,9 +1,9 @@ -name: manta_convertinversion +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: + - bioconda::htslib=1.16 - bioconda::manta=1.6.0 - bioconda::samtools=1.16.1 - - bioconda::htslib=1.16 diff --git a/modules/nf-core/manta/convertinversion/main.nf b/modules/nf-core/manta/convertinversion/main.nf index dde263d..462b2e5 100644 --- a/modules/nf-core/manta/convertinversion/main.nf +++ b/modules/nf-core/manta/convertinversion/main.nf @@ -33,4 +33,17 @@ process MANTA_CONVERTINVERSION { samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' ) END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + echo "" | gzip > ${prefix}.vcf.gz + touch ${prefix}.vcf.gz.tbi + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + manta: \$( configManta.py --version ) + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' ) + END_VERSIONS + """ } diff --git a/modules/nf-core/manta/convertinversion/meta.yml b/modules/nf-core/manta/convertinversion/meta.yml index cd1d3ce..3a70814 100644 --- a/modules/nf-core/manta/convertinversion/meta.yml +++ b/modules/nf-core/manta/convertinversion/meta.yml @@ -1,5 +1,7 @@ name: "manta_convertinversion" -description: Manta calls structural variants (SVs) and indels from mapped paired-end sequencing reads. This script reformats inversions into single inverted sequence junctions which was the format used in Manta versions <= 1.4.0. +description: Manta calls structural variants (SVs) and indels from mapped paired-end + sequencing reads. This script reformats inversions into single inverted sequence + junctions which was the format used in Manta versions <= 1.4.0. keywords: - structural variants - conversion @@ -12,34 +14,52 @@ tools: tool_dev_url: https://github.com/Illumina/manta doi: "10.1093/bioinformatics/btv710" licence: ["GPL v3"] + identifier: biotools:manta_sv input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - vcf: - type: file - description: VCF file produces by Manta - pattern: "*.vcf.gz" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: VCF file produces by Manta + pattern: "*.vcf.gz" + - - meta2: + type: map + description: | + Groovy Map containing fasta information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: The reference fasta file + pattern: "*.{fasta,fa,fna}" 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 reformatted inversions - pattern: "*.vcf.gz" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.vcf.gz": + type: file + description: VCF file with reformatted inversions + pattern: "*.vcf.gz" - tbi: - type: file - description: TBI file produces by Manta - pattern: "*.vcf.gz.tbi" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.vcf.gz.tbi": + type: file + description: TBI file produces by Manta + pattern: "*.vcf.gz.tbi" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@FriederikeHanssen" maintainers: diff --git a/modules/nf-core/manta/convertinversion/tests/main.nf.test b/modules/nf-core/manta/convertinversion/tests/main.nf.test new file mode 100644 index 0000000..58adf6e --- /dev/null +++ b/modules/nf-core/manta/convertinversion/tests/main.nf.test @@ -0,0 +1,92 @@ +nextflow_process { + + name "Test Process MANTA_CONVERTINVERSION" + script "../main.nf" + process "MANTA_CONVERTINVERSION" + + tag "modules" + tag "modules_nfcore" + tag "manta" + tag "manta/convertinversion" + tag "manta/tumoronly" + + setup { + run("MANTA_TUMORONLY") { + script "../../tumoronly/main.nf" + process { + """ + input[0] = [ + [ id:'test'], // meta map + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram"), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram.crai"), + [], + [] + ] + input[1] = [ + [ id:'fasta' ], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta") + ] + input[2] = [ + [ id:'fai' ], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai") + ] + input[3] = [] + """ + } + } + + } + + test("homo_sapiens - vcf, fasta") { + + when { + process { + """ + input[0] = MANTA_TUMORONLY.out.tumor_sv_vcf + input[1] = [ + [ id:'fasta' ], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta") + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf.collect { it.collect { it instanceof Map ? it : path(it).linesGzip[-7..-3] } }, + process.out.tbi.collect { it.collect { it instanceof Map ? it : file(it).name } }, + process.out.versions + ).match() } + ) + } + + } + + test("homo_sapiens - vcf, fasta - stub") { + + options "-stub" + + when { + process { + """ + input[0] = MANTA_TUMORONLY.out.tumor_sv_vcf + input[1] = [ + [ id:'fasta' ], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta") + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match("stub") } + ) + } + + } + +} diff --git a/modules/nf-core/manta/convertinversion/tests/main.nf.test.snap b/modules/nf-core/manta/convertinversion/tests/main.nf.test.snap new file mode 100644 index 0000000..0fba8d6 --- /dev/null +++ b/modules/nf-core/manta/convertinversion/tests/main.nf.test.snap @@ -0,0 +1,85 @@ +{ + "stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,d9a3c2c54bad36a8310d42eae3d57801" + ], + "tbi": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,d9a3c2c54bad36a8310d42eae3d57801" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-05-06T10:26:25.996091364" + }, + "homo_sapiens - vcf, fasta": { + "content": [ + [ + [ + { + "id": "test" + }, + [ + "##FILTER=", + "##ALT=", + "##ALT=", + "##ALT=", + "##ALT=" + ] + ] + ], + [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi" + ] + ], + [ + "versions.yml:md5,d9a3c2c54bad36a8310d42eae3d57801" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-05-06T13:34:11.206457972" + } +} \ No newline at end of file diff --git a/modules/nf-core/manta/convertinversion/tests/tags.yml b/modules/nf-core/manta/convertinversion/tests/tags.yml new file mode 100644 index 0000000..14d94b2 --- /dev/null +++ b/modules/nf-core/manta/convertinversion/tests/tags.yml @@ -0,0 +1,2 @@ +manta/convertinversion: + - "modules/nf-core/manta/convertinversion/**"