Limma: Correct for location and batch effect
0
0
Entering edit mode
Katherine • 0
@katherine-24218
Last seen 4.0 years ago

Hey,

Is it possible to correct for both a location and batch effect using Limma?

I have 4 surfaces: PET, PE, Glass and Water,

5 locations: A, B, C, D ,E,

and 2 batches: 1, 2

enter OTU<-read.csv("filterotu.csv",header=T,row.names=1) 
targets<-read.csv("sample.csv",header=T,row.names=1)
tax<-read.csv("filter_tax.csv", header=T, row.names=1)
tax <- as.matrix(tax)
group<-factor(targets$surface)
location<-factor(targets$location)
batch<-factor(targets$Batch)
dge<- DGEList(counts=OTU,samples=targets, genes=tax, group=group)
keep<- filterByExpr(dge, min.count = 1)
dge <- dge[keep,,keep.lib.sizes=FALSE]
dge <- calcNormFactors(dge)
design <- model.matrix(~0+group)

I tried using batch=batch and batch2=location but that didn't work.

toplot<-(removeBatchEffect(cpm(dge,log=TRUE,prior.count=5),batch=batch,batch2=location,design=design)) error: "Partial NA coefficients for 7319 probe(s)"

Then I tried the duplicatecorrelation function

corfit <- duplicateCorrelation(v,design,block=batch) toplot <- removeBatchEffect(cpm(dge,log=TRUE,prior.count=5), batch=location, design=design, block=batch, correlation=corfit$consensus)

but when I plotted the MDS it was exactly the same as just removing batch=location alone, as if the block wasn't having any effect.

Anyone got any suggestions?

limma BatchEffect duplicatecorrelation block batch • 1.1k views
ADD COMMENT
0
Entering edit mode

Hi Katherine, which of your questions do you wish to keep open? You should be able to delete one.

ADD REPLY

Login before adding your answer.

Traffic: 954 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