romanhaa / cerebroApp

R package containing the Cerebro application.
https://romanhaa.github.io/cerebroApp/
Other
40 stars 16 forks source link

Add support for monocle3 trajectories in 2D and 3D #24

Open davisidarta opened 3 years ago

davisidarta commented 3 years ago

Hi @romanhaa! Once again, thank you for providing such a great interface for the single-cell community in R.

I particularly appreciate the fact that Cerebro uses plotly to generate the 2D and 3D embeddings. Plotly is a great general plotling framework with really neat UI features. One of these features that can be explored for single-cell visualization is adding trajectories to 2D and 3D embeddings, such as performed with monocle3 here and here. They have some quite neat code for extracting the trajectories and plotting them as line segments in 3D. I think this would be an awesome addition to Cerebro, and I'd be happy to help developing support for it.

Let me know what you think. I'm attaching an example of how this can look cool in 3D and allow visualizing really complex trajectories. Using dbMAP for some human embryonary brain data - it's able to nicely dissect many neuronal trajectories that arise from neural progenitors (cluster 3, yellow), but the result is so complex it is hard to interpret without the trajectory lines. It is hard to visualize them in Cerebro without this support.

dbMAP3D_monocle3_traj_low_res.zip

romanhaa commented 3 years ago

Hi @davisidarta!

That does look pretty useful indeed. Do you have the data that was used to generate the plot? I'd have to figure out how to extract the data from the monocle object and then how to plot it, even though a lot of the code you linked to can probably be re-used. I suppose I could run the monocle3 workflow on one of my test data sets but I don't expect it to look as nice as the one you shared. So if you have the data for the graph you attached and could share it with me, that would be fantastic.

Best, Roman

davisidarta commented 3 years ago

Hi @romanhaa

Thank you for your swift response! I do have the data used to generate this particular plot, but I'm afraid the full data is still embargoed (I tried to obtain sharing clearance but was denied by the supervisor, sorry about this). On the other hand, you'll find that this richness of recovered trajectories is not a particular characteristic from this dataset - this is a general feature of dbMAP embeddings (in this case, with fractional norm metrics, a first in dimensionality reduction). I was hoping you could take a look here for a large-scale, whole-organism example I shared at Twitter, which demonstrates how dbMAP reveals structure from otherwise blobby, clumpy and uninterpretable embeddings.

I'll find a sharable and easily reproducible example that displays similarly complex trajectories (perhaps a downsampled version of the MOCA dataset), add it as a dbMAP tutorial in R, and share the resulting files and code here in the next couple of days. I appreciate your patience and receptiveness!

Davi