Skip to content

Commit

Permalink
do not plot nan cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
katosh committed May 15, 2024
1 parent 66971d4 commit 30046bc
Show file tree
Hide file tree
Showing 3 changed files with 253 additions and 187 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Release Notes
### Version 1.3.4rc
* avoid devision by zero in `select_branch_cells` for very small datasets
* make branch selection robust against NaNs
* do not plot unclustered trends (NaN cluster) in `plot_gene_trend_clusters`

### Version 1.3.3
* optional progress bar with `progress=True` in `palantir.utils.run_local_variability`
Expand Down
435 changes: 249 additions & 186 deletions notebooks/Palantir_sample_notebook.ipynb

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/palantir/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1748,10 +1748,12 @@ def plot_gene_trend_clusters(

# Obtain unique clusters and prepare figure
cluster_labels = (
clusters.cat.categories
set(clusters.cat.categories)
if isinstance(clusters, pd.CategoricalDtype)
else set(clusters)
)
cluster_labels = cluster_labels.difference({np.NaN})

n_rows = int(np.ceil(len(cluster_labels) / 3))
fig = plt.figure(figsize=[5.5 * 3, 2.5 * n_rows])

Expand Down

0 comments on commit 30046bc

Please sign in to comment.