comparison gene_family_scaffold_loader.py @ 8:3841f7252b1d draft

Uploaded
author greg
date Tue, 21 Aug 2018 12:54:31 -0400
parents 9a4b0ae3d408
children 11a36e425c94
comparison
equal deleted inserted replaced
7:976184d4d5bb 8:3841f7252b1d
240 # Example line: Populus trichocarpa\tSalicaceae\tMalpighiales\tRosids\tCore Eudicots 240 # Example line: Populus trichocarpa\tSalicaceae\tMalpighiales\tRosids\tCore Eudicots
241 items = line.split("\t") 241 items = line.split("\t")
242 species_name = items[0] 242 species_name = items[0]
243 i = 0 243 i = 0
244 for clustering_method in self.clustering_methods: 244 for clustering_method in self.clustering_methods:
245 # The format of species_genes_dict_key is <clustering_method>^^<species_name>.
245 species_genes_dict_key = "%s^^%s" % (clustering_method, species_name) 246 species_genes_dict_key = "%s^^%s" % (clustering_method, species_name)
246 # The format of species_genes_dict_key is <clustering_method>^^<species_name>.
247 species_genes_dict_key_items = species_genes_dict_key.split("^^")
248 # Get the scaffold_rec for the current scaffold_id and clustering_method. 247 # Get the scaffold_rec for the current scaffold_id and clustering_method.
249 # The list is [<scaffold_id_db>, <scaffold_id>, <clustering_method>] 248 # The list is [<scaffold_id_db>, <scaffold_id>, <clustering_method>]
250 for scaffold_rec in self.scaffold_recs: 249 for scaffold_rec in self.scaffold_recs:
251 if scaffold_id in scaffold_rec and clustering_method in scaffold_rec: 250 if scaffold_id in scaffold_rec and clustering_method in scaffold_rec:
252 scaffold_id_db = scaffold_rec[0] 251 scaffold_id_db = scaffold_rec[0]
387 if gsoai % 1000 == 0: 386 if gsoai % 1000 == 0:
388 self.log("Inserted 1000 more rows into the gene_scaffold_orthogroup_taxon_association table.") 387 self.log("Inserted 1000 more rows into the gene_scaffold_orthogroup_taxon_association table.")
389 self.log("Inserted a total of %d rows into the plant_tribes_gene table." % gi) 388 self.log("Inserted a total of %d rows into the plant_tribes_gene table." % gi)
390 self.log("Inserted a total of %d rows into the gene_scaffold_orthogroup_taxon_association table." % gsoai) 389 self.log("Inserted a total of %d rows into the gene_scaffold_orthogroup_taxon_association table." % gsoai)
391 390
391
392 if __name__ == '__main__': 392 if __name__ == '__main__':
393 scaffold_loader = ScaffoldLoader() 393 scaffold_loader = ScaffoldLoader()
394 scaffold_loader.run() 394 scaffold_loader.run()
395 scaffold_loader.shutdown() 395 scaffold_loader.shutdown()