DillonHammill / CytoExploreR

Interactive Cytometry Data Analysis
60 stars 13 forks source link

How to gate on channels "FSC-A" and "SSC-A" then plot the "FL2-A" for those cells/events? #180

Closed th-of closed 1 year ago

th-of commented 1 year ago

I would like to gate a population using the FSC-A and SSC-A channels (ellipse), then plot the fluorescence channel (FL2-A) for the cells in the gate as a 1D histogram.

I can't figure out how to do this in CytoExploreR. Any help?

This is my current attempt:

cyto_gate_draw(gs, parent = "root", alias = "Cells", channels = c("FSC-A", "SSC-A"), type = "ellipse", gatingTemplate = "lod1.csv")

Followed by:

cyto_plot(gs[[1]], parent = "root", channels = "FL2-A", alias = "Cells", ... )

Results in the error:

Error in cyto_gate_convert.ellipsoidGate(z, channels) : Supplied gate must contain co-ordinates in the supplied channels.

DillonHammill commented 1 year ago

@th-of, alias refers to a gate to be plotted in channels, you get an error because your ellipse wasn't drawn in the FL2-A channel. Instead, to plot the Cells in FL2-A, you should set parent = "Cells" and remove alias as you haven't drawn any gates in that channel yet.

th-of commented 1 year ago

That was easy, thank you very much. Must admit I don't have a good grasp of this "parent" and "alias" settings/concepts.

DillonHammill commented 1 year ago

parent indicates the points to display in the plot, whilst alias indicates the gates to display in the plot.