Closed rwbaer closed 3 years ago
@rwbaer, you should always pass the entire GatingSet to cyto_gate_draw()
otherwise the gates will not be applied to all samples (hence the error above).
You can just overlay the sample that you want to use as a reference. I would recommend adding an experimental variable to make selecting this sample easier. For example, you could add a column called control
and set it values to TRUE/FALSE.
# Select control sample using control variable
gs_control <- cyto_select(gs, control = TRUE)
# Extract data from control for overlay
cs_control <- cyto_extract(gs, "Single Cells")
# Draw gate
cyto_gate_draw(gsSamp,
parent = "Single Cells",
alias = "test1",
channels = c("FL1-AREA", "FL2-AREA"),
type = "interval",
overlay = cs_control[[1]])
P.S. you can modify experimental details of GatingSet by running:
# Supply the name of the file created by `cyto_setup()` so that changes are saved to file
gs <- cyto_details_edit(gs, file = "220421-Experiment-Details.csv")
Very helpful answer in that addresses the specific question and also fills in some holes about setting up gating sets if I would at some point want sample specific gates if these become important. It also helped me better understand how to actually deploy the groups I was creating in Experiment Details. I've been doing convoluted pData stuff. :-(
Anyway, I'm closing this although as a result I opened up 2 derivative issues. Sorry about that. P.S. Just noticed you have updated the version and some docs so I'll see what's new on that front as well.
Briefly describe what you hope to achieve: I have a gating set that consist of 9 files. One of those files is a negative (or positive) control that I'd like to use to draw a gate. The question is, once drawn, how do I apply the gate to the rest of the files in the gating set?
Related sanity question: gsSamp[9] is a gating (sub)set itself. Should I instead be starting from gsSamp[[9]] which, I think, is a gating hierarchy? Either way the main question is how to approach this.
Sorry for such a basic question. Can't find the documentation to help me. Can I do it from within CytoExploreR? Do I need to look at openCyto or FlowWorkspace for this functionality? Glad to read if you point me at it.
EDIT: Perhaps this works, but I don't know how to avoid the error.
Am I on the right track?