Question: DESeq2 ANOVADEV giving strange result
gravatar for szenitha
3.0 years ago by
szenitha0 wrote:

Hello All,

I am using DESeq2 to perform something like a one-way ANOVA. When I tried running the code on the datasets I have, it seems to be working fine for all except for one dataset. This dataset is from the organism fly while the others are either mouse or human.When I  run deseq2 with 'LRT' for the fly dataset I get the following result.Below is the code I used. Since there were hidden batch effects for the dataset, I have included it as co-variates in the design.

dds.fc<-DESeqDataSetFromMatrix(data,colData=pheno,design=~ condition)

# if hidden batch is present

#compute null and full model
mod =model.matrix(~condition, data=colData(dds.fc))
mod0 = model.matrix(~1,data=colData(dds.fc))

#Get normalized data
dds.norm <- dds.fc
data_normalized <- counts(dds.norm, normalized=TRUE) #normalizing data =,mod,method="be")

#as default remove 3 surrogate variables


svobj = sva(assay(rld), mod, mod0,

ddssva <- dds.fc
ddssva$SV1 <- svobj$sv[,1]
ddssva$SV2 <- svobj$sv[,2]
ddssva$SV3 <- svobj$sv[,3]
design(ddssva) <- ~ SV1 + SV2 + SV3 + condition

#execute if no batch effect   dds<-DESeq(dds.fc,test = "LRT",reduced = ~1)

#if hidden batch effect present then

dds<-DESeq(ddssva,test = "LRT",reduced = ~1)


deseq2 anova • 463 views
ADD COMMENTlink modified 3.0 years ago by Michael Love25k • written 3.0 years ago by szenitha0
Answer: DESeq2 ANOVADEV giving strange result
gravatar for Michael Love
3.0 years ago by
Michael Love25k
United States
Michael Love25k wrote:

Your last likelihood ratio test is testing whether any of the variables (SV1 + SV2 + SV3 + condition) are informative for describing differences in counts across samples, because you used a reduced design of ~1.

The surrogate variables should be included in the reduced design.

The typical use of an LRT would be, e.g., if you had full=~batch + condition, you would have reduced=~batch.

ADD COMMENTlink written 3.0 years ago by Michael Love25k

Thank you Michael. I now included the surrogate variables and I'm still getting the same output.
dds<-DESeq(ddssva,test = "LRT",reduced = ~SV1+SV2+SV3)

ADD REPLYlink written 3.0 years ago by szenitha0

"getting the same output"

You should't get the same output if you perform a new LRT with different reduced design. Maybe check over your code.

Also, you'll need to describe in more detail what you are seeing that you think is in error.

ADD REPLYlink written 3.0 years ago by Michael Love25k

Apologies. I went over my code again and realized why I was getting such an output. There was a problem during reading of a file.My code works fine now. Thank you for helping me out.

ADD REPLYlink written 3.0 years ago by szenitha0
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 312 users visited in the last hour