Skip to contents

Normalizes raw counts from counts slot in TapestriExperiment and returns the object with normalized counts in the normcounts slot. Also calculates the standard deviation for each probe using normalized counts and adds it to rowData.

Usage

calcNormCounts(TapestriExperiment, method = "mb", scaling.factor = NULL)

Arguments

TapestriExperiment

TapestriExperiment object.

method

Character, normalization method. Default "mb".

scaling.factor

Numeric, optional number to scale normalized counts if method == "libNorm". Default NULL.

Value

TapestriExperiment object with normalized counts added to normcounts slot.

Details

"mb" method performs the same normalization scheme as in Mission Bio's mosaic package for python: Counts for each barcode are normalized relative to their barcode's mean and probe counts are normalized relative to their probe's median. "libNorm" method preforms library size normalization, returning the proportion of counts of each probe within a cell. The proportion is multiplied by scaling.factor if provided.

Examples

tap.object <- newTapestriExperimentExample() # example TapestriExperiment object
#>  Moving gRNA probe  to `altExp` slot "grnaCounts".
#>  Moving barcode probe  to `altExp` slot "barcodeCounts".
#>  Moving chrY probe(s) probe_231, probe_232, probe_233, probe_234, probe_235, probe_236, probe_237, probe_238, probe_239, and probe_240 to `altExp` slot "chrYCounts".
tap.object <- calcNormCounts(tap.object)