Hell! I've been asked to UMAP out of .FCS files in R (I know I can make it in Flow Jo but I specifically asked to make it in R). I have gated the cells to get CD8+ cells and am working with that. I am having a really hard time making a meaningful umap that gives anysort of information. So far this is my code
X<- read.csv("Desktop/export_B 6 hr stim 0.5_CD8.csv")
x2m <- function(X) {
if (!methods::is(X, "matrix")) {
m <- as.matrix(X[, which(vapply(X, is.numeric, logical(1)))])
}
else {
m <- X
}
m
}
X_umap<- umap(X, init = "spca")
embed_img <- function(X, Y, k = 10, ...) {
args <- list(...)
args$coords <- Y
args$x <- X
do.call(vizier::embed_plot, args)
}
embed_img(X, X_umap, pc_axes = F, equal_axes = F, alpha_scale = 0.5, title = "iris UMAP", cex = 1, label=T)
In return I get a umap but with no meaningful information-- clusters but can't identify where anything is there is no markers from the fluorochrome. I have also tried using flowCore but the most I got there was getting it to read in the FCS file. Does anyone have any suggestions? Ideas? Hints? Thanks!
well you need to get your labels into X. either the labels come from the clusters or are ground-truth. see in this tutorial they use M3C to extract the clusters which are just 1,2,3... then you can label those posthoc if you know what they correspond to biologically.