-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariant_filtering.nf
More file actions
executable file
·48 lines (44 loc) · 1.55 KB
/
variant_filtering.nf
File metadata and controls
executable file
·48 lines (44 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
process VariantFiltration {
label 'variant_calling'
publishDir "${params.output_dir}/vcf/filtered/", mode: 'copy', overwrite: true, pattern: "*snc*.vcf"
// publishDir "${params.output_dir}/vcf/filtered/rna_spades", mode: 'copy', overwrite: true, pattern: "*spades_*.vcf"
// publishDir "${params.output_dir}/vcf/filtered/Trinity-GG", mode: 'copy', overwrite: true, pattern: "*Trinity-GG_*.vcf"
input:
tuple val(sample_id), path(vcf)
path ref
path ref_fai
path ref_dict
output:
path "*.vcf"
script:
// Layout: [Filter Expression, Filtername]
def filter_options = [
["FS > 20", "FS20"]
["QUAL > 20", "FS20"]
]
def filtering_args = ""
filter_options.each { expr, name ->
filtering_args += "--genotype-filter-expression \"${expr}\" --genotype-filter-name \"${name}\" "
}
println ${filtering_args}
// TODO: Integrate the filtering args into the command block
"""
gatk --java-options '-Xmx4G -XX:+UseParallelGC -XX:ParallelGCThreads=4' VariantFiltration \
-R \$PWD/${ref} \
-I \$PWD/${vcf} \
-O \$PWD/${vcf.simpleName}_filtered.vcf \
${filtering_args}
"""
}
workflow VARIANT_PROCESSING {
take:
vcfs // Sample ID + vcfs
ref_auxillary
main:
haplotype_vcf = VariantFiltering(bam_split_n,
ref_auxillary.out.fai,
ref_auxillary.out.dict,
ref_auxillary.out.ref)
emit:
haplotype_vcf
}