EllipsoidGate Class

class flowkit.gates.EllipsoidGate(gate_name, dimensions, coordinates, covariance_matrix, distance_square)

Represents a GatingML Ellipsoid Gate

An EllipsoidGate must have at least 2 dimensions, and must specify a mean value (center of the ellipsoid), a covariance matrix, and a distance square (the square of the Mahalanobis distance).

Create an EllipsoidGate instance.

Parameters:
  • gate_name – text string for the name of the gate

  • dimensions – list of Dimension instances

  • coordinates – center point of the ellipsoid for n-dimensions

  • covariance_matrix – Covariance matrix for the ellipsoid shape (NxN array)

  • distance_square – square of the Mahalanobis distance, controlling the size of the ellipsoid. The distance square parameter is conceptually similar to the number of standard deviations representing the boundary for an n-dimensional distribution of points.

apply(df_events)

Apply gate to events in given pandas DataFrame. The given DataFrame must have columns matching the Dimension IDs for the Dimension instances defined for the gate.

Parameters:

df_events – pandas DataFrame with column labels matching Dimension IDs

Returns:

NumPy array of boolean values for each event (True is inside gate)

get_dimension(dim_id)

Retrieve the Dimension instance given the dimension ID

Parameters:

dim_id – Dimension ID

Returns:

Dimension instance

get_dimension_ids()

Retrieve all gate Dimension IDs in order

Returns:

list of Dimension ID strings