Question: FlowWorkspace and norm2Filter
0
gravatar for Jiang, Mike
3.5 years ago by
Jiang, Mike1.2k
(Private Address)
Jiang, Mike1.2k wrote:

I am working with FlowWorkspace to analyse some FACS data.

After creating a GatingSet I want to apply a filter based on the norm2Filter function from the flowCore package.
However it gives me an error, adding a rectangle gate etc. works fine.

Code:

n2f <- norm2Filter(filterId=“all cells",x=c("FSC-A","SSC-A"),scale.factor=2)
add(gs,n2f,parent="root")
replicating filter 'all cells' across samples!
Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function ‘filterObject’ for signature ‘"norm2Filter”’

I couldn’t find anything regarding this issue anywhere, also the flowCore package states that any flowCore filter theoretically can be used.

Am I doing something wrong?

Cheers,
Christian Oertlin

ADD COMMENTlink modified 3.5 years ago • written 3.5 years ago by Jiang, Mike1.2k
Answer: FlowWorkspace and norm2Filter
0
gravatar for Jiang, Mike
3.5 years ago by
Jiang, Mike1.2k
(Private Address)
Jiang, Mike1.2k wrote:

Christian,

GatingSet only supports the concrete gate, i.e. either a geometrical gate (e.g. polygonGate, rectangleGate or ellipoidGate) or a boolean combinations (i.e. booleanFilter). 

'norm2Filter' is an abstract gate, or more accurately speaking, an automated gating algorithm that generates the data-driven gates. So you have to first compute the geometrical gates from 'norm2Filter'. e.g.

n2f <- norm2Filter(filterId='all cells',x=c("FSC-A","SSC-A"),scale.factor=2)

#get the flow data
fs <- getData(gs,"root")

#perform the filtering/gating
res <- filter(fs, n2f)

#extract the ellipsoidGate from the filterResults
res <- lapply(res, function(thisRes){
  thisRes <- filterDetails(thisRes[[1]])[["all cells"]]
  g <- ellipsoidGate(thisRes[["cov"]], mean = thisRes[["center"]], distance = thisRes[["radius"]])
})

#add ellipsoidGate to GatingSet
add(gs, res, parent="root", name = "all cells")
recompute(gs)

You also want to check out the 'openCyto' package that provides a more general framework for this type of automated gating method.

Mike

 

ADD COMMENTlink written 3.5 years ago by Jiang, Mike1.2k
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 16.09
Traffic: 103 users visited in the last hour