Skip to content

Commit

Permalink
Grey adds to already present taxonomies
Browse files Browse the repository at this point in the history
  • Loading branch information
iquasere committed Sep 28, 2022
1 parent 7392a0c commit 93ce4da
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions keggpathway_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,19 +397,17 @@ def genomic_potential_taxa(
else:
dic_colors = {}
# boxes with KOs identified but not from the most abundant taxa are still identified
df = data[samples + [ko_column]]
df = data[(data[taxa_column].isin(mmaps2taxa[self.name.split('ko')[1]]) &
data[ko_column].isin(self.ko_boxes.keys())) & ~data[taxa_column].isin(taxa)]
df = df[df.any(axis=1)]
grey_boxes = []
for ortholog in df[ko_column]:
if ortholog in self.ko_boxes.keys():
dic_colors[grey_taxa] = "#7c7272"
for box in self.ko_boxes[ortholog]:
if box not in box2taxon.keys() and box not in grey_boxes:
grey_boxes.append(box)
print(grey_boxes)
# a new taxon: "Other taxa"
if len(grey_boxes) > 0:
dic_colors[grey_taxa] = "#7c7272"
self.grey_boxes(grey_boxes)
if box not in box2taxon.keys():
box2taxon[box].append(grey_taxa)
else:
box2taxon[box] = [grey_taxa]

name = self.name.split(':')[-1]
name_pdf = f'{output_basename}_{name}.pdf'
Expand Down

0 comments on commit 93ce4da

Please sign in to comment.