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 <john.mesilaakso@gmail.com>
This commit is contained in:
Anders Jemt 2022-04-19 10:53:39 +02:00 committed by GitHub
parent c7def8707b
commit a6cb75174b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 11 deletions

View file

@ -9,6 +9,7 @@ process STRANGER {
input: input:
tuple val(meta), path(vcf) tuple val(meta), path(vcf)
path variant_catalog
output: output:
tuple val(meta), path("*.gz"), emit: vcf tuple val(meta), path("*.gz"), emit: vcf
@ -20,10 +21,12 @@ process STRANGER {
script: script:
def args = task.ext.args ?: '' def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}" def prefix = task.ext.prefix ?: "${meta.id}"
def options_variant_catalog = variant_catalog ? "--repeats-file $variant_catalog" : ""
""" """
stranger \\ stranger \\
$args \\ $args \\
$vcf | gzip --no-name > ${prefix}.vcf.gz $vcf \\
$options_variant_catalog | gzip --no-name > ${prefix}.vcf.gz
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml
"${task.process}": "${task.process}":

View file

@ -24,6 +24,10 @@ input:
type: file type: file
description: VCF with repeat expansions description: VCF with repeat expansions
pattern: "*.{vcf.gz,vcf}" pattern: "*.{vcf.gz,vcf}"
- variant_catalog:
type: file
description: json file with repeat expansion sites to genotype
pattern: "*.{json}"
output: output:
- meta: - meta:

View file

@ -5,7 +5,6 @@ nextflow.enable.dsl = 2
include { EXPANSIONHUNTER } from '../../../modules/expansionhunter/main.nf' include { EXPANSIONHUNTER } from '../../../modules/expansionhunter/main.nf'
include { STRANGER } from '../../../modules/stranger/main.nf' include { STRANGER } from '../../../modules/stranger/main.nf'
workflow test_stranger {
input = [ [ id:'test', gender:'male' ], // meta map 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'], checkIfExists: true),
@ -14,6 +13,13 @@ workflow test_stranger {
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], 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) variant_catalog = file(params.test_data['homo_sapiens']['genome']['repeat_expansions'], checkIfExists: true)
workflow test_stranger {
EXPANSIONHUNTER ( input, fasta, variant_catalog ) 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, [] )
} }

View file

@ -8,6 +8,20 @@
- path: output/expansionhunter/versions.yml - path: output/expansionhunter/versions.yml
md5sum: f3962a6eecfddf9682414c0f605a885a md5sum: f3962a6eecfddf9682414c0f605a885a
- path: output/stranger/test.vcf.gz - path: output/stranger/test.vcf.gz
md5sum: bbe15159195681d5c18596d3ad85c78f md5sum: 68b0ca1319851134ffa8793a4704dc11
- path: output/stranger/versions.yml - path: output/stranger/versions.yml
md5sum: 5ec35fd835fb1be50bc3e7c004310fc0 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