rnalysis.filtering.CountFilter.normalize_with_scaling_factors

CountFilter.normalize_with_scaling_factors(scaling_factor_fname: str | Path, inplace: bool = True)

Normalizes the reads in the CountFilter using pre-calculated scaling factors. Receives a table of sample names and their corresponding scaling factors, and divides each column in the CountFilter by the corresponding scaling factor.

Parameters:
  • scaling_factor_fname (str or pathlib.Path) – the .csv file which contains scaling factors for the different libraries.

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

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_with_scaling_factors("tests/test_files/scaling_factors.csv")

Normalized 22 features. Normalized inplace.