ct.filterReads: Remove low-abundance elements from an ExpressionSet object

View source: R/discardTraceReads.R

ct.filterReadsR Documentation

Remove low-abundance elements from an ExpressionSet object

Description

This function removes gRNAs only present in very low abundance across all samples of a pooled Crispr screening experiment. In most cases very low-abundance guides are the result of low-level contamination from other libraries, and often distort standard normalization approaches. This function trims gRNAs in a largely heuristic way, assuming that the majority of 'real' gRNAs within the library are comparably abundant in at least some of the samples (such as unexpanded controls), and that contaminants are present at negligible levels. Specifically, the function trims the trim most abundant guides from the upper tail of each log-transformed sample distribution, and then omits gRNAs whose abundances are always less than 1/(2^log2.ratio) of this value.

Usage

ct.filterReads(
  eset,
  trim = 1000,
  log2.ratio = 4,
  sampleKey = NULL,
  plot.it = TRUE,
  read.floor = NULL
)

Arguments

eset

An unnormalized ExpressionSet object containing, at minimum, a matrix of gRNA counts accessible with exprs().

trim

The number of gRNAs to be trimmed from the top of the distribution before estimating the abundance range. Empirically, this usually should be equal to about 2 to 5 percent of the guides in the library.

log2.ratio

Maximum abundance of contaminant gRNAs, expressed on the log2 scale from the top of the trimmed range of each sample. That is, log2.ratio = 4 means to discard all gRNAs whose abundance is (1/2)^4 of the trimmed maximum.

sampleKey

An (optional) sample key, supplied as an ordered factor linking the samples to experimental variables. The names attribute should exactly match those present in eset, and the control set is assumed to be the first level.

plot.it

Logical value indicating whether to plot the adjusted gRNA densities on the default device.

read.floor

Optionally, the minimum number of reads required for each gRNA.

Value

An ExpressionSet object, with trace-abundance gRNAs omitted.

Author(s)

Russell Bainer

Examples

data('es')
ct.filterReads(es)

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