rnalysis.filtering.CountFilter.transform

CountFilter.transform(function: Union[Literal['Box-Cox', 'log2', 'log10', 'ln', 'Standardize'], Callable], columns: Union[ColumnNames, Literal['all']] = 'all', inplace: bool = True, **function_kwargs)

Transform the values in the Filter object with the specified function.

Parameters
  • function (Callable or str ('logx' for base-x log of the data + 1, 'box-cox' for Box-Cox transform of the data + 1, 'standardize' for standardization)) – The function or function name to be applied.

  • columns (str, list of str, or 'all' (default='all')) – The columns to which the transform should be applied.

  • inplace (bool (default=True)) – If True (default), filtering will be applied to the current Filter object. If False, the function will return a new Filter instance and the current instance will not be affected.

  • function_kwargs – Any additional keyworded arguments taken by the supplied function.

Returns

If ‘inplace’ is False, returns a new instance of the Filter object.

Examples
>>> from rnalysis import filtering
>>> filt = filtering.Filter('tests/test_files/counted.csv')
>>> filt_log10 = filt.transform('log10', inplace=False)
Transformed 22 features. Transformation result saved to new object.
>>> filt.transform(lambda x: x+1, columns=['cond1','cond4'])
Transformed 22 features. Transformed inplace.