FlowWorkspace and norm2Filter
1
0
Entering edit mode
Jiang, Mike ★ 1.3k
@jiang-mike-4886
Last seen 3.2 years ago
(Private Address)

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

flowcytometry opencyto flowworkspace flowcore • 2.1k views
ADD COMMENT
0
Entering edit mode
Jiang, Mike ★ 1.3k
@jiang-mike-4886
Last seen 3.2 years ago
(Private Address)

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 COMMENT

Login before adding your answer.

Traffic: 659 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6