-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.nf
40 lines (32 loc) · 1.07 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
#!/usr/bin/env nextflow
nextflow.enable.dsl=2
// define global var
pipeline_name = workflow.manifest.name
WorkflowMain.initialise(workflow, params, log)
// import workflows
include { preprocessing } from './workflow/preprocessing.nf'
include { ispcr } from './workflow/ispcr.nf'
include { postprocessing } from './workflow/postprocessing.nf'
// define main workflow
workflow {
// read data
samples_file = channel
.fromPath(params.input, checkIfExists: true)
data = samples_file
.splitCsv(header: false)
.map { id,path ->
if ( workflow.profile.split(',').contains('test') ) {
tuple(id, file([workflow.projectDir, path].join('/')))
} else {
tuple(id, file(path))
}
}
primers = channel
.fromPath(params.primer, checkIfExists: true)
// preprocess input data
preprocessing(data)
// run in silico PCR
ispcr(preprocessing.out, primers)
// postprocess blast outputs
postprocessing(ispcr.out.output, primers, samples_file)
}