edgeR output error and data frame setting
2
0
Entering edit mode
amoltej ▴ 10
@amoltej-7192
Last seen 6.5 years ago
Australia

Hi, 

I have two questions about EdgeR pipeline. I am dealing with no replicate situation and have two conditions to check the differential expression. I am trying to apply GLM model for the analysis. I am bit confused about the design. 

I am running following commands to setup design - 

design <- model.matrix(~group, data=cds$samples)
design
 (Intercept) groupRest
Rest           1         1
Bcyt           1         0
attr(,"assign")
[1] 0 1
attr(,"contrasts")
attr(,"contrasts")$group
[1] "contr.treatment"

Is this design right for the experiment? how to set up to proper design for the experiment?

2) with this setup I carried out glm analysis. but the end I am not able to export my results in to the table. I run following command for exporting data -

write.table(lrt,file="EdgeR_all.txt",sep="\t",quote=F)

After this I am getting following error -

Error in data.frame(coefficients = c(-0.55319099962599, -0.597451121359484,  : 
  arguments imply differing number of rows: 25299, 1, 2

Please help me to solve this problem

Thank you in advance

EdgeR data.frame glmLRT • 1.6k views
ADD COMMENT
1
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 20 hours ago
The city by the bay

Your design looks fine; dropping the second coefficient will give you DE between your two libraries. Obviously, there will be issues when you don't have any replicates. Read the advice in Section 2.10 of the user's guide, if you haven't already. On the other matter, if you want to save results, save the output of topTags instead:

save.me <- topTags(lrt, n=Inf, sort.by="none")
write.table(save.tags, file="EdgeR_all.txt", sep="\t", quote=FALSE)
ADD COMMENT
0
Entering edit mode

Thank you Aaron!

Amol

ADD REPLY
0
Entering edit mode

Hi Aaron I have another que. What will happen if I setup design without intercept?

ADD REPLY
0
Entering edit mode

Then you'll have to use contrast=c(-1, 1) in glmLRT in order to compare the two samples.

ADD REPLY
1
Entering edit mode
@gordon-smyth
Last seen 12 hours ago
WEHI, Melbourne, Australia

Considering that you only have two samples, why do you even bother with a design matrix? Why not simply:

out <- exactTest(cds, dispersion=0.05)
topTags(out)

That will automatically find genes that are DE between the two groups as set in cds$samples$group.

ADD COMMENT
0
Entering edit mode

Thanks Gordon for replying,

I wanted to test GLM model for the data thats why I wanted to that! 

 

ADD REPLY

Login before adding your answer.

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