Skip to content

Commit

Permalink
fixed row-wise normalisation in paired dotplot
Browse files Browse the repository at this point in the history
  • Loading branch information
Niko Papadopoulos committed Apr 23, 2024
1 parent d2cccaf commit c3b38c7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
8 changes: 5 additions & 3 deletions comandos/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import pickle
from typing import Any, Tuple, Union

import scanpy as sc
import anndata as ad
import matplotlib as mpl
import matplotlib.pyplot as plt
Expand All @@ -18,7 +19,6 @@
import plotly.express as px
import plotly.figure_factory as ff
import plotly.graph_objects as go
import scanpy as sc
import seaborn as sns
from matplotlib.patches import Circle, Rectangle
from plotly.subplots import make_subplots
Expand Down Expand Up @@ -400,8 +400,8 @@ def paired_dotplot(
)
# scale the expression values to be between 0 and 1 for each gene
if scale:
query_avg_expr = util.rescale(query_avg_expr).fillna(0)
target_avg_expr = util.rescale(target_avg_expr).fillna(0)
query_avg_expr = util.rescale(query_avg_expr.T).fillna(0).T
target_avg_expr = util.rescale(target_avg_expr.T).fillna(0).T
# get expression percentage for each dot
query_perc_expr, target_perc_expr = du.get_dot_size(
query,
Expand Down Expand Up @@ -504,3 +504,5 @@ def paired_dotplot(
)
else:
pass

# return query_avg_expr, target_avg_expr
22 changes: 12 additions & 10 deletions nbs/02_plot.ipynb

Large diffs are not rendered by default.

0 comments on commit c3b38c7

Please sign in to comment.