FlowCytometryTools.core.gates.CompositeGate

class FlowCytometryTools.core.gates.CompositeGate(gate1, how, gate2=None)[source]

Defines a composite gate that is generated by the logical addition of one or more gates.

You can create the union of two gates by combining them with how=’or’.

>>> union_gate = CompositeGate(gate1, 'or', gate2)

However,

There is a shorthand to do the same operation

>>> union_gate = gate1 | gate2

Similarly, if you wanted the intersection:

>>> intersection_gate = CompositeGate(gate1, 'and', gate2)

With the shorthand

>>> intersection_gate = gate1 & gate2

As another example, let’s invert a gate.

The longway:

>>> inverted_gate = CompositeGate(gate1, 'invert')

The shortway:

>>> inverted_gate = ~gate1

Warning

When using the shorthand notation you must use the syntax ‘~’, ‘&’, ‘|’. Do NOT use ‘and’, ‘or’, ‘not’.

__init__(gate1, how, gate2=None)[source]

Instead of using this class directly to create composite gates, it is recommended you use the shorthand syntax presented directly above.

gate1 : subclass of Gate how : [‘and’ | ‘or’ | ‘invert’ | ‘xor’]

Describes how to combine the gates
gate2 : subclass of Gate
Need to specify is how is anything but ‘not’.

Methods

__init__(gate1, how[, gate2]) Instead of using this class directly to create composite gates, it is recommended you use the shorthand syntax presented directly above.
plot([flip, ax_channels, ax]) Plots the gate.

Attributes

name