rnalysis.filtering.DESeqFilter.filter_fold_change_directionο
- DESeqFilter.filter_fold_change_direction(direction: Literal['pos', 'neg'] = 'pos', opposite: bool = False, inplace: bool = True)ο
Filters out features according to the direction in which they changed between the two conditions.
- Parameters:
direction β βposβ or βnegβ. If βposβ, will keep only features that have positive log2foldchange. If βnegβ, will keep only features that have negative log2foldchange.
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 DESeqFilter object. If False, the function will return a new DESeqFilter instance and the current instance will not be affected.
- Returns:
If βinplaceβ is False, returns a new instance of DESeqFilter.
- Examples:
>>> from rnalysis import filtering >>> d = filtering.DESeqFilter('tests/test_files/sample_deseq.csv') >>> d.filter_fold_change_direction('pos') # keep only rows with a positive log2(fold change) value Filtered 3 features, leaving 26 of the original 29 features. Filtered inplace.
>>> d = filtering.DESeqFilter('tests/test_files/sample_deseq.csv') >>> d.filter_fold_change_direction('neg') # keep only rows with a negative log2(fold change) value Filtered 27 features, leaving 2 of the original 29 features. Filtered inplace.
>>> d = filtering.DESeqFilter('tests/test_files/sample_deseq.csv') >>> d.filter_fold_change_direction('pos', opposite=True) # keep only rows with a non-positive log2(fold change) value Filtered 26 features, leaving 3 of the original 29 features. Filtered inplace.