From a6cb75174bfbd131f3da14d8cd3e34c1a2e6e268 Mon Sep 17 00:00:00 2001 From: Anders Jemt Date: Tue, 19 Apr 2022 10:53:39 +0200 Subject: [PATCH] Add variant catalog ch to stranger (#1508) * Add optional variant catalog input * fix for no variant catalog test Co-authored-by: ljmesi <37740329+ljmesi@users.noreply.github.com> Co-authored-by: Lauri Mesilaakso --- modules/stranger/main.nf | 5 ++++- modules/stranger/meta.yml | 4 ++++ tests/modules/stranger/main.nf | 24 +++++++++++++++--------- tests/modules/stranger/test.yml | 16 +++++++++++++++- 4 files changed, 38 insertions(+), 11 deletions(-) diff --git a/modules/stranger/main.nf b/modules/stranger/main.nf index 2e647627..55678bd3 100644 --- a/modules/stranger/main.nf +++ b/modules/stranger/main.nf @@ -9,6 +9,7 @@ process STRANGER { input: tuple val(meta), path(vcf) + path variant_catalog output: tuple val(meta), path("*.gz"), emit: vcf @@ -20,10 +21,12 @@ process STRANGER { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def options_variant_catalog = variant_catalog ? "--repeats-file $variant_catalog" : "" """ stranger \\ $args \\ - $vcf | gzip --no-name > ${prefix}.vcf.gz + $vcf \\ + $options_variant_catalog | gzip --no-name > ${prefix}.vcf.gz cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/stranger/meta.yml b/modules/stranger/meta.yml index 61ebc7a9..0707d806 100644 --- a/modules/stranger/meta.yml +++ b/modules/stranger/meta.yml @@ -24,6 +24,10 @@ input: type: file description: VCF with repeat expansions pattern: "*.{vcf.gz,vcf}" + - variant_catalog: + type: file + description: json file with repeat expansion sites to genotype + pattern: "*.{json}" output: - meta: diff --git a/tests/modules/stranger/main.nf b/tests/modules/stranger/main.nf index bc4bd3ce..5bd6766b 100644 --- a/tests/modules/stranger/main.nf +++ b/tests/modules/stranger/main.nf @@ -5,15 +5,21 @@ nextflow.enable.dsl = 2 include { EXPANSIONHUNTER } from '../../../modules/expansionhunter/main.nf' include { STRANGER } from '../../../modules/stranger/main.nf' + +input = [ [ id:'test', gender:'male' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true), + ] +fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) +variant_catalog = file(params.test_data['homo_sapiens']['genome']['repeat_expansions'], checkIfExists: true) + + workflow test_stranger { - - input = [ [ id:'test', gender:'male' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true), - ] - fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - variant_catalog = file(params.test_data['homo_sapiens']['genome']['repeat_expansions'], checkIfExists: true) - EXPANSIONHUNTER ( input, fasta, variant_catalog ) - STRANGER ( EXPANSIONHUNTER.out.vcf ) + STRANGER ( EXPANSIONHUNTER.out.vcf, variant_catalog ) +} + +workflow test_stranger_without_optional_variant_catalog { + EXPANSIONHUNTER ( input, fasta, variant_catalog ) + STRANGER ( EXPANSIONHUNTER.out.vcf, [] ) } diff --git a/tests/modules/stranger/test.yml b/tests/modules/stranger/test.yml index 821928e8..c7a6972e 100644 --- a/tests/modules/stranger/test.yml +++ b/tests/modules/stranger/test.yml @@ -8,6 +8,20 @@ - path: output/expansionhunter/versions.yml md5sum: f3962a6eecfddf9682414c0f605a885a - path: output/stranger/test.vcf.gz - md5sum: bbe15159195681d5c18596d3ad85c78f + md5sum: 68b0ca1319851134ffa8793a4704dc11 - path: output/stranger/versions.yml md5sum: 5ec35fd835fb1be50bc3e7c004310fc0 + +- name: stranger test_stranger_without_optional_variant_catalog + command: nextflow run tests/modules/stranger -entry test_stranger_without_optional_variant_catalog -c tests/config/nextflow.config + tags: + - stranger + files: + - path: output/expansionhunter/test.vcf + md5sum: cfd4a1d35c0e469b99eb6aaa6d22de76 + - path: output/expansionhunter/versions.yml + md5sum: c95af9e6d8cd9bd2ce1090ca4e7a6020 + - path: output/stranger/test.vcf.gz + md5sum: bbe15159195681d5c18596d3ad85c78f + - path: output/stranger/versions.yml + md5sum: 8558542a007e90ea5dcdceed3f12585d