Search
Question: exporting bi-exponetially transformed data as CVS
0
gravatar for Aki Hoji
9 months ago by
Aki Hoji10
Aki Hoji10 wrote:

Hi,

Is is possible to extract bi-exp transformation values embedded in a Flowjo worksheet,  apply to compesanted fcs data and export the data as a CSV file by using flowWorkspace and/or flow core ? Any help will be appreciated.

Thanks in advance.

 

 

 

 

ADD COMMENTlink modified 9 months ago by Jiang, Mike1.0k • written 9 months ago by Aki Hoji10
0
gravatar for Jiang, Mike
9 months ago by
Jiang, Mike1.0k
(Private Address)
Jiang, Mike1.0k wrote:

Is this what you need?

library(flowWorkspace)
# load raw fcs
fcsfiles <- list.files(pattern = "CytoTrol", system.file("extdata", package = "flowWorkspaceData"), full = TRUE)[1]
fs <- read.ncdfFlowSet(fcsfiles)
# read spillover from fcs
comp <- spillover(fs[[1]])[[1]]
# compensate the fcs
fs <- compensate(fs, comp)

# read flowJo workspace
ws <- openWorkspace(system.file("extdata/manual.xml", package = "flowWorkspaceData"))
# parse it into GatingSet 
#if biexp transformation is the only thing you need, then set execute to FALSE will bypass loading the data thus speed up the process
gs <- parseWorkspace(ws, name = 2, execute = F)
#extract transformation 
trans <- getTransformations(gs[[1]])
# construct a transformList
trans <- transformList(from = colnames(comp), trans)
# apply to compensated data
fs <- transform(fs, trans)
#export the data to csv
for(sn in sampleNames(fs))
{
  filename <- paste0(sn, ".csv")
  write.csv(exprs(fs[[sn]]), file = filename)
}
ADD COMMENTlink written 9 months ago by Jiang, Mike1.0k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 130 users visited in the last hour