FlowCytometryTools.FCPlate.transform

FCPlate.transform(transform, direction='forward', share_transform=True, channels=None, return_all=True, auto_range=True, use_spln=True, get_transformer=False, ID=None, apply_now=True, args=(), **kwargs)[source]

Apply transform to each Measurement in the Collection.

Return a new Collection with transformed data.

Warning

The new Collection will hold the data for ALL Measurements in memory! When analyzing multiple collections (e.g., multiple 96-well plates), it may be necessary to only work one collection at a time. Please refer to the tutorials to see how this can be done.

Parameters:
  • transform ([‘hlog’ | ‘tlog’ | ‘glog’ | callable]) –

    Specifies the transformation to apply to the data.

    • callable : a callable that does a transformation (should accept a number or array), or one of the supported named transformations.
  • direction ([‘forward’ | ‘inverse’]) – Direction of transformation.
  • channels (str | list of str | None) –

    Names of channels to transform. If None is given, all channels will be transformed.

    Warning

    Remember that transforming all channels does not always make sense. For example, when working with the time channel, one should probably keep the data as is.

  • return_all (bool) – True - return all columns, with specified ones transformed. False - return only specified columns.
  • auto_range (bool) –

    If True data range (machine range) is automatically extracted from $PnR field of metadata.

    Warning

    If the data has been previously transformed its range may not match the $PnR value. In this case, auto_range should be set to False.

  • use_spln (bool) – If True th transform is done using a spline. See Transformation.transform for more details.
  • get_transformer (bool) – If True the transformer is returned in addition to the new Measurement.
  • args – Additional positional arguments to be passed to the Transformation.
  • kwargs – Additional keyword arguments to be passed to the Transformation.
  • ID (hashable | None) – ID for the resulting collection. If None is passed, the original ID is used.
Returns:

  • new (FCCollection) – New collection containing the transformed measurements.
  • transformer (Transformation) – The Transformation applied to the measurements. Only returned if get_transformer=True & share_transform=True.

Examples

>>> trans = original.transform('hlog')
>>> trans = original.transform('tlog', th=2)
>>> trans = original.transform('hlog', d=log10(2**18), auto_range=False)
>>> trans = original.transform('hlog', r=1000, use_spln=True, get_transformer=True)
>>> trans = original.transform('hlog', channels=['FSC-A', 'SSC-A'], b=500).transform('hlog', channels='B1-A', b=100)