-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.nf
61 lines (49 loc) · 1.75 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
#!/usr/bin/env nextflow
import edu.cornell.eipm.messaging.zeromess.messages.*
import edu.cornell.eipm.messaging.zeromess.ZeroMessInitializer
ZeroMessInitializer.init(
workflow.manifest.name,
params.dispatcherURL,
workflow.sessionId,
params.pipeline_messaging_enabled
)
include {PHASE1} from './subworkflows/phase1'
include {PHASE2} from './subworkflows/phase2'
workflow {
PipelineMessage.started(workflow).forTopic("pipelineevents")
.data('message', "RNAseq pipeline run ${workflow.runName} started").send()
channel.fromPath(params.samplesheet)
.splitCsv(header: true)
.map {row -> [['id': row.sample], row.fastq_1, row.fastq_2]}
.set {reads}
// alignment
star_index = channel.value(params.star_index)
PHASE1(
reads,
star_index
)
// quantification and fusion calling
transcriptome_bam = PHASE1.out.transcriptome_bam
junctions = PHASE1.out.junctions
ctat_lib = channel.value(params.ctat_lib)
salmon_index = channel.value(params.salmon_index)
PHASE2(
transcriptome_bam,
junctions,
ctat_lib,
salmon_index
)
}
workflow.onError {
PipelineMessage.error(workflow).forTopic('pipelineevents')
.data('message', "RNAseq pipeline run ${workflow.runName} failed with error message ${workflow.errorMessage}").send()
}
workflow.onComplete {
if (workflow.success) {
PipelineMessage.completed(workflow).forTopic('pipelineevents')
.data('message', "RNAseq pipeline run ${workflow.runName} completed successfully").send()
} else {
PipelineMessage.failed(workflow).forTopic('pipelineevents')
.data('message', "RNAseq pipeline run ${workflow.runName} completed with errors").send()
}
}