rnalysis.filtering.DESeqFilter.number_filtersο
- DESeqFilter.number_filters(column: ColumnName, operator: Literal['greater than', 'equals', 'lesser than', 'abs greater 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.