split.DGEList: Split a DGEList object by a factor of samples (default) or...

View source: R/split.DGEList.R

split.DGEListR Documentation

Split a DGEList object by a factor of samples (default) or genes

Description

Split a DGEList object by a factor of samples (default) or genes

Usage

## S3 method for class 'DGEList'
split(x, f, drop = FALSE, bySample = TRUE, sampleDropLevels = TRUE, ...)

splitDGEList(x, f, drop = FALSE, bySample = TRUE, sampleDropLevels = TRUE, ...)

Arguments

x

A DGEList object

f

A factor vector. Other types will be coereced into factors.

drop

Not used now

bySample

Logical, if TRUE, the samples are split. Otherwise, genes are split.

sampleDropLevels

Logical, if TRUE, unused levels in factors in the sample annotation are dropped

...

Not used so far.

Functions

  • splitDGEList(): A wrapper of split.DGEList

Examples

y1 <- matrix(rnbinom(1000, mu=5, size=2), ncol=4)
genes1 <- data.frame(GeneSymbol=sprintf("Gene%d", 1:nrow(y1)),
  GeneType=gl(5,50))
rownames(y1) <- rownames(genes1) <- 1:nrow(y1)
anno1 <- data.frame(treatment=gl(2,2, labels=c("ctrl", "tmt")),
    donor=factor(rep(c(1,2), each=2)))
d1 <- DGEList(counts=y1, genes=genes1, samples=anno1)

d1SampleSplit <- split(d1, d1$samples$donor)
d1GeneSplit <- split(d1, d1$genes$GeneType, bySample=FALSE)


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