mskcc / facets

Algorithm to implement Fraction and Copy number Estimate from Tumor/normal Sequencing.
134 stars 65 forks source link

How the kernel density of cell fraction was plotted in the paper? #173

Open zh9118 opened 2 years ago

zh9118 commented 2 years ago

Hi,

Trying to get some help from here.

I am trying to make the kernel density plot which was shown in the paper. However, didn't find such a function in the package. I looked into the facets object, was wondering which sub-parameter should be used to make the plot? proc_out or emcncf_fit? And which columns of values?

Thanks a lot.

veseshan commented 2 years ago

This R command (almost) reproduces the density plot

plot(density(rep(c(0.89,0.76,0.65), c(9,2,2)), bw=0.006), xlim=c(0.45, 0.95))

Here I have repeated the cf value by number of segments that have it. The input data may have been the cf value repeated by the segment lengths and let R choose the bandwidth automatically.

zh9118 commented 2 years ago

This R command (almost) reproduces the density plot

plot(density(rep(c(0.89,0.76,0.65), c(9,2,2)), bw=0.006), xlim=c(0.45, 0.95))

Here I have repeated the cf value by number of segments that have it. The input data may have been the cf value repeated by the segment lengths and let R choose the bandwidth automatically.

Thank you so much. I found cf (from object proc_out$out) and cf.em (from object emcncf_fit$cncf) in the output. Which one should I use? Also, I found these cf density is quite different than the cluster density from the outputted plots. Are they quite different or?