filterByCPM.EdgeObject: Filter EdgeObj and remove lowly expressed genes

View source: R/filterByCPM.R

filterByCPM.EdgeObjectR Documentation

Filter EdgeObj and remove lowly expressed genes

Description

Filter EdgeObj and remove lowly expressed genes

Usage

## S3 method for class 'EdgeObject'
filterByCPM(obj, minCPM = 1, minCount = minGroupCount(obj), ...)

Arguments

obj

An EdgeObject object

minCPM

Minimal CPM value, see descriptions below

minCount

Minimal count of samples in which the CPM value is no less than minCPM

...

Not used

The filter is recommended by the authors of the edgeR package to remove lowly expressed genes, since including them in differential gene expression analysis will cause extreme differential expression fold-changes of lowly and stochastically expressed genes, and increase false positive rates.

The filter removes genes that are less expressed than 1 copy per million reads (cpm) in at least n samples, where n equals the number of samples in the smallest group of the design.

Examples


myFac <- gl(3,2)
set.seed(1234)
myMat <- matrix(rpois(1200,100), nrow=200, ncol=6)
myMat[1:3,] <- 0
myEdgeObj <- EdgeObject(myMat, 
                       DesignContrast(designMatrix=model.matrix(~myFac),
                        contrastMatrix=matrix(c(0,1,0), ncol=1), groups=myFac),
                        fData=data.frame(GeneSymbol=sprintf("Gene%d", 1:200)))
myFilteredEdgeObj <- filterByCPM(myEdgeObj)
dim(counts(myEdgeObj))
dim(counts(myFilteredEdgeObj))
## show unfiltered count matrix
dim(counts(myFilteredEdgeObj, filter=FALSE))


bedapub/ribiosNGS documentation built on Feb. 10, 2025, 12:34 a.m.