-
Notifications
You must be signed in to change notification settings - Fork 0
/
alignGenotypesToReference.nf
92 lines (77 loc) · 2.3 KB
/
alignGenotypesToReference.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include {
getChromosomes;
getHapmapGeneticMap;
getPlinkGeneticMap;
getEagleHapmapGeneticMap;
getShapeitGeneticMap;
getThousandGenomesReference;
getVcf;
splitVcfByChrom;
sortIndexVcf;
checkStrand;
concatVcfs;
beaglephase;
eaglePhaseWithoutRef;
eaglePhaseWithRef;
shapeitPhaseWithRef;
shapeitPhaseWithoutRef;
getVcfIndex;
removeDupVarsAndIndexVcf;
getVcfIndex as getPhasedVcfIndex;
getCostumReferencePanel;
getm3vcf;
getMinimacReference;
imputeVariantsWithMinimac4;
} from "${projectDir}/modules/phasing_and_imputation.nf"
include {
getPhasedVcf;
validateVcf;
} from "${projectDir}/modules/custom_panel.nf"
workflow {
if(params.autosome == true) {
getChromosomes()
.filter(Number)
.set { chromosome }
} else {
getChromosomes()
.set { chromosome }
}
getVcf()
.set { vcf }
chromosome
.combine(vcf)
.set { split_vcf_input }
getThousandGenomesReference()
.set { thousandGenomesReference }
getHapmapGeneticMap()
.set { geneticMap }
splitVcfByChrom(split_vcf_input)
.set { per_chr_vcf }
removeDupVarsAndIndexVcf(per_chr_vcf)
.set { vcf_fileset }
vcf_fileset
.map { chr, vcf, index -> tuple("${chr}", vcf, index) }
.set { vcfFileset }
vcfFileset
.map { chrom, vcfFile, vcfIndex -> tuple( "${chrom}", vcfFile, vcfIndex ) }
.join( thousandGenomesReference )
.join( geneticMap )
.set { checkstrand_input }
alignedVcfs = checkStrand( checkstrand_input ).map { chr, vcf, log -> tuple(chr, vcf) }
aligned_indexed_vcfs = getVcfIndex(alignedVcfs).map { chr, vcf, index -> tuple(vcf, index) }.collect()
concatVcfs(aligned_indexed_vcfs)
// getPlinkGeneticMap()
// .set { plinkGeneticMap }
// getEagleHapmapGeneticMap()
// .set { eagleGeneticMap }
//
// refPanel = getCostumReferencePanel()
// vcf_fileset.map { chr, vcf, index -> tuple("${chr}", vcf, index) }.set { vcfFileset }
// refPanel.map { chr, vcf, index -> tuple("${chr}", vcf, index) }.set { ref_panel }
// vcfFileset.join(ref_panel).set { phase_input }
// phase_input.join(plinkGeneticMap).set { impute_input }
//
// beaglephase(impute_input)
}