Hi,
I am using ggcyto to make graphical display of flow cytometry data, from a gating hierarchy generated in OpenCyto.
My problem is that I can't seem to find a way to control the number of decimals in gate labels. Default seem to be 3 numbers from the first non-zero number. Thus, in a gate the geom_stats label may for example be 0.00357% if the events in that gate is close to zero.
I would rather have only one decimal space, by some rounding function. Is there any quick fix, such as the "digits"-argument in xyplot?
Here is a reproducibel example:
data(GvHD)
fs <- GvHD[1]
gs <- GatingSet(fs)
qg <- quadGate("FL1-H"=7.5e3, "FL2-H"=1e3)
nodeIDs<-add(gs,qg,parent="root")
recompute(gs)
p <- ggcyto(gs, aes(x = `FL1-H`, y = `FL2-H`), subset="root")
p + geom_hex(bins = 128)+geom_gate()+geom_stats()
Best regards,
Anders
Hi,
I still have some trouble with digits in geom_stats in ggcyto (partly because I am not able to upgrade R/Bioconductor at my university).
Is there an easy way to apply values to the geom_stats layer from gates extracted for example by getGate() and applied to the gatingset, and then for example by the function 'round(digits=1)' or similar to values (frequencies) from the filterResultlist?
You have given an example on the use of 'lapply' previously, but it is not very functional, as it only returns the value '10%' (https://www.bioconductor.org/packages/release/bioc/vignettes/ggcyto/inst/doc/ggcyto.flowSet.html):
I can't seem to get the syntax right to control the values from the filterResultlist:
Is there any solution to this?
With regards,
You can install it directly from github
If you really want to manually supply the value for geom_stats layer, you can extract the stats directly from GatingSet
But you will have to add geom_stats layers for each population since you have four quadrants to plot
Again, these should all be taken care of by one-liner call if you update ggcyto to the latest
Thanks, this works very well.