RGLab / openCyto

A package that provides data analysis pipeline for flow cytometry.
GNU Affero General Public License v3.0
77 stars 29 forks source link

Using one flowJo workspace to gate many .FCS files #108

Closed anaraserikbek closed 3 years ago

anaraserikbek commented 8 years ago

Hello everyone, I am trying to use one flowJo workspace .XML file to apply it to many .FCS files (that were acquired with the same parameters). However, R (I'm using openCyto package) seems to need more a separate workspace for each .FCS file to do the gating. So, I was wondering wehn R reads the workspace, what parameters exactly does it extract for gating and can we possible use the same workspace to gate several .fcs data that was acaquired with exact same parameters? Thank you in advance,

mikejiang commented 8 years ago

If your FCS files have the same parameters and you want to simply apply the same static gates to all the files:

library(flowWorkspace)
dataDir <- system.file("extdata",package="flowWorkspaceData")
#parse the workspace for one example as the template
ws <- openWorkspace(file.path(dataDir, "manual.xml"))
gs_tmp <- parseWorkspace(ws, name = 4, subset = 1)
#get the GatingHierarchy object
gh <- gs_tmp[[1]]

#select fcs filenames
fcsfiles <- basename(list.files(pattern = "Cyto.*.fcs", dataDir, full = T))

#apply the gates defined in gh to fcs files
gs <- GatingSet(gh, fcsfiles, path = dataDir, isNcdf = TRUE)

If you are talking about extracting the gating scheme from the workspace and generate the csv gating template with the appropriate automated gating algorithm automatically determined for each gate/population, then it is different from what you previously mentioned, and it is not yet available.

anaraserikbek commented 8 years ago

Thank you. Yes, I did really mean that -- "... extracting the gating scheme from the workspace and generate the csv gating template with the appropriate automated gating algorithm automatically determined for each gate/population..." However, by "simply apply the same static gates to all the files", you mean by static gates that the location of the gates will be the same in all the .fcs files where i would apply the gating derived from 1 wflowJo workspace?

gfinak commented 8 years ago

"... extracting the gating scheme from the workspace and generate the csv gating template with the appropriate automated gating algorithm automatically determined for each gate/population..."

@anaraserikbek This is on our radar. Not implemented yet.

mikejiang commented 8 years ago

@anaraserikbek , yes, that's what I meant.