generated from WEHI-ResearchComputing/nf-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.nf
59 lines (46 loc) · 2.53 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
#!/usr/bin/env nextflow
import java.text.SimpleDateFormat
println "*****************************************************"
println "* Nextflow <name> pipeline *"
println "* A Nextflow wrapper pipeline *"
println "* Written by Julie Iskander, *"
println "* Research Computing Platform *"
println "* [email protected] *"
println "* *"
println "*****************************************************"
println " Required Pipeline parameters "
println "-----------------------------------------------------"
println "Input Directory : $params.inputdir "
println "Output Directory : $params.outdir "
println "*****************************************************"
include { CountUniqueSequences } from './modules/alphafold.nf'
include { ALPHAFOLD_Feature as Monomer_Feature } from './modules/alphafold.nf'
include { ALPHAFOLD_Feature as Multimer_Feature } from './modules/alphafold.nf'
include { ALPHAFOLD_Inference as Monomer_Inference } from './modules/alphafold.nf'
include { ALPHAFOLD_Inference as Multimer_Inference } from './modules/alphafold.nf'
workflow {
def query_ch = Channel.fromPath(params.inputdir+"/*.fasta",checkIfExists:true)
.ifEmpty {
error("""
No samples could be found! Please check whether your input directory
is correct, and that your sample name matches *.fasta.
""")
}
Channel.from(params.model_indices.split(',').toList())
.set { model_indicies_ch }
count_ch=CountUniqueSequences(query_ch)
count_ch.map{ name,file,count ->
return tuple(name,file,count.splitText(limit:1).first().trim().toInteger())
}
.branch { name,file,count ->
monomer : count == 1
return tuple(name,file,"monomer_ptm")
multimer : count > 1
return tuple(name,file,"multimer")
}
.set { inference_ch }
Mutli_feature_ch=Multimer_Feature(inference_ch.multimer)
Mono_feature_ch=Monomer_Feature(inference_ch.monomer)
Monomer_Inference(Mono_feature_ch.output.combine(model_indicies_ch))
Multimer_Inference(Mutli_feature_ch.output.combine(model_indicies_ch))
}