-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipeline.nf
74 lines (58 loc) · 1.39 KB
/
pipeline.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
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/env nextflow
nextflow.enable.dsl=2
params.genomes_dir = './input_mags'
params.media_file = './marine_media/media_db.tsv'
params.outdir = './results'
mags = Channel.fromPath("${params.genomes_dir}/*.fasta")
process carveme {
publishDir "${params.outdir}/gems", mode: 'copy'
input:
path fasta
output:
path("${fasta.baseName}.xml")
script:
"""
carve --solver gurobi \\
-o ${fasta.baseName}.xml \\
-u bacteria \\
--init M9[marine] \\
--gapfill M9[marine] \\
--mediadb ${params.media_file} \\
${fasta}
"""
}
process memote {
publishDir "${params.outdir}/memote_reports", mode: 'copy'
input:
path gem_file
output:
path "${gem_file.baseName}.json"
script:
"""
memote run --filename ${gem_file.baseName}.json --ignore-git $gem_file
"""
}
process remove_duplicated_reactions
process merge_community {
publishDir "${params.outdir}/merged_community", mode: 'copy'
input:
path xml_files from gems_ch
output:
path "merged.xml"
script:
"""
carve --solver gurobi \\
--init M9[marine] \\
--gapfill M9[marine] \\
--mediadb ${params.media_file} \\
--output merged.xml \\
--fbc2 \\
$xml_files
"""
}
workflow {
mags.view().set { mags_ch }
carveme( mags_ch ).view().set { gems_ch }
merge_community( gems_ch )
memote( gems_ch )
}