cytoflow.utility.scale¶
Base classes and functions for cytoflow
scales.
IScale
– the traits.has_traits.Interface
that scales must implement
ScaleMixin
– provides useful functionality that scales can inherit
scale_factory
– make a new instance of a scale
register_scale
– register a new type of scale
set_default_scale
, get_default_scale
– sets and gets the default scale
- class cytoflow.utility.scale.IScale(adaptee, default=<class 'traits.adaptation.adaptation_error.AdaptationError'>)[source]¶
Bases:
traits.has_traits.Interface
An interface for various ways we could rescale flow data.
- name¶
The name of this view (for serialization, UI, etc.)
- Type
Str
- experiment¶
The experiment this scale is to be applied to. Needed because some scales have parameters estimated from data.
- Type
Instance(Experiment)
- channel¶
Which channel to scale. Needed because some scales have parameters estimated from data.
- Type
Str
- condition¶
What condition to scale. Needed because some scales have parameters estimated from the a condition. Must be a numeric condition; else instantiating the scale should fail.
- Type
Str
- statistic¶
What statistic to scale. Needed because some scales have parameters estimated from a statistic. The statistic must be numeric or an iterable of numerics; else instantiating the scale should fail.
- Type
Tuple(Str, Str)
- data¶
What raw data to scale.
- Type
array_like
- class cytoflow.utility.scale.ScaleMixin(**kwargs)[source]¶
Bases:
traits.has_traits.HasStrictTraits
Provides useful functionality that scales can inherit.
- cytoflow.utility.scale.scale_factory(scale, experiment, **scale_params)[source]¶
Make a new instance of a named scale.
- Parameters
scale (string) – The name of the scale to build
experiment (Experiment) – The experiment to use to parameterize the new scale.
**scale_params (kwargs) – Other parameters to pass to the scale constructor
- cytoflow.utility.scale.register_scale(scale_class)[source]¶
Register a new scale for the
scale_factory
andScaleEnum
.
- cytoflow.utility.scale.get_default_scale()[source]¶
Get the defaults scale set with
set_default_scale