library(zebrafishRNASeq)
data(zfGenes)
## run on a subset of genes for time reasons
## (real analyses should be performed on all genes)
genes <- rownames(zfGenes)[grep("^ENS", rownames(zfGenes))]
spikes <- rownames(zfGenes)[grep("^ERCC", rownames(zfGenes))]
set.seed(123)
idx <- c(sample(genes, 1000), spikes)
seq <- newSeqExpressionSet(as.matrix(zfGenes[idx,]))
# RUVg normalization
seqRUVg <- RUVg(seq, spikes, k=1)
pData(seqRUVg)
head(normCounts(seqRUVg))
plotRLE(seq, outline=FALSE, ylim=c(-3, 3))
plotRLE(seqRUVg, outline=FALSE, ylim=c(-3, 3))
barplot(as.matrix(pData(seqRUVg)), beside=TRUE)
Run the code above in your browser using DataLab