class cytoflow.operations.i_operation.IOperation[source]

Bases: traits.has_traits.Interface

The basic interface for an operation on cytometry data.


a unique identifier for this class. prefix:


The operation’s human-readable id (like Threshold or K-means). Used for UI implementations.


The name of this IOperation instance (like Debris_Filter). Useful for UI implementations; sometimes used for naming gates’ metadata

estimate(experiment, subset=None)[source]

Estimate this operation’s parameters from some data.

For operations that are data-driven (for example, a mixture model), estimate the operation’s parameters from an experiment.

  • experiment (Experiment) – the Experiment to use in the estimation.
  • subset (Str (optional)) – a string passed to pandas.DataFrame.query() to select the subset of data on which to run the parameter estimation.

CytoflowOpException – If the operation can’t be be completed because of bad op parameters.


Apply an operation to an experiment.

Parameters:experiment (Experiment) – the Experiment to apply this op to
Returns:the old Experiment with this operation applied
Return type:Experiment
Raises:CytoflowOpException – If the operation can’t be be completed because of bad op parameters.

Many operations have a “default” view. This can either be a diagnostic for the operation’s estimate() method, an interactive for setting gates, etc. Frequently it makes sense to link the properties of the view to the properties of the IOperation; sometimes, default_view() is the only way to get the view (ie, it’s not useful when it doesn’t reference an IOperation instance.)

Parameters:**kwargs (Dict) – The keyword args passed to the view’s constructor
Returns:the IView instance
Return type:IView