farrellja / URD

URD - Reconstruction of Branching Developmental Trajectories
GNU General Public License v3.0
115 stars 41 forks source link

how to extract the Embeddings information after treeForceDirectedLayout processing #51

Closed pangxueyu233 closed 4 years ago

pangxueyu233 commented 4 years ago

Hello, it's really a impressive working to generate the URD algorithm. And the treeForceDirectedLayout is a important formula to visualize the single cell connection. However, recently I tried to extract the Embeddings information from URD object after treeForceDirectedLayout processing, I didn't know where that information stored. Could you help me work it out? Thanks

farrellja commented 4 years ago

@pangxueyu233

The force-directed layout embedding is stored in the object as object@tree$walks.force.layout. The columns x, y, and telescope.pt (z) are what you want.

Best, Jeff

pangxueyu233 commented 4 years ago

Thanks! But I have another problem: How could we export a png or a svg file of plotTreeForce results ?

farrellja commented 4 years ago

plotTreeForce renders using the R package rgl. You can functions from that package to save resulting images (i.e. rgl::rgl.snapshot or rgl::postscript), as is written in the documentation for the function (see ?plotTreeForce).