Protein.normalize_reads#
missionbio.mosaic.protein.Protein.normalize_reads
- Protein.normalize_reads(method: str = 'CLR', jitter: float = 0.5, scale: Optional[float] = None, sample_size: int = 1000, random_state: Optional[int] = None) Optional[NSP] #
Normalize read counts.
This adds normalized_counts to the assay layers.
- Parameters:
- methodstr
CLR, asinh, NSP, or ANSP which stand for Centered Log Ratio, Inverse Hyperbolic transformation and Noise corrected and Scaled Protein counts, and Approximate NSP respectively. Approximate NSP executes in constant time for large datasets while NSPs execution time increases linearly. But ANSP only uses a random subsample of the data to estimate the model parameters.
- jitterfloat
The standard deviation of the jitter to be added to the read counts before applying the normalization. The jitter is sampled from a normal distribution cenetered at 0. This is only applicable for NSP and asinh
- scalefloat
The amount by which the read counts are scaled down. This is applicable only for NSP. If ‘None’ then the algorithm tries to estimate it from the read distribution.
- sample_sizeint
The number of cells to use for estimating the model parameters in ANSP.
- random_state: int
The random state to use for the NSP and asinh methods.
- Returns:
- None or nsp: Theclass:~missionbio.mosaic.algorithm.nsp.NSP object used for
normalization when method is NSP or ANSP. None otherwise.
- Raises:
- ValueError
When one of the supported methods is not provided.
< Class Protein