mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-21 18:58:16 +00:00
parent
6720d88f4e
commit
535975eb81
3 changed files with 14 additions and 3 deletions
|
@ -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/ .*\$//')
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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, [] )
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue