markrobinsonuzh / cytofWorkflow

MIT License
14 stars 3 forks source link

Best pre-processing steps for flowSet data #25

Closed wudustan closed 3 years ago

wudustan commented 3 years ago

Hi, apologies if this is the wrong place for this kind of query. I am very new to flow cytometry analysis. I am trying to import my own data into a flowSet object downstream from constructing an sce for cytofWorkflow

My code for constructing the flowCore set:

## import dat as FSC object
library(flowCore)

fcs.dir <- list.files("~/RStudio/flow_cytometry/pilot_fcs/", full.names = TRUE, pattern = "fcs")
frames <- lapply(fcs.dir, function(x) read.FCS(x, 
                                     transformation = FALSE,
                                     truncate_max_range = FALSE,
                                     alter.names = FALSE))

fs <- as(frames, "flowSet")

comp <- fsApply(fs, function(x) spillover(x)[[1]], simplify = FALSE)
comp.fs <- compensate(fs, comp)

## feed object into the pipeline
sce <- prepData(comp.fs, ... )

For the purpose of the downstream analysis - do I need to compensate with flowCore?

HelenaLC commented 3 years ago

Yes, I believe so. CATALYST was originally developed for CyTOF data, and the compensation implemented via computeSpillmat & compCytof not intended for flow cytometry data. So the above (compensating the flowSet with flowCore::compensate, entering the CATALYST pipeline from the SCE onwards) should be the way to go.