rnalysis.filtering.CountFilter.number_filters

CountFilter.number_filters(column: ColumnName, operator: Literal['greater than', 'equals', 'lesser than'], value: float, opposite: bool = False, inplace: bool = True)

Applay a number filter (greater than, equal, lesser than) on a particular column in the Filter object.

Parameters
  • column (str) – name of the column to filter by

  • operator (str: 'gt' / 'greater than' / '>', 'eq' / 'equals' / '=', 'lt' / 'lesser than' / '<') – the operator to filter the column by (greater than, equal or lesser than)

  • value (float) – the value to filter by

  • opposite (bool) – If True, the output of the filtering will be the OPPOSITE of the specified (instead of filtering out X, the function will filter out anything BUT X). If False (default), the function will filter as expected.

  • 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.

Returns

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

Examples
>>> from rnalysis import filtering
>>> filt = filtering.Filter('tests/test_files/test_deseq.csv')
>>> #keep only rows that have a value greater than 5900 in the column 'baseMean'.
>>> filt.number_filters('baseMean','gt',5900)
Filtered 26 features, leaving 2 of the original 28 features. Filtered inplace.
>>> filt = filtering.Filter('tests/test_files/test_deseq.csv')
>>> #keep only rows that have a value greater than 5900 in the column 'baseMean'.
>>> filt.number_filters('baseMean','greater than',5900)
Filtered 26 features, leaving 2 of the original 28 features. Filtered inplace.
>>> filt = filtering.Filter('tests/test_files/test_deseq.csv')
>>> #keep only rows that have a value greater than 5900 in the column 'baseMean'.
>>> filt.number_filters('baseMean','>',5900)
Filtered 26 features, leaving 2 of the original 28 features. Filtered inplace.