filterByCPM.DGEList: Filter lowly expressed genes by CPM in DGEList

View source: R/filterByCPM.R

filterByCPM.DGEListR Documentation

Filter lowly expressed genes by CPM in DGEList

Description

Filter lowly expressed genes by CPM in DGEList

Usage

## S3 method for class 'DGEList'
filterByCPM(
  obj,
  minCPM = 1,
  minCount = minGroupCount(obj),
  lib.size = NULL,
  ...
)

Arguments

obj

A DGEList object

minCPM

Numeric, the minimum CPM accepted as expressed in one sample

minCount

Integer, how many samples must have CPM larger than minCPM to keep this gene?

lib.size

Integers of library size, or NULL

...

Not used

Value

Another DGEList object, with lowly expressed genes removed. The original counts and gene annotation can be found in counts.unfiltered and genes.unfiltered fields, respectively. The logical vector of the filter is saved in the cpmFilter field.

Examples

set.seed(1887)
mat <- rbind(matrix(rbinom(150, 5, 0.25), nrow=25), rep(0, 6))
d <- DGEList(mat, group=rep(1:3, each=2), 
             genes=data.frame(Gene=sprintf("Gene%d", 1:nrow(mat))))
df <- filterByCPM(d)

nrow(df$counts.unfiltered) ## 26
nrow(df$counts) ## 25


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