mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2025-01-18 02:46:13 -05:00
added optional reference dictionary as input
This commit is contained in:
parent
3ac5c5fad6
commit
02abe106ec
6 changed files with 59 additions and 1 deletions
|
@ -20,6 +20,8 @@ process GATK4_MERGEVCFS {
|
|||
|
||||
input:
|
||||
tuple val(meta), path(vcfs)
|
||||
path(ref_dict)
|
||||
val use_ref_dict
|
||||
|
||||
output:
|
||||
tuple val(meta), path('*.vcf.gz') , emit: vcf
|
||||
|
@ -33,10 +35,12 @@ process GATK4_MERGEVCFS {
|
|||
for (vcf in vcfs) {
|
||||
input += " I=${vcf}"
|
||||
}
|
||||
def ref = use_ref_dict ? "D=${ref_dict}" : ""
|
||||
"""
|
||||
gatk MergeVcfs \\
|
||||
$input \\
|
||||
O=${prefix}.merged.vcf.gz \\
|
||||
$ref \\
|
||||
$options.args
|
||||
|
||||
gatk --version | grep Picard | sed "s/Picard Version: //g" > ${software}.version.txt
|
||||
|
|
|
@ -43,6 +43,13 @@ input:
|
|||
type: list
|
||||
description: Two or more VCF files
|
||||
pattern: "*.{vcf,vcf.gz}"
|
||||
- ref_dict:
|
||||
type: file
|
||||
description: Optional Sequence Dictionary as input
|
||||
pattern: "*.dict"
|
||||
- use_ref_dict:
|
||||
type: boolean
|
||||
description: Specify whether or not to use a given reference dictionary
|
||||
output:
|
||||
- vcf:
|
||||
type: file
|
||||
|
|
3
tests/data/fasta/test.consensus.for_vcf.dict
Normal file
3
tests/data/fasta/test.consensus.for_vcf.dict
Normal file
|
@ -0,0 +1,3 @@
|
|||
@HD VN:1.6
|
||||
@SQ SN:1 LN:500 M5:98994ca39b95ec4c96496f6aa8c5c118 UR:file:/Users/kevin/Documents/nfcore/modules/tests/data/fasta/test.consensus.fa
|
||||
@SQ SN:2 LN:501 M5:6cb9f5c857251ffe4420b42453dc9ca3 UR:file:/Users/kevin/Documents/nfcore/modules/tests/data/fasta/test.consensus.fa
|
20
tests/data/fasta/test.consensus.for_vcf.fa
Normal file
20
tests/data/fasta/test.consensus.for_vcf.fa
Normal file
|
@ -0,0 +1,20 @@
|
|||
>1
|
||||
TACcAtATgTgACAtATAAaAAAGAACATAACCTACGTATCAACTAAAGTGGTTGTTTG
|
||||
cAGAAAAGGAAGACTTAAAAAGAGTCAGTACTAACCTACATAATATATACAATGTTCATT
|
||||
AAATAATAAAATGAGCTCATCATACTTAGGTCATCATAAATATATCTGAAATTCACAAAT
|
||||
ATTGATCAAATGGTAAAATAGACAAGTAGATTTTAATAGGTTAAACAATTACTGATTCTC
|
||||
TTGAAAGAATAAATTTAATATGAGACCTATTTCATTATAATGAACTCACAAATTAGAAAC
|
||||
TTCACACTGGGGGCTGGAGAGATGGCTCAGTAGTTAAGAACACTGACTGCTCTTCTGAAG
|
||||
GTCCTGAGTTCAAATCCCAGCAACCACATGGTGACTTACAACCATCTGTAATGACATCTG
|
||||
ATGCCCTCTGGTGTGTCTGAAGACAGCTACAGTGTACTTACATAAAATAATAAATAAATC
|
||||
TTTAAAAACAAAAAAAAAGAA
|
||||
>2
|
||||
gaagatcttttccttattaaggatctgaagctctgtagatttgtattctattaaacatgg
|
||||
AgagattagtgattttccatattctttaagtcattttagagtaatgtgttcttaagatAa
|
||||
atcagaaaaacaaaaacttgtgctttcctgtttgaaaaacaaacagctgtggggaatgGt
|
||||
gtcgggacagcctttttatAaaatttttctaaataatgttgaggctttgatacgtcaaag
|
||||
ttatatttcaaatggaatcacttagacctcgtttctgagtgtcaatggccatattggggA
|
||||
tttgctgctgccaatgacaGcacaccctgggaatgccccaactacttactacaaagcagt
|
||||
gttacatggagaagatcttcaagagtctttttgctagatctttccttggcttttgatgtg
|
||||
actcctctcaataaaatccacagtaatatagtgagtggtctcctgctccaaaccagtatt
|
||||
Tcagacacagttaatccagac
|
|
@ -12,5 +12,20 @@ workflow test_gatk4_mergevcfs {
|
|||
file("${launchDir}/tests/data/vcf/test2.vcf.gz", checkIfExists: true),
|
||||
file("${launchDir}/tests/data/vcf/test3.vcf.gz", checkIfExists: true) ] ]
|
||||
|
||||
GATK4_MERGEVCFS ( input )
|
||||
ref_dict = file("tests/data/fasta/test.consensus.for_vcf.dict", checkIfExists: true)
|
||||
|
||||
GATK4_MERGEVCFS ( input, ref_dict, false )
|
||||
}
|
||||
|
||||
workflow test_gatk4_mergevcfs_refdict {
|
||||
|
||||
def input = []
|
||||
input = [ [ id:'test' ], // meta map
|
||||
[ file("${launchDir}/tests/data/vcf/test.vcf", checkIfExists: true),
|
||||
file("${launchDir}/tests/data/vcf/test2.vcf.gz", checkIfExists: true),
|
||||
file("${launchDir}/tests/data/vcf/test3.vcf.gz", checkIfExists: true) ] ]
|
||||
|
||||
ref_dict = file("tests/data/fasta/test.consensus.for_vcf.dict", checkIfExists: true)
|
||||
|
||||
GATK4_MERGEVCFS ( input, ref_dict, true )
|
||||
}
|
||||
|
|
|
@ -6,3 +6,12 @@
|
|||
files:
|
||||
- path: output/gatk4/test.merged.vcf.gz
|
||||
md5sum: f25850b7bd4d362b5ea67d4453e9df55
|
||||
|
||||
- name: gatk4 mergevcfs refdict
|
||||
command: nextflow run ./tests/software/gatk4/mergevcfs -entry test_gatk4_mergevcfs_refdict -c tests/config/nextflow.config
|
||||
tags:
|
||||
- gatk4
|
||||
- gatk4_mergevcfs
|
||||
files:
|
||||
- path: output/gatk4/test.merged.vcf.gz
|
||||
md5sum: f25850b7bd4d362b5ea67d4453e9df55
|
||||
|
|
Loading…
Add table
Reference in a new issue