Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

creating a NOT gate for gating out a single quadrant in a quadrant gate openCyto #242

Open
noeldtz opened this issue Oct 26, 2022 · 1 comment

Comments

@noeldtz
Copy link

noeldtz commented Oct 26, 2022

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!

@djhammill
Copy link

djhammill commented Mar 24, 2023

@noeldtz, you can combine multiple gates using a boolean gate which is supported in openCyto through the boolGate gating method. See example below:

# add quadrant gates for populations A, B, C & D
gs_add_gating_method(
  gs,
  alias = "A,B,C,D",
  pop = "*",
  parent = "root",
  dims = "CD4,CD8",
  gating_method = "gate_quad_sequential",
  gating_args = list(
    gFunc = "mindensity"
  )
)
# combine populations A, B & C - call new population E
gs_add_gating_method(
  gs,
  alias = "E",
  pop = "+",
  parent = "root",
  dims = "CD4,CD8",
  gating_method = "boolGate",
  gating_args = "A|B|C"
)

The gating_args contains the boolean logic to use for the new population - | = OR & = AND ! = NOT. In this case we want all events in A, B OR C.

You can then easily gate downstream of the new combined population E by passing it as the parent to gs_add_gating_method().

Note: & will give the intersection of two gates (i.e. A&B - all events in BOTH A and B).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants