-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.nf
53 lines (40 loc) · 1.99 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
#!/usr/bin/env nextflow
include {SRA2FASTQ} from './modules/sra2fastq/sra2fastq.nf'
include {COUNTFASTQ} from './modules/countFastq/countFastq.nf'
include {FAQCS} from './modules/runFaQCs/runFaQCs.nf'
include {HOSTREMOVAL} from './modules/hostRemoval/hostRemoval.nf'
include {ASSEMBLY} from './modules/runAssembly/runAssembly.nf'
include {READSTOCONTIGS} from './modules/runReadsToContig/runReadsToContig.nf'
workflow {
//input specification
pairedFiles = channel.fromPath(params.pairedFiles, checkIfExists:true)
unpairedFiles = channel.fromPath(params.unpairedFiles, checkIfExists:true)
contigs = channel.empty()
if(params.r2c.useAssembledContigs) {
contigs = channel.fromPath(params.inputContigs, checkIfExists:true)
}
if(params.modules.sra2fastq) {
SRA2FASTQ(params.sra2fastq.plus(params.shared))
pairedFiles = pairedFiles.concat(SRA2FASTQ.out.paired).flatten()
unpairedFiles = unpairedFiles.concat(SRA2FASTQ.out.unpaired).flatten()
}
COUNTFASTQ(pairedFiles.collect(), unpairedFiles.collect())
avgLen = COUNTFASTQ.out.avgReadLen
paired = COUNTFASTQ.out.paired.ifEmpty(params.pairedFiles)
unpaired = COUNTFASTQ.out.unpaired.ifEmpty(params.unpairedFiles)
if(params.modules.faqcs) {
FAQCS(params.faqcs.plus(params.shared),paired,unpaired,avgLen)
paired = FAQCS.out.paired.ifEmpty(params.pairedFiles)
unpaired = FAQCS.out.unpaired.ifEmpty(params.unpairedFiles)
}
if(params.modules.hostRemoval) {
HOSTREMOVAL(params.hostRemoval.plus(params.shared),paired,unpaired)
paired = HOSTREMOVAL.out.paired.ifEmpty(params.pairedFiles)
unpaired = HOSTREMOVAL.out.unpaired.ifEmpty(params.unpairedFiles)
}
if(params.modules.runAssembly && !params.r2c.useAssembledContigs) {
ASSEMBLY(params.assembly.plus(params.shared), paired, unpaired, avgLen)
contigs = ASSEMBLY.out.outContigs
READSTOCONTIGS(params.r2c.plus(params.shared), paired, unpaired, contigs)
}
}