-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.nf
56 lines (46 loc) · 1.7 KB
/
main.nf
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
56
#!/usr/bin/env nextflow
// Include modules
include { SAMTOOLS_INDEX } from './modules/local/samtools/index/main.nf'
include { GATK_HAPLOTYPECALLER } from './modules/local/gatk/haplotypecaller/main.nf'
include { GATK_JOINTGENOTYPING } from './modules/local/gatk/jointgenotyping/main.nf'
include { BCFTOOLS_STATS } from './modules/local/bcftools/stats/main.nf'
include { MULTIQC } from './modules/local/multiqc/multiqc/main.nf'
workflow {
// Create input channel from a text file listing input file paths
reads_ch = Channel.fromPath(params.reads_bam).splitText()
// Load the file paths for the accessory files (reference and intervals)
ref_file = file(params.reference)
ref_index_file = file(params.reference_index)
ref_dict_file = file(params.reference_dict)
intervals_file = file(params.intervals)
// Create index file for input BAM file
SAMTOOLS_INDEX(reads_ch)
// Call variants from the indexed BAM file
GATK_HAPLOTYPECALLER(
SAMTOOLS_INDEX.out.bam_bai,
ref_file,
ref_index_file,
ref_dict_file,
intervals_file
)
// Collect variant calling outputs across samples
all_gvcfs_ch = GATK_HAPLOTYPECALLER.out.vcf.collect()
all_idxs_ch = GATK_HAPLOTYPECALLER.out.idx.collect()
// Combine GVCFs into a GenomicsDB data store and apply joint genotyping
GATK_JOINTGENOTYPING(
all_gvcfs_ch,
all_idxs_ch,
intervals_file,
params.cohort_name,
ref_file,
ref_index_file,
ref_dict_file
)
BCFTOOLS_STATS(
GATK_JOINTGENOTYPING.out.vcf
)
MULTIQC(
BCFTOOLS_STATS.out.stats.collect(),
params.cohort_name
)
}