dpeerlab / Palantir

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

unable to calculate differentiation potential #13

Closed MichaelPeibo closed 5 years ago

MichaelPeibo commented 5 years ago

Hi, Palantir team

Very nice tool!

I am using my own data to run Palantir. After I run palantir.plot.plot_palantir_results(pr_res, tsne), I did not get differentiation potential value, is this due to some disconnection on tsne projection of data? Or I use wrong mapping?(I am very fresh on python code)

start_cell='mda_day35_AGGGTGAAGACGCAAC'
pr_res = palantir.core.run_palantir(ms_data, start_cell, num_waypoints=500)
mapping = pd.Series(index=['mylin'])
mapping['mylin'] = pr_res.branch_probs.columns.difference(mapping.values)[0]
mapping = pd.Series(mapping.index, index=mapping)
pr_res.branch_probs.columns = mapping[pr_res.branch_probs.columns]
palantir.plot.plot_palantir_results(pr_res, tsne)

The results of palantir.plot.plot_palantir_results(pr_res, tsne) is shown below, all entropy is zero: image

Any suggestion? Thanks!

ManuSetty commented 5 years ago

In this case the entropy is all zero because there appears to be only one branch. Differentiation potential / entropy comes into picture when multiple branches are present in the dataset. If you think that the detected end point is incomplete, you can set the known terminal states or end points using the terminal_states parameter

MichaelPeibo commented 5 years ago

Thanks! @ManuSetty

I expect only one branch as it detects, terminal state is correct. So the zero entropy should be due to what you described.