-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.nf
140 lines (96 loc) · 4.43 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
nextflow.enable.dsl = 2
include { FASTQC as FASTQC_UNTRIMMED } from "./modules/fastqc/fastqc.nf" addParams(resultsDir: "${params.outdir}/fastqc_untrimmed")
include { FASTQC as FASTQC_TRIMMED } from "./modules/fastqc/fastqc.nf" addParams(resultsDir: "${params.outdir}/fastqc_trimmed")
include { MULTIQC as MULTIQC_TRIMMED } from "./modules/multiqc/multiqc.nf" addParams(resultsDir: "${params.outdir}/multiqc_trimmed", fastqcResultsDir: "${params.outdir}/fastqc_trimmed")
include { MULTIQC as MULTIQC_UNTRIMMED } from "./modules/multiqc/multiqc.nf" addParams(resultsDir: "${params.outdir}/multiqc_untrimmed", fastqcResultsDir: "${params.outdir}/fastqc_untrimmed")
include { MTBSEQ_PER_SAMPLE } from "./modules/mtbseq/mtbseq_per_sample.nf"
include { MTBSEQ_COHORT } from "./modules/mtbseq/mtbseq_cohort.nf"
include { MULTIQC } from "./modules/multiqc/multiqc.nf"
include { PROKKA } from "./modules/prokka/prokka.nf"
include { RDANALYZER } from "./modules/rdanalyzer/rdanalyzer.nf"
include { SPADES } from "./modules/spades/spades.nf"
include { SPOTYPING } from "./modules/spotyping/spotyping.nf"
include { QUAST } from "./modules/quast/quast.nf"
include { TBPROFILER_PROFILE; TBPROFILER_COLLATE } from "./modules/tbprofiler/tbprofiler.nf"
include { TRIMMOMATIC } from "./modules/trimmomatic/trimmomatic.nf"
workflow {
reads_ch = Channel.fromFilePairs(params.reads)
env_user_ch = Channel.value("root")
FASTQC_UNTRIMMED(reads_ch)
MULTIQC_UNTRIMMED(FASTQC_UNTRIMMED.out.flatten().collect())
TRIMMOMATIC(reads_ch)
FASTQC_TRIMMED(TRIMMOMATIC.out)
MULTIQC_TRIMMED(FASTQC_TRIMMED.out.flatten().collect())
MTBSEQ_PER_SAMPLE(TRIMMOMATIC.out,
params.gatk38_jar,
env_user_ch)
samples_tsv_file_ch = MTBSEQ_PER_SAMPLE.out[0]
.collect()
.flatten().map { n -> "$n" + "\t" + "$params.mtbseq_library_name" + "\n" }
.collectFile(name: 'samples.tsv', newLine: false, storeDir: "$params.results_dir_mtbseq_cohort")
MTBSEQ_COHORT(
samples_tsv_file_ch,
MTBSEQ_PER_SAMPLE.out[2].collect(),
MTBSEQ_PER_SAMPLE.out[3].collect(),
params.gatk38_jar,
env_user_ch,
)
RDANALYZER(TRIMMOMATIC.out)
SPOTYPING(TRIMMOMATIC.out)
SPADES(TRIMMOMATIC.out)
PROKKA(SPADES.out.prokka_input)
QUAST(SPADES.out.quast_input.collect())
TBPROFILER_PROFILE(TRIMMOMATIC.out)
TBPROFILER_COLLATE(TBPROFILER_PROFILE.out.collect())
}
workflow SAME_PERSON_GENOMES_WF {
reads_ch = Channel.fromFilePairs(params.reads)
FASTQC_UNTRIMMED(reads_ch)
MULTIQC_UNTRIMMED(FASTQC_UNTRIMMED.out.flatten().collect())
TRIMMOMATIC(reads_ch)
FASTQC_TRIMMED(TRIMMOMATIC.out)
MULTIQC_TRIMMED(FASTQC_TRIMMED.out.flatten().collect())
SPOTYPING(TRIMMOMATIC.out)
TBPROFILER_PROFILE(TRIMMOMATIC.out)
TBPROFILER_COLLATE(TBPROFILER_PROFILE.out.collect())
}
workflow AWS_WF {
// reads_ch = Channel.fromFilePairs(params.reads)
env_user_ch = Channel.value("root")
// FASTQC_UNTRIMMED(reads_ch)
// TRIMMOMATIC(reads_ch)
// FASTQC_TRIMMED(TRIMMOMATIC.out)
//
trimmomatic_ch = Channel.fromFilePairs("s3://bucket-eu-west-1-ireland/mono_inh_cristina/results/trimmomatic/*_{R1,R2}.p.fastq.gz")
MTBSEQ_PER_SAMPLE(trimmomatic_ch,
params.gatk38_jar,
env_user_ch)
samples_tsv_file_ch = MTBSEQ_PER_SAMPLE.out[0]
.collect()
.flatten().map { n -> "$n" + "\t" + "$params.mtbseq_library_name" + "\n" }
.collectFile(name: 'samples.tsv', newLine: false, storeDir: "$params.results_dir_mtbseq_cohort")
MTBSEQ_COHORT(
samples_tsv_file_ch,
MTBSEQ_PER_SAMPLE.out[2].collect(),
MTBSEQ_PER_SAMPLE.out[3].collect(),
params.gatk38_jar,
env_user_ch
)
// RDANALYZER(TRIMMOMATIC.out)
SPOTYPING(trimmomatic_ch)
SPADES(trimmomatic_ch)
PROKKA(SPADES.out.prokka_input)
QUAST(SPADES.out.quast_input.collect())
TBPROFILER_PROFILE(trimmomatic_ch)
TBPROFILER_COLLATE(TBPROFILER_PROFILE.out.collect())
}
workflow SPADES_PROKKA_WF {
reads_ch = Channel.fromFilePairs(params.reads)
TRIMMOMATIC(reads_ch)
SPADES(TRIMMOMATIC.out)
PROKKA(SPADES.out.prokka_input)
}
workflow test_wf {
trimmomatic_ch = Channel.fromFilePairs("s3://bucket-eu-west-1-ireland/mono_inh_cristina/results/trimmomatic/*_{R1,R2}.p.fastq.gz")
trimmomatic_ch.view()
}