Skip to content

Commit

Permalink
Local testing helps a bit, yes
Browse files Browse the repository at this point in the history
  • Loading branch information
iquasere committed Jan 3, 2024
1 parent d7ad3a4 commit 2256769
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion keggcharter.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def ids_xref(
data = pd.merge(data, new_ids, on=f'{in_col}_split', how='left')
del data[f'{in_col}_split']
result = data.groupby([col for col in data.columns if col != out_col], as_index=False).agg({
out_col: lambda x: ','.join(set(x) if type(x) != float else x)})
out_col: lambda x: ','.join(set([val for val in x if type(val) != float]))})
return result


Expand Down
4 changes: 2 additions & 2 deletions keggpathway_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,15 @@ def pathway_boxes_differential(self, df, colormap_name="viridis"):
"""
Represents expression values present in a dataframe in the
pathway map
:param fdf: pandas DataFrame with each column representing a sample
:param df: pandas DataFrame with each column representing a sample
and index corresponding to int list index of the ortholog element in the
pathway
:param colormap_name: str representing a costum matplotlib colormap to be used
"""
norm = cm.colors.Normalize(vmin=0, vmax=df.max().max())
cmap = colormaps.get_cmap(colormap_name)
# normalize values to put them between 0 and 1, and obtain RGB values
df = pd.DataFrame([[val[0], val[1]] for val in cmap(norm(df))], columns=df.columns, index=df.index)
df = pd.DataFrame([[val for val in vals] for vals in cmap(norm(df))], columns=df.columns, index=df.index)
for col in df.columns:
df[col] = df[col].apply(to_hex) # obtain HEX values
nrboxes = len(df.columns) # number of mini-boxes for each box
Expand Down

0 comments on commit 2256769

Please sign in to comment.