diff ete_lineage_generator.py @ 4:87b6de3ef63e draft

planemo upload for repository https://github.com/TGAC/earlham-galaxytools/tree/master/tools/ete commit 41e40314a9b25a9f3c06a13422d367b68334f593
author earlhaminst
date Thu, 22 Mar 2018 13:25:38 -0400
parents 03c10736e497
children f1eca1158f21
line wrap: on
line diff
--- a/ete_lineage_generator.py	Mon Mar 12 12:51:48 2018 -0400
+++ b/ete_lineage_generator.py	Thu Mar 22 13:25:38 2018 -0400
@@ -76,6 +76,7 @@
     parser.error("-s option must be specified, Species list in text format one species in each line")
 if options.full and options.ranks:
     parser.error("-f and -r can not be used at the same time")
+
 if options.ranks:
     for r in options.ranks:
         if r not in LONG_RANKS:
@@ -105,6 +106,9 @@
         for ilr in range(len(LONG_RANKS)):
             if RANKS[ir] in LONG_RANKS[ilr]:
                 COMP_RANK_IDX[LONG_RANKS[ilr]] = ir
+# write header
+of.write("#species/taxid\t%s\n" % ("\t".join(RANKS)))
+# get and write data
 with open(options.input_species_filename) as f:
     for line in f.readlines():
         line = line.strip().replace('_', ' ')