Closed DillonHammill closed 3 years ago
Significant improvements have been made to the plotting of histograms within CytoExploreR version 2.0.0.
I will summarise some of the key changes below:
density_
arguments have been renamed to hist_
hist_stat = "count"
(options include count, percent or density)hist_smooth
has now changed to only accept values greater than 1 (too much or too little smoothing affects count estimates)hist_bins
but this is not recommended.
To further improve the statistical capabilities of CytoExploreR, I will be adding support for
counts
in 1-D plots (on y axis). I will be tackling this today, but I am just putting some notes here:Adding support for counts
density
this will only give an approximation of the counts. One way to improve the resolution would be to reduce the bin width and setadjust = 0
, this will provide more accurate counts but will introduce some noise. This may however result in inconsistencies with the smoothing parameters of thepercent
anddensity
options. I will play around with this to see what works best.range
information with thedensity
object for downstream plotting, currently this information is assign to thenames()
but might be better attched toattributes()
.Changes to cyto_plot()
density_
will be updated to be prefixed withhist_
instead, as it no longer makes sense to keep thedensity_
prefix when counts are supported as well.hist_stat
argument to control what is displayed on the y axis, options includecount
,density
orpercent
. Thepercent
option will replace the currentdensity_modal
implementation.density_modal
argument as it will no longer be required as outlined above.hist_bin_width
argument to allow control over bin width, this just ensures that all histograms within the plot use the same bin width. Currently, the bin width is calculated on a per plot basis, so multiplot methods do not use the same bin width in each plot. I will add a new statistical function to compute the bin widths so that a consistent bin width can be used across plots as well.ggridges
.percent
as all layers have the same height but it gets more complicated fordensity
andcount
where each layer can have vastly different heights. I think the current implementation uses the mean height across layers when determining the degree of stacking. I will need to test this once these changes have been made and decide whether it needs changing or not.hist_quantile
argument to add vertical lines to mark quantiles on density distributions, this will be particularly useful forstat = "median"
.