cytoflow.operations.i_operation¶
i_operation
contains just one class:
IOperation
– an traits.has_traits.Interface
that all operation classes must implement.
- class cytoflow.operations.i_operation.IOperation(adaptee, default=<class 'traits.adaptation.adaptation_error.AdaptationError'>)[source]¶
Bases:
traits.has_traits.Interface
The basic interface for an operation on cytometry data.
- id¶
a unique identifier for this class. prefix:
edu.mit.synbio.cytoflow.operations
- Type
Str
- friendly_id¶
The operation’s human-readable id (like
Threshold
orK-means
). Used for UI implementations.- Type
Str
- name¶
The name of this IOperation instance (like
Debris_Filter
). Useful for UI implementations; sometimes used for naming gates’ metadata- Type
Str
- 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.
- Parameters
experiment (
Experiment
) – theExperiment
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.
- Raises
CytoflowOpException – If the operation can’t be be completed because of bad op parameters.
- apply(experiment)[source]¶
Apply an operation to an experiment.
- Parameters
experiment (
Experiment
) – theExperiment
to apply this op to- Returns
the old
Experiment
with this operation applied- Return type
- Raises
CytoflowOpException – If the operation can’t be be completed because of bad op parameters.
- default_view(**kwargs)[source]¶
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 theIOperation
; sometimes,default_view
is the only way to get the view (ie, it’s not useful when it doesn’t reference anIOperation
instance.)