ct.normalizeBySlope: Normalize sample abundance estimates by the slope of the...

View source: R/Normalization.R

ct.normalizeBySlopeR Documentation

Normalize sample abundance estimates by the slope of the values in the central range


This function normalizes Crispr gRNA abundance estimates by equalizing the slopes of the middle (logged) values of the distribution across samples. Specifically, the algorithm ranks the gRNA abundance estimates within each sample and determines a relationship between rank change and gRNA within a trimmed region of the distribution via a linear fit. It then adjusts each sample such that the center of the logged abundance distribution is strictly horizontal and returns these values as median-scaled counts in the appropriate slot of the input ExpressionObject.


ct.normalizeBySlope(ExpressionObject, trim = 0.25, lib.size = NULL, ...)



An ExpressionSet containing, at minimum, count data accessible by exprs, or an EList object with count data in the $E slot (usually returned by voom).


The proportion to be trimmed from each end of the distributionbefore performing the linear fit; algorithm defaults to 25 fit is performed on the interquartile range.


An optional vector of size factor adjusted library size. Default: NULL means to use sum of column counts as a lib.size.


Other arguments to be passed to ct.normalizeMedians(), if desired.


A renormalized object of the same type as the provided object.


Russell Bainer



#Build the sample key and library sizes for visualization
sk <- ordered(relevel(as.factor(pData(es)$TREATMENT_NAME), 'ControlReference'))
names(sk) <- row.names(pData(es))
ls <- colSums(exprs(es))

es.norm <- ct.normalizeBySlope(es, lib.size= ls)
ct.gRNARankByReplicate(es, sk, lib.size= ls)
ct.gRNARankByReplicate(es.norm, sk, lib.size= ls)

RussBainer/gCrisprTools documentation built on Nov. 5, 2022, 2:35 p.m.