View source: R/split.DGEList.R
split.DGEList | R Documentation |
Split a DGEList object by a factor of samples (default) or genes
## S3 method for class 'DGEList'
split(x, f, drop = FALSE, bySample = TRUE, sampleDropLevels = TRUE, ...)
splitDGEList(x, f, drop = FALSE, bySample = TRUE, sampleDropLevels = TRUE, ...)
x |
A |
f |
A factor vector. Other types will be coereced into factors. |
drop |
Not used now |
bySample |
Logical, if |
sampleDropLevels |
Logical, if |
... |
Not used so far. |
splitDGEList()
: A wrapper of split.DGEList
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.