-
Notifications
You must be signed in to change notification settings - Fork 1
/
trimReads.nf
86 lines (75 loc) · 2.17 KB
/
trimReads.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
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include {
getInputFastqs;
} from "${projectDir}/modules/alignmentPipeline.nf"
include {
getNpAdapter;
getT3uAdapter;
getT2pAdapter;
getT3pAdapter;
getT2sAdapter;
getT3sAdapter;
trimgalore;
trimmomatic;
} from "${projectDir}/modules/getReadsQualityReports.nf"
workflow {
println "\nFastq trimming begins here\n"
fastq = getInputFastqs()
if(params.trimmer.toUpperCase() == 'TRIMMOMATIC') {
if(params.adapter.toUpperCase() == "NP") {
adapter = getNpAdapter()
fastq
.combine(adapter)
.set { trim_input }
}
else if(params.adapter.toUpperCase() == "T3U") {
adapter = getT3uAdapter()
fastq
.combine(adapter)
.set { trim_input }
}
else if(params.adapter.toUpperCase() == "T2P") {
adapter = getT2pAdapter()
fastq
.combine(adapter)
.set { trim_input }
}
else if(params.adapter.toUpperCase() == "T3P") {
adapter = getT3pAdapter()
fastq
.combine(adapter)
.set { trim_input }
}
else if(params.adapter.toUpperCase() == "T2S") {
adapter = getT2sAdapter()
fastq
.combine(adapter)
.set { trim_input }
}
else if(params.adapter.toUpperCase() == "T3S") {
adapter = getT3sAdapter()
fastq
.combine(adapter)
.set { trim_input }
}
else {
error: println """
Please select and adapter!
--------------------------
Options:
NP --> NexteraPE-PE.fa
T3U --> TruSeq3-PE-2.fa [Illumina universal]
T2P --> TruSeq2-PE.fa
T2S --> TruSeq2-SE.fa
T3P --> TruSeq3-PE.fa
T3S --> TruSeq3-SE.fa
Edit the config file or use '--adapter NP' on the command line
"""
}
trimmed_reads = trimmomatic(trim_input)
}
else {
trimmed = trimgalore(fastq)
}
}