Process Name | \\n\\", - " \\ Software | \\nVersion | \\n
---|---|---|
CUSTOM_DUMPSOFTWAREVERSIONS | \\npython | \\n\\", - " \\3.11.7 | \\n
\\n \\", - " \\ | yaml | \\n5.4.1 | \\n
TOOL1 | \\ntool1 | \\n\\", - " \\0.11.9 | \\n
TOOL2 | \\n\\", - " \\tool2 | \\n1.9 | \\n
Workflow | \\nNextflow | \\n\\" - ], - [ - "CUSTOM_DUMPSOFTWAREVERSIONS:", - " python: 3.11.7", - " yaml: 5.4.1", - "TOOL1:", - " tool1: 0.11.9", - "TOOL2:", - " tool2: '1.9'", - "Workflow:" - ] + { + "0": [ + "software_versions.yml:md5,1c851188476409cda5752ce971b20b58" + ], + "1": [ + "software_versions_mqc.yml:md5,2570f4ba271ad08357b0d3d32a9cf84d" + ], + "2": [ + "versions.yml:md5,3843ac526e762117eedf8825b40683df" + ], + "mqc_yml": [ + "software_versions_mqc.yml:md5,2570f4ba271ad08357b0d3d32a9cf84d" + ], + "versions": [ + "versions.yml:md5,3843ac526e762117eedf8825b40683df" + ], + "yml": [ + "software_versions.yml:md5,1c851188476409cda5752ce971b20b58" + ] + } ], - "timestamp": "2024-01-09T23:01:18.710682" + "timestamp": "2023-11-03T14:43:22.157011" } -} \ No newline at end of file +} diff --git a/modules/nf-core/manta/convertinversion/main.nf b/modules/nf-core/manta/convertinversion/main.nf new file mode 100644 index 0000000..9010c3c --- /dev/null +++ b/modules/nf-core/manta/convertinversion/main.nf @@ -0,0 +1,36 @@ +process MANTA_CONVERTINVERSION { + tag "$meta.id" + label 'process_single' + label 'error_retry' + + conda "bioconda::manta=1.6.0 bioconda::samtools=1.16.1" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-40295ae41112676b05b649e513fe7000675e9b84:a0332aa38645fbb8969567731ce68cfb7f830ec4-0': + 'quay.io/biocontainers/mulled-v2-40295ae41112676b05b649e513fe7000675e9b84:a0332aa38645fbb8969567731ce68cfb7f830ec4-0' }" + + input: + tuple val(meta),val(meta2), path(vcf), path(index) + tuple path(fasta), path(fai) + + output: + tuple val(meta),val(meta2), path("*.vcf.gz"),path("*.vcf.gz.tbi") , emit: vcf_tabi + 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}" + """ + convertInversion.py \$(which samtools) $fasta $vcf | bgzip --threads $task.cpus > ${prefix}.converted.vcf.gz + tabix ${prefix}.converted.vcf.gz + + 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 new file mode 100644 index 0000000..cf9e169 --- /dev/null +++ b/modules/nf-core/manta/convertinversion/meta.yml @@ -0,0 +1,46 @@ +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. +keywords: + - structural variants + - conversion + - indels +tools: + - manta: + description: Structural variant and indel caller for mapped sequencing data + homepage: https://github.com/Illumina/manta + documentation: https://github.com/Illumina/manta/blob/v1.6.0/docs/userGuide/README.md + tool_dev_url: https://github.com/Illumina/manta + doi: "10.1093/bioinformatics/btv710" + licence: ["GPL v3"] + +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" + +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" + - tbi: + type: file + description: TBI file produces by Manta + pattern: "*.vcf.gz.tbi" +authors: + - "@FriederikeHanssen" diff --git a/modules/nf-core/multiqc/environment.yml b/modules/nf-core/multiqc/environment.yml index 7625b75..e5e14e8 100644 --- a/modules/nf-core/multiqc/environment.yml +++ b/modules/nf-core/multiqc/environment.yml @@ -1,7 +1,7 @@ -name: multiqc +name: MultiQC channels: - conda-forge - bioconda - defaults dependencies: - - bioconda::multiqc=1.19 + - bioconda::multiqc=1.17 diff --git a/modules/nf-core/multiqc/main.nf b/modules/nf-core/multiqc/main.nf index 1b9f7c4..a908c80 100644 --- a/modules/nf-core/multiqc/main.nf +++ b/modules/nf-core/multiqc/main.nf @@ -3,8 +3,8 @@ process MULTIQC { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/multiqc:1.19--pyhdfd78af_0' : - 'biocontainers/multiqc:1.19--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/multiqc:1.17--pyhdfd78af_0' : + 'quay.io/biocontainers/multiqc:1.17--pyhdfd78af_0' }" input: path multiqc_files, stageAs: "?/*" @@ -25,14 +25,12 @@ process MULTIQC { def args = task.ext.args ?: '' def config = multiqc_config ? "--config $multiqc_config" : '' def extra_config = extra_multiqc_config ? "--config $extra_multiqc_config" : '' - def logo = multiqc_logo ? /--cl-config 'custom_logo: "${multiqc_logo}"'/ : '' """ multiqc \\ --force \\ $args \\ $config \\ $extra_config \\ - $logo \\ . cat <<-END_VERSIONS > versions.yml @@ -43,7 +41,7 @@ process MULTIQC { stub: """ - mkdir multiqc_data + touch multiqc_data touch multiqc_plots touch multiqc_report.html diff --git a/modules/nf-core/multiqc/meta.yml b/modules/nf-core/multiqc/meta.yml index 45a9bc3..a61223e 100644 --- a/modules/nf-core/multiqc/meta.yml +++ b/modules/nf-core/multiqc/meta.yml @@ -1,4 +1,5 @@ -name: multiqc +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json +name: MultiQC description: Aggregate results from bioinformatics analyses across many samples into a single report keywords: - QC diff --git a/modules/nf-core/survivor/filter/environment.yml b/modules/nf-core/survivor/filter/environment.yml new file mode 100644 index 0000000..56839ce --- /dev/null +++ b/modules/nf-core/survivor/filter/environment.yml @@ -0,0 +1,7 @@ +name: survivor_filter +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::survivor=1.0.7 diff --git a/modules/nf-core/survivor/filter/main.nf b/modules/nf-core/survivor/filter/main.nf new file mode 100644 index 0000000..d9c2557 --- /dev/null +++ b/modules/nf-core/survivor/filter/main.nf @@ -0,0 +1,64 @@ +process SURVIVOR_FILTER { + tag "$meta.id $meta2.caller" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/survivor:1.0.7--h9a82719_1': + 'quay.io/biocontainers/survivor:1.0.7--h9a82719_1' }" + + input: + tuple val(meta),val(meta2), path(vcf_file), path(bed) // VCF file to filter and BED file with regions to ignore (NA to disable) + val(minsv) // Min SV size (-1 to disable) + val(maxsv) // Max SV size (-1 to disable) + val(minallelefreq) // Min allele frequency (0-1) + val(minnumreads) // Min number of reads support: RE flag (-1 to disable) + + output: + tuple val(meta),val(meta2), path("*.vcf"), emit: vcf + 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 bed_file = bed ? "${bed}" : "NA" + + if( "$vcf_file" == "${prefix}.vcf" ){ + error "Input and output names are the same, set prefix in module configuration to disambiguate!" + } + """ + SURVIVOR \\ + filter \\ + $vcf_file \\ + $bed_file \\ + $minsv \\ + $maxsv \\ + $minallelefreq \\ + $minnumreads \\ + ${prefix}.vcf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + survivor: \$(echo \$(SURVIVOR 2>&1 | grep "Version" | sed 's/^Version: //')) + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + def bed_file = bed ? "${bed}" : "NA" + + if( "$vcf_file" == "${prefix}.vcf" ){ + error "Input and output names are the same, set prefix in module configuration to disambiguate!" + } + + """ + touch ${prefix}.vcf + cat <<-END_VERSIONS > versions.yml + "${task.process}": + survivor: \$(echo \$(SURVIVOR 2>&1 | grep "Version" | sed 's/^Version: //')) + END_VERSIONS + """ +} diff --git a/modules/nf-core/survivor/filter/meta.yml b/modules/nf-core/survivor/filter/meta.yml new file mode 100644 index 0000000..4cb2905 --- /dev/null +++ b/modules/nf-core/survivor/filter/meta.yml @@ -0,0 +1,58 @@ +name: "survivor_filter" +description: Filter a vcf file based on size and/or regions to ignore +keywords: + - survivor + - filter + - vcf + - structural variants +tools: + - "survivor": + description: "Toolset for SV simulation, comparison and filtering" + homepage: "https://github.com/fritzsedlazeck/SURVIVOR/wiki" + documentation: "https://github.com/fritzsedlazeck/SURVIVOR/wiki" + tool_dev_url: "https://github.com/fritzsedlazeck/SURVIVOR" + doi: "10.1038/NCOMMS14061" + licence: "['MIT']" +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: VCF file to filter + pattern: "*.{vcf}" + - bed: + type: file + description: BED file with regions to ignore (NA to disable) + - minsv: + type: integer + description: Min SV size (-1 to disable) + - maxsv: + type: integer + description: Max SV size (-1 to disable) + - minallelefreq: + type: float + description: Min allele frequency (0-1) + - minnumreads: + type: integer + description: Min number of reads support [RE flag (-1 to disable)] +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: Filtered VCF file + pattern: "*.{vcf}" +authors: + - "@LlaneroHiboreo" +maintainers: + - "@LlaneroHiboreo" diff --git a/modules/nf-core/survivor/stats/environment.yml b/modules/nf-core/survivor/stats/environment.yml new file mode 100644 index 0000000..4f64007 --- /dev/null +++ b/modules/nf-core/survivor/stats/environment.yml @@ -0,0 +1,7 @@ +name: survivor_stats +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::survivor=1.0.7 diff --git a/modules/nf-core/survivor/stats/main.nf b/modules/nf-core/survivor/stats/main.nf new file mode 100644 index 0000000..528e94c --- /dev/null +++ b/modules/nf-core/survivor/stats/main.nf @@ -0,0 +1,54 @@ +process SURVIVOR_STATS { + tag "$meta.id $meta2.caller" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/survivor:1.0.7--h9a82719_1': + 'quay.io/biocontainers/survivor:1.0.7--h9a82719_1' }" + + input: + tuple val(meta),val(meta2), path(vcf), path(index) + val(minsv) // Min SV size (-1 to disable) + val(maxsv) // Max SV size (-1 to disable) + val(minnumreads) // Min number of reads support: RE flag (-1 to disable) + + output: + tuple val(meta),val(meta2), path("*.stats"), emit: stats + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def prefix = task.ext.prefix ?: "${meta.id}" + def name = vcf.getBaseName() + + """ + gzip -d $vcf + + SURVIVOR \\ + stats \\ + $name \\ + $minsv \\ + $maxsv \\ + $minnumreads \\ + ${prefix}.stats + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + survivor: \$(echo \$(SURVIVOR 2>&1 | grep "Version" | sed 's/^Version: //')) + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + touch ${prefix}.stats + cat <<-END_VERSIONS > versions.yml + "${task.process}": + survivor: \$(echo \$(SURVIVOR 2>&1 | grep "Version" | sed 's/^Version: //')) + END_VERSIONS + """ +} diff --git a/modules/nf-core/survivor/stats/meta.yml b/modules/nf-core/survivor/stats/meta.yml new file mode 100644 index 0000000..ba450a7 --- /dev/null +++ b/modules/nf-core/survivor/stats/meta.yml @@ -0,0 +1,52 @@ +name: "survivor_stats" +description: Report multipe stats over a VCF file +keywords: + - survivor + - statistics + - vcf + - structural variants +tools: + - "survivor": + description: "Toolset for SV simulation, comparison and filtering" + homepage: "https://github.com/fritzsedlazeck/SURVIVOR/wiki" + documentation: "https://github.com/fritzsedlazeck/SURVIVOR/wiki" + tool_dev_url: "https://github.com/fritzsedlazeck/SURVIVOR" + doi: "10.1038/NCOMMS14061" + licence: ["MIT"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: VCF file to filter + pattern: "*.{vcf}" + - minsv: + type: integer + description: Min SV size (-1 to disable) + - maxsv: + type: integer + description: Max SV size (-1 to disable) + - minnumreads: + type: integer + description: Min number of reads support [RE flag (-1 to disable)] +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" + - stats: + type: file + description: File containing statistics given input VCF file + pattern: "*.{stats}" +authors: + - "@kubranarci" +maintainers: + - "@kubranarci" diff --git a/modules/nf-core/survivor/stats/tests/main.nf.test b/modules/nf-core/survivor/stats/tests/main.nf.test new file mode 100644 index 0000000..e83df57 --- /dev/null +++ b/modules/nf-core/survivor/stats/tests/main.nf.test @@ -0,0 +1,71 @@ +// nf-core modules test survivor/stats +nextflow_process { + + name "Test Process SURVIVOR_STATS" + script "../main.nf" + process "SURVIVOR_STATS" + + tag "modules" + tag "modules_nfcore" + tag "survivor" + tag "survivor/stats" + + test("homo_sapiens - haplotc - vcfgz") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_vcf_gz'], checkIfExists: true) + ] + input[1] = -1 + input[2] = -1 + input[3] = -1 + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.stats, + process.out.versions + ).match() } + ) + } + + } + + test("homo_sapiens - mutect - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_mutect2_calls_vcf_gz'], checkIfExists: true) + ] + input[1] = -1 + input[2] = -1 + input[3] = -1 + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.stats, + process.out.versions + ).match() } + ) + } + + } + +} diff --git a/modules/nf-core/survivor/stats/tests/main.nf.test.snap b/modules/nf-core/survivor/stats/tests/main.nf.test.snap new file mode 100644 index 0000000..d629dfc --- /dev/null +++ b/modules/nf-core/survivor/stats/tests/main.nf.test.snap @@ -0,0 +1,34 @@ +{ + "homo_sapiens - haplotc - vcfgz": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.stats:md5,023a37c7d6fab374c9bdcf98c011022c" + ] + ], + [ + "versions.yml:md5,35bf44775e74ffec88173cd2093c2928" + ] + ], + "timestamp": "2024-01-15T15:37:42.562568997" + }, + "homo_sapiens - mutect - stub": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + [ + "versions.yml:md5,35bf44775e74ffec88173cd2093c2928" + ] + ], + "timestamp": "2024-01-15T15:27:09.132671858" + } +} \ No newline at end of file diff --git a/modules/nf-core/survivor/stats/tests/tags.yml b/modules/nf-core/survivor/stats/tests/tags.yml new file mode 100644 index 0000000..762cebe --- /dev/null +++ b/modules/nf-core/survivor/stats/tests/tags.yml @@ -0,0 +1,2 @@ +survivor/stats: + - "modules/nf-core/survivor/stats/**" diff --git a/modules/nf-core/svanalyzer/svbenchmark/environment.yml b/modules/nf-core/svanalyzer/svbenchmark/environment.yml new file mode 100644 index 0000000..12cac54 --- /dev/null +++ b/modules/nf-core/svanalyzer/svbenchmark/environment.yml @@ -0,0 +1,10 @@ +name: svanalyzer_svbenchmark + +channels: + - conda-forge + - bioconda + - defaults + +dependencies: + - bioconda::edlib=1.2.3 + - bioconda::svanalyzer=0.35 diff --git a/modules/nf-core/svanalyzer/svbenchmark/main.nf b/modules/nf-core/svanalyzer/svbenchmark/main.nf new file mode 100644 index 0000000..afbcd9b --- /dev/null +++ b/modules/nf-core/svanalyzer/svbenchmark/main.nf @@ -0,0 +1,65 @@ + +process SVANALYZER_SVBENCHMARK { + tag "$meta.id $meta2.caller" + label 'process_medium' + + conda "bioconda::svanalyzer=0.35" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/svanalyzer:0.35--pl526_0': + 'quay.io/biocontainers/svanalyzer:0.35--pl526_0' }" + + input: + tuple val(meta),val(meta2), path(test), path(test_index), path(truth), path(truth_index), path(bed) + tuple path(fasta), path(fai) + + output: + tuple val(meta),val(meta2), path("*.falsenegatives.vcf"), emit: fns + tuple val(meta),val(meta2), path("*.falsepositives.vcf"), emit: fps + tuple val(meta),val(meta2), path("*.distances") , emit: distances + tuple val(meta),val(meta2), path("*.log") , emit: log + tuple val(meta),val(meta2), path("*.report") , emit: report + 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 bed = bed ? "-includebed $bed" : "" + def VERSION = '0.35' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + + """ + svanalyzer \\ + benchmark \\ + $args \\ + --ref $fasta \\ + --test $test \\ + --truth $truth \\ + --prefix $prefix \\ + $bed + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + svanalyzer: ${VERSION} + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '0.35' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + + """ + touch ${prefix}.falsenegatives.vcf + touch ${prefix}.falsepositives.vcf + touch ${prefix}.distances + touch ${prefix}.log + touch ${prefix}.report + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + svanalyzer: ${VERSION} + END_VERSIONS + """ +} diff --git a/modules/nf-core/svanalyzer/svbenchmark/meta.yml b/modules/nf-core/svanalyzer/svbenchmark/meta.yml new file mode 100644 index 0000000..ba72c3d --- /dev/null +++ b/modules/nf-core/svanalyzer/svbenchmark/meta.yml @@ -0,0 +1,80 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json +name: "svanalyzer_svbenchmark" +description: "SVbenchmark compares a set of “test” structural variants in VCF format to a known truth set (also in VCF format) and outputs estimates of sensitivity and specificity." +keywords: + - structural variant + - sv + - benchmarking +tools: + - "svanalyzer": + description: "SVanalyzer: tools for the analysis of structural variation in genomes" + homepage: "https://svanalyzer.readthedocs.io/en/latest/index.html" + documentation: "https://svanalyzer.readthedocs.io/en/latest/index.html" + tool_dev_url: "https://github.com/nhansen/SVanalyzer" + license: "['CC0']" + +input: + - meta: + type: map + description: | + Groovy Map containing test sample information + e.g. `[ id:'test' ]` + - meta2: + type: map + description: | + Groovy Map containing truth sample information + e.g. `[ id:'test2' ]` + - meta3: + type: map + description: | + Groovy Map containing reference genome information + e.g. `[ id:'test3' ]` + - test: + type: file + description: A VCF-formatted file of structural variants to test (required) + pattern: "*.{vcf,vcf.gz}" + - truth: + type: file + description: A VCF-formatted file of variants to compare against (required) + pattern: "*.{vcf,vcf.gz}" + - fasta: + type: file + description: The reference FASTA file for the supplied VCF file or files (required) + pattern: "*.{fa,fasta,fa.gz,fasta.gz}" + - bed: + type: file + description: BED File of regions from which to include variants. Used to filter both test and truth variants. + pattern: "*.{bed}" +output: + - meta: + type: map + description: | + Groovy Map containing sample information inherited from test vcf + e.g. `[ id:'test']` + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - fns: + type: file + description: VCF file with False Negatives + pattern: "*.{vcf}" + - fps: + type: file + description: VCF file with False Positives + pattern: "*.{vcf}" + - distances: + type: file + description: TSV file with genomic distances and size differences between structural variants compared + pattern: "*.{distances}" + - log: + type: file + description: LOG file of the run + pattern: "*.{log}" + - report: + type: file + description: Text file reporting RECALL, PRECISION and F1. + pattern: "*.{log}" +authors: + - "@kubranarci" diff --git a/modules/nf-core/svanalyzer/svbenchmark/tests/main.nf.test b/modules/nf-core/svanalyzer/svbenchmark/tests/main.nf.test new file mode 100644 index 0000000..51466f7 --- /dev/null +++ b/modules/nf-core/svanalyzer/svbenchmark/tests/main.nf.test @@ -0,0 +1,85 @@ +nextflow_process { + + name "Test Process SVANALYZER_SVBENCHMARK" + script "../main.nf" + process "SVANALYZER_SVBENCHMARK" + tag "modules" + tag "modules_nfcore" + tag "svanalyzer" + tag "svanalyzer/svbenchmark" + + test("homo_sapiens - illumina - vcf.gz") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_mutect2_calls_vcf_gz'], checkIfExists: true) + ] + input[1] = [ + [ id:'test2' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_vcf_gz'], checkIfExists: true) + ] + input[2] = [ + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[3] = [ + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] + input[4] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.fns).match("fns") }, + { assert snapshot(process.out.fps).match("fps") }, + { assert snapshot(process.out.distances).match("distances") }, + { assert snapshot(process.out.report).match("report") }, + { assert snapshot(process.out.versions).match("versions") } + ) + } + + } + + test("homo_sapiens - illumina - vcf.gz - bed") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_mutect2_calls_vcf_gz'], checkIfExists: true) + ] + input[1] = [ + [ id:'test2' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_vcf_gz'], checkIfExists: true) + ] + input[2] = [ + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[3] = [ + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] + input[4] = [ + file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.fns).match("bed_fns") }, + { assert snapshot(process.out.fps).match("bed_fps") }, + { assert snapshot(process.out.distances).match("bed_distances") }, + { assert snapshot(process.out.report).match("bed_report") }, + { assert snapshot(process.out.versions).match("bed_versions") } + ) + } + } +} \ No newline at end of file diff --git a/modules/nf-core/svanalyzer/svbenchmark/tests/main.nf.test.snap b/modules/nf-core/svanalyzer/svbenchmark/tests/main.nf.test.snap new file mode 100644 index 0000000..599697d --- /dev/null +++ b/modules/nf-core/svanalyzer/svbenchmark/tests/main.nf.test.snap @@ -0,0 +1,188 @@ +{ + "homo_sapiens - illumina - vcf.gz": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.falsenegatives.vcf:md5,7a574ad3c614f0c38a6dccb5901ddc05" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.falsepositives.vcf:md5,146f05125330a9c0c4581a5a581744a7" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "test.distances:md5,b6a908b1187f159429dc8c6beb6e6f57" + ] + ], + "3": [ + [ + { + "id": "test" + }, + "test.log:md5,16fd250ae2adcb07c8f101f640fdce81" + ] + ], + "4": [ + [ + { + "id": "test" + }, + "test.report:md5,d0c7db2466442cbdd4f87ad516e00d32" + ] + ], + "5": [ + "versions.yml:md5,6ac08491dbe591d24615c131658cf771" + ], + "distances": [ + [ + { + "id": "test" + }, + "test.distances:md5,b6a908b1187f159429dc8c6beb6e6f57" + ] + ], + "fns": [ + [ + { + "id": "test" + }, + "test.falsenegatives.vcf:md5,7a574ad3c614f0c38a6dccb5901ddc05" + ] + ], + "fps": [ + [ + { + "id": "test" + }, + "test.falsepositives.vcf:md5,146f05125330a9c0c4581a5a581744a7" + ] + ], + "log": [ + [ + { + "id": "test" + }, + "test.log:md5,16fd250ae2adcb07c8f101f640fdce81" + ] + ], + "report": [ + [ + { + "id": "test" + }, + "test.report:md5,d0c7db2466442cbdd4f87ad516e00d32" + ] + ], + "versions": [ + "versions.yml:md5,6ac08491dbe591d24615c131658cf771" + ] + } + ], + "timestamp": "2023-11-24T15:28:29.422156227" + }, + "homo_sapiens - illumina - vcf.gz - bed": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.falsenegatives.vcf:md5,c04105833d5f9acb5ec50af0b89a6b0f" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.falsepositives.vcf:md5,146f05125330a9c0c4581a5a581744a7" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "test.distances:md5,95f7b1679e805979f0c9a4a322cb77f4" + ] + ], + "3": [ + [ + { + "id": "test" + }, + "test.log:md5,75f05aac48afd818f2d5e8a3144116ea" + ] + ], + "4": [ + [ + { + "id": "test" + }, + "test.report:md5,aaa9225dd6e261951c020e23473375b9" + ] + ], + "5": [ + "versions.yml:md5,6ac08491dbe591d24615c131658cf771" + ], + "distances": [ + [ + { + "id": "test" + }, + "test.distances:md5,95f7b1679e805979f0c9a4a322cb77f4" + ] + ], + "fns": [ + [ + { + "id": "test" + }, + "test.falsenegatives.vcf:md5,c04105833d5f9acb5ec50af0b89a6b0f" + ] + ], + "fps": [ + [ + { + "id": "test" + }, + "test.falsepositives.vcf:md5,146f05125330a9c0c4581a5a581744a7" + ] + ], + "log": [ + [ + { + "id": "test" + }, + "test.log:md5,75f05aac48afd818f2d5e8a3144116ea" + ] + ], + "report": [ + [ + { + "id": "test" + }, + "test.report:md5,aaa9225dd6e261951c020e23473375b9" + ] + ], + "versions": [ + "versions.yml:md5,6ac08491dbe591d24615c131658cf771" + ] + } + ], + "timestamp": "2023-11-24T15:29:05.547215282" + } +} \ No newline at end of file diff --git a/modules/nf-core/svanalyzer/svbenchmark/tests/tags.yml b/modules/nf-core/svanalyzer/svbenchmark/tests/tags.yml new file mode 100644 index 0000000..2a3bc9c --- /dev/null +++ b/modules/nf-core/svanalyzer/svbenchmark/tests/tags.yml @@ -0,0 +1,2 @@ +svanalyzer/svbenchmark: + - "modules/nf-core/svanalyzer/svbenchmark/**" diff --git a/modules/nf-core/svync/environment.yml b/modules/nf-core/svync/environment.yml new file mode 100644 index 0000000..fb7a1db --- /dev/null +++ b/modules/nf-core/svync/environment.yml @@ -0,0 +1,9 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +name: "svync" +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - "bioconda::svync=0.1.2" diff --git a/modules/nf-core/svync/main.nf b/modules/nf-core/svync/main.nf new file mode 100644 index 0000000..d28e526 --- /dev/null +++ b/modules/nf-core/svync/main.nf @@ -0,0 +1,40 @@ +process SVYNC { + tag "$meta.id" + label 'process_low' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/svync:0.1.2--h9ee0642_0': + 'quay.io/biocontainers/svync:0.1.2--h9ee0642_0' }" + + input: + tuple val(meta),val(meta2), path(vcf), path(tbi), path(config) + + output: + tuple val(meta),val(meta2), path("*.vcf.gz"), path("*.vcf.gz.tbi"), 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}" + + if ("$vcf" == "${prefix}.vcf.gz") error "Input and output names are the same, set prefix in module configuration to disambiguate!" + + """ + svync \\ + $args \\ + --config $config \\ + --input $vcf \\ + | bgzip --threads $task.cpus $args2 > ${prefix}.vcf.gz + + tabix ${prefix}.vcf.gz + cat <<-END_VERSIONS > versions.yml + "${task.process}": + svync: \$(svync --version | sed 's/svync version //') + END_VERSIONS + """ +} diff --git a/modules/nf-core/svync/meta.yml b/modules/nf-core/svync/meta.yml new file mode 100644 index 0000000..3846ae2 --- /dev/null +++ b/modules/nf-core/svync/meta.yml @@ -0,0 +1,59 @@ +--- +name: "svync" +description: A tool to standardize VCF files from structural variant callers +keywords: + - structural variants + - vcf + - standardization + - standardize + - sv +tools: + - "svync": + description: "A tool to standardize VCF files from structural variant callers" + homepage: "https://github.com/nvnieuwk/svync" + documentation: "https://github.com/nvnieuwk/svync" + tool_dev_url: "https://github.com/nvnieuwk/svync" + licence: ["MIT"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - vcf: + type: file + description: The input VCF file containing structural variants + pattern: "*.{vcf,vcf.gz}" + - tbi: + type: file + description: The index of the input VCF file containing structural variants + pattern: "*.tbi" + - meta2: + type: map + description: | + Groovy Map containing config meta information + - config: + type: file + description: The config stating how the standardization should happen + pattern: "*.{yml,yaml}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - vcf: + type: file + description: The standardized VCF file + pattern: "*.vcf.gz" + +authors: + - "@nvnieuwk" +maintainers: + - "@nvnieuwk" diff --git a/modules/nf-core/svync/tests/main.nf.test b/modules/nf-core/svync/tests/main.nf.test new file mode 100644 index 0000000..cc618f9 --- /dev/null +++ b/modules/nf-core/svync/tests/main.nf.test @@ -0,0 +1,84 @@ +nextflow_process { + + name "Test Process SVYNC" + script "../main.nf" + process "SVYNC" + + tag "modules" + tag "modules_nfcore" + tag "svync" + + test("sarscov2 - vcf, config") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['simulated_sv'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['simulated_sv_tbi'], checkIfExists: true) + ] + + input[1] = Channel.of([ + "config.yaml", + "info:", + " SVMETHOD:", + " value: svync", + " description: Type of approach used to detect SV", + " number: 1", + " type: string", + "format:", + " GT:", + " value: 1/1", + " description: Genotype", + " number: 1", + " type: string" + ]) + .collectFile(newLine:true, sort:'index') + .map { [[], it] } + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf[0][0], + path(process.out.vcf[0][1]).linesGzip[20..30] + ).match() } + ) + } + + } + + test("sarscov2 - vcf, config - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['simulated_sv'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['simulated_sv_tbi'], checkIfExists: true) + ] + + input[1] = Channel.of(["config.yaml", "info:", " SVMETHOD:", " value: svync", " description: Type of approach used to detect SV", " number: 1", " type: string"]) + .collectFile(newLine:true, sort:'index') + .map { [[], it] } + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/svync/tests/main.nf.test.snap b/modules/nf-core/svync/tests/main.nf.test.snap new file mode 100644 index 0000000..a951b8a --- /dev/null +++ b/modules/nf-core/svync/tests/main.nf.test.snap @@ -0,0 +1,55 @@ +{ + "sarscov2 - vcf, config": { + "content": [ + { + "id": "test", + "single_end": false + }, + [ + "chr21\t6279548\t_2\tN\t