forked from nf-core/sarek
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathannotate.nf
More file actions
55 lines (45 loc) · 2.07 KB
/
annotate.nf
File metadata and controls
55 lines (45 loc) · 2.07 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
49
50
51
52
53
54
55
//
// ANNOTATION
//
include { ANNOTATION_SNPEFF } from '../nf-core/annotation/snpeff/main'
include { ANNOTATION_ENSEMBLVEP as ANNOTATION_MERGE } from '../nf-core/annotation/ensemblvep/main'
include { ANNOTATION_ENSEMBLVEP } from '../nf-core/annotation/ensemblvep/main'
workflow ANNOTATE {
take:
vcf // channel: [ val(meta), vcf ]
tools // Mandatory, list of tools to apply
snpeff_db
snpeff_cache
vep_genome
vep_species
vep_cache_version
vep_cache
vep_extra_files
main:
ch_reports = Channel.empty()
ch_vcf_ann = Channel.empty()
ch_versions = Channel.empty()
if (tools.contains('merge') || tools.contains('snpeff')) {
ANNOTATION_SNPEFF(vcf, snpeff_db, snpeff_cache)
ch_reports = ch_reports.mix(ANNOTATION_SNPEFF.out.reports)
ch_vcf_ann = ch_vcf_ann.mix(ANNOTATION_SNPEFF.out.vcf_tbi)
ch_versions = ch_versions.mix(ANNOTATION_SNPEFF.out.versions.first())
}
if (tools.contains('merge')) {
vcf_ann_for_merge = ANNOTATION_SNPEFF.out.vcf_tbi.map{ meta, vcf, tbi -> [meta, vcf] }
ANNOTATION_MERGE(vcf_ann_for_merge, vep_genome, vep_species, vep_cache_version, vep_cache, vep_extra_files)
ch_reports = ch_reports.mix(ANNOTATION_MERGE.out.reports)
ch_vcf_ann = ch_vcf_ann.mix(ANNOTATION_MERGE.out.vcf_tbi)
ch_versions = ch_versions.mix(ANNOTATION_MERGE.out.versions.first())
}
if (tools.contains('vep')) {
ANNOTATION_ENSEMBLVEP(vcf, vep_genome, vep_species, vep_cache_version, vep_cache, vep_extra_files)
ch_reports = ch_reports.mix(ANNOTATION_ENSEMBLVEP.out.reports)
ch_vcf_ann = ch_vcf_ann.mix(ANNOTATION_ENSEMBLVEP.out.vcf_tbi)
ch_versions = ch_versions.mix(ANNOTATION_ENSEMBLVEP.out.versions.first())
}
emit:
vcf_ann = ch_vcf_ann // channel: [ val(meta), vcf.gz, vcf.gz.tbi ]
reports = ch_reports // path: *.html
versions = ch_versions // path: versions.yml
}