Closed Sithara85 closed 4 years ago
Closing your issue since it doesn't follow the protocol.
HI Greg, Sorry about that. As a newbie to Flowcytometry world I wanted some help to proceed. If this is not the forum for that could you please direct me to the correct space?
This is the right place to post question. But you should try best to follow the issue template to compose it. At the very least, the main content of your question should be put into the issue body instead of the title.
What would be the best strategy to gate cytotoxic T cell subsets? For example: in my case I would use three markers to gate them in FlowJo, I thought we can use K means clustering. Can we use Registerplugin to use K means in OpenCyto? Please suggest a best solution you can think of ? We have gated T cell pop in our samples to cytotoxic and Helper using OpenCyto.
Have you worked through the package vignettes and online documentation at cytoverse.org? Do you have done code to share as a starting point?
I haven't explored cytoverse.org. I will do some more learning and will make a new issue with more details. Thank you for your help!
I'm actually not sure if we have a good example for this sort of thing easily discoverable right now. You can add simple clustering results using a factor of the clustering results passed to flowWorkspace::gs_pop_add
. Just keep in mind for a GatingSet
that you will need a factor for each sample and the list will need the sample names:
library(flowCore)
library(flowWorkspace)
dataDir <- system.file("extdata",package="flowWorkspaceData")
gs <- load_gs(list.files(dataDir, pattern = "gs_manual",full = TRUE))
gh <- gs[[1]]
fr <- gh_pop_get_data(gh, "CD3+")
markers <- c("CD4", "CD8", "CD3")
channels <- sapply(markers, function(marker){
getChannelMarker(fr, marker)$name
})
kmeans_results <- kmeans(exprs(fr)[,channels], centers = 3)
cluster_gate <- list(as.factor(kmeans_results$cluster))
names(cluster_gate) <- sampleNames(gs)
# A named list of factors (just length 1 in this case)
cluster_gate
gs_pop_add(gs, cluster_gate, parent = "CD3+", name = "kmeans")
recompute(gs)
plot(gs, "CD3+")
For a sketch of how to add factor output to a method added to openCyto
using register_plugins
, see: https://rpubs.com/wjiang2/320381. This also shows how to incorporate multiple filter results in a single method: https://rpubs.com/wjiang2/188182.
@Sithara85 , @mikejiang just put together a great example ("clustering gating by kmeans") and it is now available from https://cytoverse.org/examples/index.html under the openCyto
tab. Sorry that page is still a little bare. We're still in the process of selecting/updating examples and getting them hooked in.
Hi Jake,
That’s awesome! You have done a great job. While I was wondering whether K means clustering is the best solution in a scenario where we have three markers and you have implemented it with OpenCyto. Thank you very much!!
Best, Sithara
On Fri, Jun 26, 2020 at 3:37 PM Jake Wagner notifications@github.com wrote:
@Sithara85 https://github.com/Sithara85 , @mikejiang https://github.com/mikejiang just put together a great example ("clustering gating by kmeans") and it is now available from https://cytoverse.org/examples/index.html under the openCyto tab. Sorry that page is still a little bare. We're still in the process of selecting/updating examples and getting them hooked in.
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/RGLab/openCyto/issues/213#issuecomment-650389247, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH3B7SYUZCHGYO2WHAWSYFTRYUBKLANCNFSM4OIWO7YA .
--
With regards,
Sithara Vivek,
Mobile - 224 522 2289
Good to hear. And yeah, the idea of that example is that it will show how to use register_plugins
to hook in any k-level factor result from a clustering algorithm using any n channels, not necessarily just kmeans
. And all credit goes to @mikejiang on that one :-)
Thank you very much Mike!!
On Mon, Jun 29, 2020 at 11:38 PM Jake Wagner notifications@github.com wrote:
Good to hear. And yeah, the idea of that example is that it will show how to use register_plugins to hook in any k-level factor result from a clustering result using any n-factors, not necessarily just kmeans. And all credit goes to @mikejiang https://github.com/mikejiang on that one :-)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/RGLab/openCyto/issues/213#issuecomment-651528164, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH3B7S2E34K56Z5XF3LLTFLRZFT37ANCNFSM4OIWO7YA .
--
With regards,
Sithara Vivek,
Mobile - 224 522 2289
READ THIS BEFORE YOU OPEN AN ISSUE ASK YOURSELF THESE QUESTIONS
Do you understand your error message? If you're getting an error message, have you read it and tried to understand what it means?
Have you read the documentation? Have you folowed up on the error message and read the documentation for relevant functions and methods?
Have you searched existing closed issues? Have you searched open and closed issues to see if your problem has already been addressed?
Have you searched the Bioconductor support site? Have you searched the Bioconductor support site to see if your problem has already been addressed?
Are your packages up to date? If you have a bug and we fix it, you will need to install the latest packages from Bioc-devel or from this github repo. Before we do anything we're going to ask you to update your cytoverse packages. Are your currently installed packages up to date? Is your R version up to date? If not, address these problems first.
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
reprex
package (https://github.com/tidyverse/reprex) to provide a minimal reproducible example.sessionInfo()
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
SessionInfo: Provide your
sessionInfo()
as part of yourreprex
Additional context Add any other context about the problem here.