RGLab / openCyto

A package that provides data analysis pipeline for flow cytometry.
GNU Affero General Public License v3.0
75 stars 29 forks source link

How to extract the cell label information #205

Closed liupeng2117 closed 3 years ago

liupeng2117 commented 4 years ago

Hi Mike,

I am trying to implementing your method OpenCyto into a CyTOF dataset following your tutorial

https://bioconductor.org/packages/devel/bioc/vignettes/openCyto/inst/doc/openCytoVignette.html

In section 4.5, after gating

gt_gating(gt_tcell, gs)

How to extract the cell label information after gating? In other words, is there any way to know which cells are assigned to which populations?

Thanks, Silvia

jacobpwagner commented 4 years ago

I think gh_pop_get_indices and/or gh_pop_get_indices_mat may be what you're looking for. For each GatingHierarchy in the GatingSet, you can use those methods to get either a boolean vector (gh_pop_get_indices) for population assignment for all cells or a boolean matrix (gh_pop_get_indices_mat) for multiple populations for all cells. In that case each row will be an event/cell with boolean values denoting in/out assignment for each population (column).

Let me know if that's not what you were thinking, though.

mikejiang commented 4 years ago

By the way, I think you should use gs_add_gating_method/gs_remove_gating_method to interactively/incrementally add the gates instead of writing the csv template. So that you can change and tune the gating parameters and quickly inspect the results (using ggcyto::autoplot) at each gating step.