Mercurial > repos > greg > plant_tribes_add_scaffold
comparison add_scaffold.py @ 7:82822d1e5119 draft
Uploaded
author | greg |
---|---|
date | Tue, 22 May 2018 10:15:49 -0400 |
parents | 7973201f23e7 |
children | 9b2ede3e7100 |
comparison
equal
deleted
inserted
replaced
6:7973201f23e7 | 7:82822d1e5119 |
---|---|
73 sql = "SELECT id FROM plant_tribes_scaffold WHERE scaffold_id = '%s';" % scaffold_id | 73 sql = "SELECT id FROM plant_tribes_scaffold WHERE scaffold_id = '%s';" % scaffold_id |
74 cur = self.conn.cursor() | 74 cur = self.conn.cursor() |
75 cur.execute(sql) | 75 cur.execute(sql) |
76 try: | 76 try: |
77 cur.fetchone()[0] | 77 cur.fetchone()[0] |
78 self.stop_err("The scaffold %s has already been added to the database." % scaffold_id) | 78 # The scaffold has been added to the database. |
79 return False | 79 return False |
80 except: | 80 except: |
81 # The scaffold has not yet been added. | 81 # The scaffold has not yet been added. |
82 return True | 82 return True |
83 | 83 |
86 self.process_annot_dir() | 86 self.process_annot_dir() |
87 self.process_scaffold_config_files() | 87 self.process_scaffold_config_files() |
88 self.process_orthogroup_fasta_files() | 88 self.process_orthogroup_fasta_files() |
89 self.fh.flush() | 89 self.fh.flush() |
90 self.fh.close() | 90 self.fh.close() |
91 else: | |
92 self.stop_err("The scaffold %s has already been added to the database." % scaffold_id) | |
91 | 93 |
92 def process_annot_dir(self): | 94 def process_annot_dir(self): |
93 """ | 95 """ |
94 First, parse all of the *.min_evalue.summary files in the | 96 First, parse all of the *.min_evalue.summary files in the |
95 ~/<scaffold_id>/annot directory (e.g., ~/22Gv1.1/annot) to populate | 97 ~/<scaffold_id>/annot directory (e.g., ~/22Gv1.1/annot) to populate |