RGLab / flowStats

flowStats: algorithms for flow cytometry data analysis using BioConductor tools
15 stars 10 forks source link

warpSet() #24

Open mikejiang opened 5 years ago

mikejiang commented 5 years ago

Here is a reproducible example (fs.rds attached):

library(flowStats)
fs <- readRDS("fs.rds")
fsN <- warpSet(x = fs, stains = "CD33.CD33-TotalA")
d1 <- densityplot(~`CD33.CD33-TotalA`, fs, main="before warpSet()", filter=curv1Filter("CD33.CD33-TotalA"))
d2 <- densityplot(~`CD33.CD33-TotalA`, fsN, main="after warpSet()", filter=curv1Filter("CD33.CD33-TotalA"))
plot(d1, split=c(1,1,2,1), xlim=c(-.5,2.5))
plot(d2, split=c(2,1,2,1), newpage=FALSE)

image

the main issue is that sample7 (maybe sample 5) is shifted. And so I >wonder, it seems to work well for most of the other channels (not shown) and maybe I can >tweak parameters to get it to work well .. Thoughts? Mark

mikejiang commented 5 years ago

The second peak on the right for sample 7 seems to interfere the peak alignment. To eliminate this effect, simply increase the smoothing bandwidth factor (default bwFac = 2 ), which is passed down to curv1Filter.

fsN <- warpSet(x = fs, stains = "CD33.CD33-TotalA", bwFac = 3)

d1 <- densityplot(~`CD33.CD33-TotalA`, fs, main="before warpSet()", filter=curv1Filter("CD33.CD33-TotalA", bwFac = 3))
d2 <- densityplot(~`CD33.CD33-TotalA`, fsN, main="after warpSet()", filter=curv1Filter("CD33.CD33-TotalA", bwFac = 3))

image

markrobinsonuzh commented 5 years ago

Thanks @mikejiang !

I had tried this already and the problem is, when I choose bwFac = 3, a different channel breaks. For example, here is CD4 (with bwFac = 3):

download

Is there a good strategy (beyond doing it manually) to run multiple bwFrac and then pick-and-choose which one works well for each channel?

Mark

gfinak commented 5 years ago

Could you run different channels separately with different parameters?

markrobinsonuzh commented 5 years ago

I certainly could .. I just wonder if there is a good way to pick off, automatically, the bwFac that works well. If someone has needed to do this before and can suggest a strategy, I'm all ears .. but if not, I/we will try and code something sensible.