mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
New module/vcfanno (#1204)
* boilerplate * tests passed * fixed regex Co-authored-by: Chris Cheshire <chris.j.cheshire@gmail.com>
This commit is contained in:
parent
bb90e4fb78
commit
435ca4100a
6 changed files with 127 additions and 0 deletions
34
modules/vcfanno/main.nf
Normal file
34
modules/vcfanno/main.nf
Normal file
|
@ -0,0 +1,34 @@
|
|||
process VCFANNO {
|
||||
tag "$meta.id"
|
||||
label 'process_low'
|
||||
|
||||
conda (params.enable_conda ? "bioconda::vcfanno=0.3.3" : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/vcfanno:0.3.3--h9ee0642_0':
|
||||
'quay.io/biocontainers/vcfanno:0.3.3--h9ee0642_0' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(vcf), path(tbi)
|
||||
path vcfanno_config
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.vcf"), emit: vcf
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
script:
|
||||
def args = task.ext.args ?: ''
|
||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||
"""
|
||||
vcfanno \\
|
||||
-p $task.cpus \\
|
||||
$args \\
|
||||
$vcfanno_config \\
|
||||
$vcf \\
|
||||
> ${prefix}_annotated.vcf
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
vcfanno: \$(echo \$(vcfanno 2>&1 | grep version | cut -f3 -d' ' ))
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
56
modules/vcfanno/meta.yml
Normal file
56
modules/vcfanno/meta.yml
Normal file
|
@ -0,0 +1,56 @@
|
|||
name: vcfanno
|
||||
description: quickly annotate your VCF with any number of INFO fields from any number of VCFs or BED files
|
||||
keywords:
|
||||
- vcf
|
||||
- bed
|
||||
- annotate
|
||||
- variant
|
||||
tools:
|
||||
- vcfanno:
|
||||
description: annotate a VCF with other VCFs/BEDs/tabixed files
|
||||
homepage: None
|
||||
documentation: https://github.com/brentp/vcfanno#vcfanno
|
||||
tool_dev_url: https://github.com/brentp/vcfanno
|
||||
doi: "10.1186/s13059-016-0973-5"
|
||||
licence: ["MIT"]
|
||||
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- vcf:
|
||||
type: file
|
||||
description: query VCF file
|
||||
pattern: "*.{vcf.gz}"
|
||||
- vcf.tbi:
|
||||
type: file
|
||||
description: query VCF file index
|
||||
pattern: "*.{vcf.gz.tbi}"
|
||||
- vcfanno_config:
|
||||
type: file
|
||||
description: |
|
||||
A simple configuration file is used to specify both the source files
|
||||
and the set of attributes (in the case of VCF)
|
||||
or columns (in the case of BED or other tab-delimited formats)
|
||||
that should be added to the query file.
|
||||
pattern: "*.{toml}"
|
||||
|
||||
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: Annotated VCF file
|
||||
pattern: "*.{vcf}"
|
||||
|
||||
authors:
|
||||
- "@projectoriented"
|
|
@ -1493,6 +1493,10 @@ variantbam:
|
|||
- modules/variantbam/**
|
||||
- tests/modules/variantbam/**
|
||||
|
||||
vcfanno:
|
||||
- modules/vcfanno/**
|
||||
- tests/modules/vcfanno/**
|
||||
|
||||
vcflib/vcfuniq:
|
||||
- modules/vcflib/vcfuniq/**
|
||||
- tests/modules/vcflib/vcfuniq/**
|
||||
|
|
19
tests/modules/vcfanno/main.nf
Normal file
19
tests/modules/vcfanno/main.nf
Normal file
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { VCFANNO } from '../../../modules/vcfanno/main.nf'
|
||||
|
||||
workflow test_vcfanno {
|
||||
|
||||
input = [
|
||||
[ id:'test', single_end:false ], // meta map
|
||||
file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true),
|
||||
file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)
|
||||
]
|
||||
|
||||
toml = file("https://raw.githubusercontent.com/nf-core/test-datasets/8fbd9f99a2feb3f9e39cd3bcdc4a9176a5835673/data/delete_me/vcfanno.toml",
|
||||
checkIfExists: true)
|
||||
|
||||
VCFANNO ( input, toml )
|
||||
}
|
5
tests/modules/vcfanno/nextflow.config
Normal file
5
tests/modules/vcfanno/nextflow.config
Normal file
|
@ -0,0 +1,5 @@
|
|||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
}
|
9
tests/modules/vcfanno/test.yml
Normal file
9
tests/modules/vcfanno/test.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
- name: vcfanno test_vcfanno
|
||||
command: nextflow run tests/modules/vcfanno -entry test_vcfanno -c tests/config/nextflow.config
|
||||
tags:
|
||||
- vcfanno
|
||||
files:
|
||||
- path: output/vcfanno/test_annotated.vcf
|
||||
md5sum: 34259cf6b0a4698a2917ad3554b50c0f
|
||||
- path: output/vcfanno/versions.yml
|
||||
md5sum: 62d13540503b22f04a2280c91942cb03
|
Loading…
Reference in a new issue