Update bcftools/stats for WES (#1893)

update bcftools/stats
This commit is contained in:
SusiJo 2022-07-15 20:55:59 +02:00 committed by GitHub
parent 6720d88f4e
commit 535975eb81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 3 deletions

View file

@ -9,6 +9,7 @@ process BCFTOOLS_STATS {
input:
tuple val(meta), path(vcf)
path(target_bed)
output:
tuple val(meta), path("*stats.txt"), emit: stats
@ -20,8 +21,13 @@ process BCFTOOLS_STATS {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def target = target_bed ? "--regions-file ${target_bed}" : ""
"""
bcftools stats $args $vcf > ${prefix}.bcftools_stats.txt
bcftools stats \\
$args \\
$target \\
$vcf > ${prefix}.bcftools_stats.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')

View file

@ -19,6 +19,10 @@ input:
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- target_bed:
type: file
description: target bed file
pattern: "*.{bed}"
- vcf:
type: file
description: VCF input file
@ -40,3 +44,4 @@ output:
authors:
- "@joseespinosa"
- "@drpatelh"
- "@SusiJo"

View file

@ -6,8 +6,8 @@ include { BCFTOOLS_STATS } from '../../../../modules/bcftools/stats/main.nf'
workflow test_bcftools_stats {
input = [ [ id:'test' ], // meta map
[ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ]
[ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ],
]
BCFTOOLS_STATS ( input )
BCFTOOLS_STATS ( input, [] )
}