creating a NOT gate for gating out a single quadrant in a quadrant gate openCyto
1
0
Entering edit mode
Noël • 0
@f7429073
Last seen 2.1 years ago
Netherlands

Hi all,

I'm wondering whether someone knows if it is possible to create something like a NOT gate in Opencyto (preferably in the CSV template that holds the gating strategy) in two dimensions (e.g. a continueing down-stream gating with all events that fall outside of 1 of the 4 quadrants of a quadrant gate).

Any help will be greatly appreciated!

Thanks!

FlowCytometry Opencyto • 908 views
ADD COMMENT
1
Entering edit mode
Kevin Blighe ★ 4.0k
@kevin
Last seen 24 days ago
Republic of Ireland

Yes, you can do this via a Boolean gate. Here is a quick example, which I hope that you can adapt to your own data. In this example, I am interested in a population of cells that fall outside the main density of cells, which are identified via a polynomial gate. After I negate it, I then do a rectangle gate on the identified cells - note the very specific notation when using booleanFilter(), which includes the exclamation mark and backticks:

# gate for RFP+GFP+ cloud, then negate with boolean
  message('--------gating for PE-A (RFP) GFP-A cloud')
  gates <- c('PE.A', 'GFP.A')
  gs_add_gating_method(
    gs, alias = 'RFP GFP cloud', 
    pop = '+', parent = 'BV421-A-',
    dims = paste(gates, collapse = ','),
    gating_method = 'flowClust.2d', 
    gating_args = 'K=1,q=0.99')

# negate the gate
  bg <- booleanFilter(`!RFP GFP cloud`, filterId = 'neg RFP GFP cloud')
  gs_pop_add(gs, bg, parent = 'BV421-A-')
  gs_get_pop_paths(gs[[1]])

# make a further specific selection on the cells selected via booleanGate
  gates <- c('PE.A', 'GFP.A')
  rfp_min <- quantile(exprs(ff)[,'PE-A'], 0.05)
  rfp_max <- quantile(exprs(ff)[,'PE-A'], 0.95)
  gfp_min <- quantile(exprs(ff)[,'GFP-A'], 0.60)
  gfp_max <- max(exprs(ff)[,'GFP-A'])
  rg <- rectangleGate(
    'PE-A' = c(rfp_min,rfp_max),
    'GFP-A' = c(gfp_min, gfp_max),
    filterId = 'target RFP+GFP+')
  gs_pop_add(gs, rg, parent = 'neg RFP GFP cloud')
  gs_get_pop_paths(gs[[1]])
  recompute(gs)

Kevin

ADD COMMENT

Login before adding your answer.

Traffic: 503 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