cytoflow.utility.hlog_scale¶
-
class
cytoflow.utility.hlog_scale.
HlogScale
(**kwargs)[source]¶ Bases:
cytoflow.utility.scale.ScaleMixin
A scale that transforms the data using the hyperlog function.
This scaling method implements a “linear-like” region around 0, and a “log-like” region for large values, with a smooth transition between them.
The transformation has one parameter, b, which specifies the location of the transition from linear to log-like. The default, 500, is good for 18-bit scales and not good for other scales.
-
b
¶ the location of the transition from linear to log-like.
Type: Float (default = 500)
References
- [1] Hyperlog-a flexible log-like transform for negative, zero, and positive
- valued data. Bagwell CB. Cytometry A. 2005 Mar;64(1):34-42. PMID: 15700280 http://onlinelibrary.wiley.com/doi/10.1002/cyto.a.20114/abstract
-
name
= 'hlog'¶
-
-
class
cytoflow.utility.hlog_scale.
MatplotlibHlogScale
(axis, **kwargs)[source]¶ Bases:
traits.has_traits.HasTraits
,matplotlib.scale.ScaleBase
-
name
= 'hlog'¶
-
get_transform
()[source]¶ Returns the matplotlib.transform instance that does the actual transformation
-
set_default_locators_and_formatters
(axis)[source]¶ Set the locators and formatters to reasonable defaults for linear scaling.
-
class
HlogTransform
(**kwargs)[source]¶ Bases:
traits.has_traits.HasTraits
,matplotlib.transforms.Transform
-
input_dims
= 1¶
-
output_dims
= 1¶
-
is_separable
= True¶
-
has_inverse
= True¶
-
transform_non_affine
(values)[source]¶ Performs only the non-affine part of the transformation.
transform(values)
is always equivalent totransform_affine(transform_non_affine(values))
.In non-affine transformations, this is generally equivalent to
transform(values)
. In affine transformations, this is always a no-op.Accepts a numpy array of shape (N x
input_dims
) and returns a numpy array of shape (N xoutput_dims
).Alternatively, accepts a numpy array of length
input_dims
and returns a numpy array of lengthoutput_dims
.
-
-
class
InvertedLogicleTransform
(**kwargs)[source]¶ Bases:
traits.has_traits.HasTraits
,matplotlib.transforms.Transform
-
input_dims
= 1¶
-
output_dims
= 1¶
-
is_separable
= True¶
-
has_inverse
= True¶
-
transform_non_affine
(values)[source]¶ Performs only the non-affine part of the transformation.
transform(values)
is always equivalent totransform_affine(transform_non_affine(values))
.In non-affine transformations, this is generally equivalent to
transform(values)
. In affine transformations, this is always a no-op.Accepts a numpy array of shape (N x
input_dims
) and returns a numpy array of shape (N xoutput_dims
).Alternatively, accepts a numpy array of length
input_dims
and returns a numpy array of lengthoutput_dims
.
-
-
-
class
cytoflow.utility.hlog_scale.
HlogMajorLocator
[source]¶ Bases:
matplotlib.ticker.Locator
Determine the tick locations for hlog axes. Based on matplotlib.LogLocator
-
class
cytoflow.utility.hlog_scale.
HlogMinorLocator
[source]¶ Bases:
matplotlib.ticker.Locator
Determine the tick locations for logicle axes. Based on matplotlib.LogLocator
-
cytoflow.utility.hlog_scale.
hlog
(x, b, r, d)[source]¶ Base 10 hyperlog transform.
Parameters: - x (num | num iterable) – values to be transformed.
- b (num) – Parameter controling the location of the shift from linear to log transformation.
- r (num (default = 10**4)) – maximal transformed value.
- d (num (default = log10(2**18))) – log10 of maximal possible measured value. hlog_inv(r) = 10**d
Returns: Return type: Array of transformed values.