biosurf / cyCombine

Robust Integration of Single-Cell Cytometry Datasets
Other
24 stars 7 forks source link

Export density plot data matrix #38

Closed asongggg closed 1 year ago

asongggg commented 1 year ago

Hi,

I am wondering if there is a way to output the data matrix from plot_density? Specifically, how do I extract the density estimation data, which is plotted to generate the density plots?

Thank you, Annie

shdam commented 1 year ago

Hi Annie,

Thank you for your continued use of cyCombine!

We didn't think about an export functionality, as it is directly computed in the plot generation with ggridges::geom_density_ridges. While we consider your suggestion, you can copy and run some of the plotting code and extract density estimates with density_estimates <- ggplot2::ggplot_build(plot_object)$data[[1]].

Alternatively, you can compute the density estimates from the data with stats::density().

I hope this was helpful :)

Best regards, Søren