rnalysis.filtering.DESeqFilter.filter_abs_log2_fold_change

DESeqFilter.filter_abs_log2_fold_change(abslog2fc: float = 1, opposite: bool = False, inplace: bool = True)

Filters out all features whose absolute log2 fold change is below the indicated threshold. For example: if log2fc is 2.0, all features whose log2 fold change is between 1 and -1 (went up less than two-fold or went down less than two-fold) will be filtered out.

Parameters
  • abslog2fc – The threshold absolute log2 fold change for filtering out a feature. Float or int. All features whose absolute log2 fold change is lower than log2fc will be filtered out.

  • 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_abs_log2_fold_change(2) # keep only rows whose log2(fold change) is >=2 or <=-2
Filtered 1 features, leaving 28 of the original 29 features. Filtered inplace.