Beispiel #1
0
 def _sorted_homologenes(self, homologenes):
     '''sort list of homologenes [(taxid, geneid),...] based on the order
         defined in species_li.
     '''
     d = {}
     for i, species in enumerate(list(TAXONOMY.keys())):
         d[TAXONOMY[species]["tax_id"]] = i
     gene_li = [(d.get(taxid, taxid), taxid, geneid)
                for taxid, geneid in homologenes]
     return [g[1:] for g in sorted(gene_li)]
Beispiel #2
0
 def __init__(self, data_folder):
     # if species_li is None, include all species
     self.set_species_li(list(TAXONOMY.keys()))
     self.data_folder = data_folder
     self.datafile = os.path.join(self.data_folder, self.DATAFILE)