-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.nf
31 lines (25 loc) · 1.08 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
#!/usr/bin/env nextflow
// enable dsl2
nextflow.preview.dsl=2
// import subworkflows
include {prepareNewFasta} from './workflows/prepareNewFasta.nf'
include {selectFasta} from './workflows/selectFasta.nf'
include {krakenBuild} from './workflows/krakenBuild.nf'
// main workflow
workflow {
// New Assemblies to Edit
EditFasta = Channel.fromPath( params.addFasta + "/**.f*" ).map{ file -> tuple(file.getParent().getName(), file) }
if( params.previousDatabase ) {
// If building from a previous database, create channnel for the assemblies
OldFasta = Channel.fromPath( params.previousDatabase + "/**.f*" )
}
else {
// Else there are no assemblies to add so create empty channel
OldFasta = Channel.empty()
}
main:
prepareNewFasta(EditFasta)
AllFasta = prepareNewFasta.out.NewFasta.mix(OldFasta).map{ file -> tuple(file.getName().split("_")[0], file) }.groupTuple(sort: true)
selectFasta(AllFasta)
krakenBuild(selectFasta.out.FastaToAdd, prepareNewFasta.out.TaxonomyNames, prepareNewFasta.out.TaxonomyNodes)
}