Search
Question: DESeq2 ANOVADEV giving strange result
0
gravatar for szenitha
2.1 years ago by
szenitha0
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
dds.norm=estimateSizeFactors(dds.norm)
data_normalized <- counts(dds.norm, normalized=TRUE) #normalizing data

n.sv = num.sv(data_normalized,mod,method="be")

#as default remove 3 surrogate variables

rld<-rlogTransformation(dds.fc)

svobj = sva(assay(rld), mod, mod0, n.sv=3)

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)

res<-results(dds)

http://imgur.com/DYSR8LZ
 

ADD COMMENTlink modified 2.1 years ago by Michael Love20k • written 2.1 years ago by szenitha0
1
gravatar for Michael Love
2.1 years ago by
Michael Love20k
United States
Michael Love20k 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 2.1 years ago by Michael Love20k

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 2.1 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 2.1 years ago by Michael Love20k

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 2.1 years ago by szenitha0
Please log in to add an answer.

Help
Access

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