Skip to content

Commit

Permalink
Use user set KO column
Browse files Browse the repository at this point in the history
  • Loading branch information
iquasere committed Nov 18, 2022
1 parent c802481 commit c19efbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions keggcharter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from keggpathway_map import KEGGPathwayMap, expand_by_list_column

__version__ = "0.4.0"
__version__ = "0.4.1"


def get_arguments():
Expand Down Expand Up @@ -438,7 +438,7 @@ def main():
if args.transcriptomic_columns:
args.transcriptomic_columns = args.transcriptomic_columns.split(',')

ko_column = 'KO (KEGGCharter)' # TODO - set ko_column to user defined value
ko_column = 'KO (KEGGCharter)' if not hasattr(args, 'ko_column') or not args.ko_column else args.ko_column

if args.resume:
data = pd.read_csv(f'{args.output}/data_for_charting.tsv', sep='\t')
Expand Down
6 changes: 3 additions & 3 deletions keggpathway_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def most_abundant_taxa(self, data, columns, taxa_column, number_of_taxa=10):
return data.index.tolist()[:number_of_taxa]

def genomic_potential_taxa(
self, data, samples, ko_column, taxon_to_mmap_to_orthologs, mmaps2taxa=None,
self, data, samples, ko_column, taxon_to_mmap_to_orthologs, mmaps2taxa,
taxa_column='Taxonomic lineage (GENUS)', output_basename=None, number_of_taxa=10, grey_taxa='Other taxa'):
"""
Represents the genomic potential of the dataset for a certain taxa level,
Expand Down Expand Up @@ -408,12 +408,12 @@ def genomic_potential_taxa(
box2taxon[box] = [grey_taxa]
else:
# if input_taxonomy
dic_colors = {grey_taxa : "#7c7272"}
dic_colors = {grey_taxa: "#7c7272"}
df = data[data.any(axis=1)]
for ortholog in df[ko_column]:
if ortholog in self.ko_boxes.keys():
for box in self.ko_boxes[ortholog]:
if box not in box2taxon.keys():
if box in box2taxon.keys():
box2taxon[box].append(grey_taxa)
else:
box2taxon[box] = [grey_taxa]
Expand Down

0 comments on commit c19efbf

Please sign in to comment.