-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqc.nf
71 lines (65 loc) · 1.79 KB
/
qc.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
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
//nextflow.enable.moduleBinaries = true
include {
jobCompletionMessage;
getBed;
checkDuplicateSampleIds;
removeDuplicateVars;
getKingFormatFile;
checkDuplicateAndRelatedIndivs;
checkDiscordantSex;
computeSampleMissingnesStats;
checkSamplesMissingess;
removePoorQualitySamples;
checkPoorQualityVariants;
checkPalindromes;
removePoorQualityVariants;
performPca;
plotPca;
} from "${projectDir}/modules/qc.mdl"
workflow {
println "\nGeneMAP GWAS QC WORKFLOW\n"
getBed()
.set { bed }
checkDuplicateSampleIds(bed)
.set { unique_samples }
removeDuplicateVars(bed, unique_samples)
.set { bfile }
getKingFormatFile(bfile)
.set { king_bed }
checkDuplicateAndRelatedIndivs(king_bed)
.set { king_out }
checkDiscordantSex(bfile, king_out)
.set { bed_related_removed }
computeSampleMissingnesStats(bed_related_removed)
.set { missingness }
checkSamplesMissingess(missingness)
.set { fail_missingness }
removePoorQualitySamples(bed_related_removed, fail_missingness)
.set { bed_pass_sample_qc }
checkPoorQualityVariants(bed_pass_sample_qc)
.set { bed_temp }
checkPalindromes(bed_temp)
.set { bed_palindromes }
removePoorQualityVariants(bed_palindromes)
.set { bed_pass_qc }
performPca(bed_pass_qc)
.set { evec_eval }
plotPca(evec_eval)
}
workflow.onComplete {
msg = jobCompletionMessage()
if(params.email == 'NULL') {
println msg
}
else {
println msg
sendMail(
from: '[email protected]',
to: params.email,
subject: 'genemapgwas qc execution status',
body: msg
)
}
}