rnalysis.filtering.CountFilter.normalize_rle

CountFilter.normalize_rle(inplace: bool = True, return_scaling_factors: bool = False)

Normalizes the count matrix using the ‘Relative Log Expression’ (RLE) method (Anders and Huber 2010). This is the default normalization method used by R’s DESeq2. To calculate the Relative Log Expression scaling factors, you first generate a pseudo-sample by calculating the geometric mean expression of each gene across samples. You then calculate the gene-wise ratio of expression between each sample and the pseudo-sample. You then pick the median ratio within each sample as the scaling factor for that sample.

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

  • return_scaling_factors (bool (default=False)) – if True, return a DataFrame containing the calculated scaling factors.

Returns

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

Examples
>>> from rnalysis import filtering
>>> c = filtering.CountFilter("tests/test_files/counted.csv")
>>> c.normalize_rle()

Normalized 22 features. Normalized inplace.