dpeerlab / Palantir

Single cell trajectory detection
https://palantir.readthedocs.io
GNU General Public License v2.0
213 stars 50 forks source link

No agreeing fate names found for .obsm['palantir_fate_probabilities'] and .obsm['branch_masks']. #137

Closed wangjiawen2013 closed 5 months ago

wangjiawen2013 commented 6 months ago

Hi, I met an error when running palantir, it happened at this step:

masks = palantir.presults.select_branch_cells(adata, q=0.01, eps=0)
palantir.plot.plot_branch_selection(adata, s=0.2)

image

katosh commented 6 months ago

Hello @wangjiawen2013,

Thank you for highlighting this issue. To diagnose further, could you share excerpts from ad.obsm["palantir_fate_probabilities"] and ad.obsm["branch_masks"]? The error suggests a mismatch of column names or absence of columns. If they're not dataframes, please list their column names under ad.uns["palantir_fate_probabilities_columns"] and ad.uns["branch_masks_columns"].

Should there be a discrepancy in the column names, it may stem from the computation of palantir_fate_probabilities_columns. The palantir.core.run_palantir function, which expects a terminal_states dictionary defining terminal cell states (and consequently the table columns), might be the source:

terminal_states = {
    "branch_1": "cell_name_marking_terminal_1",
    "branch_2": "cell_name_marking_terminal_2",
    ...
}

Ensure these terminal_states are correctly specified. Confirm the initial output from palantir.core.run_palantir matches expectations, e.g., by visualizing with palantir.plot.plot_palantir_results(ad).

katosh commented 5 months ago

I am closing this due to inactivity. Please reopen if the issue persists.