Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter out a gating set and convert it in a Flowset #255

Open
feanaros opened this issue Oct 10, 2024 · 1 comment
Open

filter out a gating set and convert it in a Flowset #255

feanaros opened this issue Oct 10, 2024 · 1 comment

Comments

@feanaros
Copy link

Hello I want to filter my flowSet object keeping only CD45+ Live cells.
I have a gating set derived from a flowset of 16 samples.

 gs
A GatingSet with 16 samples
fcs_pro
A flowSet with 16 experiments.
column names(76): Time Event_length ... Pb208Di Bi209Di

I applied this kind of filtering but I think it filters too much:

fcs_pro <- read.flowSet(files, transformation = T, truncate_max_range = F)
gs= GatingSet(fcs_pro)
gs_add_gating_method(gs, "Alive", pop = "+",  parent = "root", dims = "Rh103Di", gating_method = "mindensity")
gs_add_gating_method(gs, "cd45", pop = "+",  parent = "root", dims = "Y89Di", gating_method = "mindensity" )
fs <- gs_pop_get_data(gs, c("cd45"))
write.flowSet(fs, path)

I want to do a gating based on this parameters but I don't know how to apply it on all the elements of the GatingSet obtaining a subset of cells and convert it in a FlowSet:

gs= GatingSet(fcs_pro)
fr <- gh_pop_get_data(gs, "root", returnType = "flowFrame", inverse.transform = F)
chnl <- c("Rh103Di","Y89Di")
g <- openCyto:::.boundary(fr, channels = chnl, min = c(0, 0), max=c(20,400))
p <- autoplot(fr, x = chnl[1], y = chnl[2])
p + geom_gate(g)

thank you!

@mikejiang
Copy link
Member

wrap your custom gating function into a plugin gating method and register it so that it can be used by opencyto::gs_add_gating_method
look at example usage of registerPlugins here
https://rpubs.com/wjiang2/188182
https://www.bioconductor.org/help/course-materials/2014/BioC2014/OpenCytoPracticalComponent.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants