18
18
__status__ = "Stable Release"
19
19
20
20
21
+ class ArgsObj :
22
+ def __init__ (
23
+ self ,
24
+ assembler ,
25
+ graph ,
26
+ contigs ,
27
+ paths ,
28
+ abundance ,
29
+ binned ,
30
+ output ,
31
+ prefix ,
32
+ depth ,
33
+ threshold ,
34
+ delimiter ,
35
+ nthreads
36
+ ):
37
+ self .assembler = assembler
38
+ self .graph = graph
39
+ self .contigs = contigs
40
+ self .paths = paths
41
+ self .abundance = abundance
42
+ self .binned = binned
43
+ self .output = output
44
+ self .prefix = prefix
45
+ self .depth = depth
46
+ self .threshold = threshold
47
+ self .delimiter = delimiter
48
+ self .nthreads = nthreads
49
+
50
+
21
51
@click .command ()
22
52
@click .option (
23
53
"--assembler" ,
@@ -99,6 +129,7 @@ __status__ = "Stable Release"
99
129
show_default = True ,
100
130
required = False ,
101
131
)
132
+ @click .version_option (__version__ , "-v" , "--version" , is_flag = True )
102
133
def main (
103
134
assembler ,
104
135
graph ,
@@ -116,6 +147,9 @@ def main(
116
147
117
148
"""
118
149
GraphBin2: Refined and Overlapped Binning of Metagenomic Contigs Using Assembly Graphs
150
+ GraphBin2 is a tool which refines the binning results obtained from existing tools and, is able to
151
+ assign contigs to multiple bins. GraphBin2 uses the connectivity and coverage information from
152
+ assembly graphs to adjust existing binning results on contigs and to infer contigs shared by multiple species.
119
153
"""
120
154
121
155
assembly_graph_file = graph
@@ -215,54 +249,33 @@ def main(
215
249
216
250
logger .info ("GraphBin2 started" )
217
251
252
+ # Make args object
253
+ args = ArgsObj (
254
+ assembler ,
255
+ graph ,
256
+ contigs ,
257
+ paths ,
258
+ abundance ,
259
+ binned ,
260
+ output ,
261
+ prefix ,
262
+ depth ,
263
+ threshold ,
264
+ delimiter ,
265
+ nthreads
266
+ )
267
+
218
268
219
269
# Run GraphBin2
220
270
#---------------------------------------------------
221
271
if assembler .lower () == "spades" :
222
- cmdGraphBin2 = """python "{0}/src/graphbin2_SPAdes.py" --graph "{1}" --contigs "{2}" --paths "{3}" --binned "{4}" --output "{5}" --prefix "{6}" --depth "{7}" --threshold "{8}" --delimiter "{9}" --nthreads "{10}" """ .format (
223
- os .path .dirname (__file__ ),
224
- assembly_graph_file ,
225
- contigs ,
226
- contig_paths ,
227
- contig_bins_file ,
228
- output_path ,
229
- prefix ,
230
- depth ,
231
- threshold ,
232
- delimiter ,
233
- nthreads )
272
+ graphbin2_SPAdes .main (args )
234
273
235
274
elif assembler .lower () == "sga" :
236
- cmdGraphBin2 = """python "{0}/src/graphbin2_SGA.py" --graph "{1}" --contigs "{2}" --binned "{3}" --abundance "{4}" --output "{5}" --prefix "{6}" --depth "{7}" --threshold "{8}" --delimiter "{9}" --nthreads "{10}" """ .format (
237
- os .path .dirname (__file__ ),
238
- assembly_graph_file ,
239
- contigs ,
240
- contig_bins_file ,
241
- abundance ,
242
- output_path ,
243
- prefix ,
244
- depth ,
245
- threshold ,
246
- delimiter ,
247
- nthreads )
275
+ graphbin2_SGA .main (args )
248
276
249
277
elif assembler .lower () == "flye" :
250
- cmdGraphBin2 = """python "{0}/src/graphbin2_Flye.py" --graph "{1}" --contigs "{2}" --paths "{3}" --binned "{4}" --abundance "{5}" --output "{6}" --prefix "{7}" --depth "{8}" --threshold "{9}" --delimiter "{10}" --nthreads "{11}" """ .format (
251
- os .path .dirname (__file__ ),
252
- assembly_graph_file ,
253
- contigs ,
254
- contig_paths ,
255
- contig_bins_file ,
256
- abundance ,
257
- output_path ,
258
- prefix ,
259
- depth ,
260
- threshold ,
261
- delimiter ,
262
- nthreads )
263
-
264
-
265
- os .system (cmdGraphBin2 )
278
+ graphbin2_Flye .main (args )
266
279
267
280
268
281
if __name__ == "__main__" :
0 commit comments