How to improve batch correction
0
0
Entering edit mode
8 months ago

RUVG correction:

image: RUVG correction

I am not satisfied with the RLE plot and I wonder if there are anything to improve it?

design = model.matrix(~factor+batch)
design=as.matrix(design)
y <- DGEList(counts=counts(set1), group=factor)
y <- calcNormFactors(y, method="TMM")
y <- estimateGLMCommonDisp(y, design)
y <- estimateGLMTagwiseDisp(y, design)
fit <- glmFit(y, design)
lrt <- glmLRT(fit, coef=ncol(fit$design))
top <- topTags(lrt, n=nrow(set1))$table
empirical <- rownames(set1)[which(!(rownames(set1) %in% rownames(top)[1:5000]))]

library(RUVSeq)

set2 <- RUVg(set1, empirical, k=20)

W=pData(set2)

ruv_counts=as.data.frame(set2@assayData[["normalizedCounts"]])

rownames(W)=NULL

W=W[,-1]

W=as.matrix(W)

sce2 <- SingleCellExperiment(assays = list(counts =ruv_counts))

colData(sce2)$Institute=sampleInfo$Sample.supplying.institution
colData(sce2)

plotRLE(sce2, exprs_values = "counts", exprs_logged=FALSE, color_by = colData(sce2))+
 ggtitle("After RUVg correction")
ruvg batch-correction rna-seq • 221 views
ADD COMMENT

Login before adding your answer.

Traffic: 1858 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6