@@ -242,6 +242,10 @@ def parse_cmdline(args):
242
242
action = "store" ,
243
243
default = pyani_config .FORMATDB_DEFAULT ,
244
244
help = "Path to BLAST formatdb executable" )
245
+ parser .add_argument ("--write_excel" , dest = "write_excel" ,
246
+ action = "store_true" ,
247
+ default = False ,
248
+ help = "Write Excel format output tables" )
245
249
return parser .parse_args ()
246
250
247
251
@@ -522,15 +526,16 @@ def write(results, filestems):
522
526
523
527
- results - tuple of dataframes from analysis
524
528
525
- Each dataframe is written to an Excel-format file, and plain text
526
- tab-separated file in the output directory. The order of result output
527
- must be reflected in the order of filestems.
529
+ Each dataframe is written to an Excel-format file (if args.write_excel is
530
+ True), and plain text tab-separated file in the output directory. The
531
+ order of result output must be reflected in the order of filestems.
528
532
"""
529
533
logger .info ("Writing %s results to %s" % (args .method , args .outdirname ))
530
534
for df , filestem in zip (results , filestems ):
531
535
logger .info ("\t %s" % filestem )
532
- df .to_excel (os .path .join (args .outdirname , filestem ) + '.xlsx' ,
533
- index = True )
536
+ if args .write_excel :
537
+ df .to_excel (os .path .join (args .outdirname , filestem ) + '.xlsx' ,
538
+ index = True )
534
539
df .to_csv (os .path .join (args .outdirname , filestem ) + '.tab' ,
535
540
index = True , sep = "\t " )
536
541
0 commit comments