Making a UMAP from FCS file in R
1
0
Entering edit mode
3.2 years ago
roberts ▴ 60

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!

R Flow UMAP • 2.5k views
ADD COMMENT
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode
3.1 years ago

I don't know if this is helpful but did you transform the data first? Typically one does linear scale for FSC and SSC and log10 scale for the fluorescence channels. Also how many channels do you have? I don't know if I would try UMAP with just a handful of channels.

ADD COMMENT

Login before adding your answer.

Traffic: 2704 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6