Skip to content

Commit

Permalink
branch selection robust against NaNs
Browse files Browse the repository at this point in the history
  • Loading branch information
katosh committed May 15, 2024
1 parent 644a4a3 commit 03587b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,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

### Version 1.3.3
* optional progress bar with `progress=True` in `palantir.utils.run_local_variability`
Expand Down
2 changes: 2 additions & 0 deletions src/palantir/presults.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,8 @@ def select_branch_cells(
fate_probs, fate_names = _validate_obsm_key(ad, fate_prob_key, as_df=False)
pseudotime = ad.obs[pseudo_time_key].values

fate_probs[np.isnan(fate_probs)] = 1/fate_probs.shape[1]

idx = np.argsort(pseudotime)
sorted_fate_probs = fate_probs[idx, :]
prob_thresholds = np.empty_like(fate_probs)
Expand Down

0 comments on commit 03587b6

Please sign in to comment.