SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Uneven fragment population Truseq mRNA robertami Sample Prep / Library Generation 11 08-29-2013 12:46 AM
Can I use cuffdiff to compare 2 groups? twotwo Bioinformatics 2 06-24-2013 05:52 AM
DESeq newCountDataSet with seven groups yve RNA Sequencing 1 03-01-2012 08:47 AM
how to identify different snps between two groups? slowsmile Bioinformatics 3 01-04-2012 02:51 AM
Why Illumina reads may have uneven coverage? ojy Illumina/Solexa 4 12-12-2011 03:01 AM

Reply
 
Thread Tools
Old 10-22-2013, 12:59 PM   #1
sindrle
Senior Member
 
Location: Norway

Join Date: Aug 2013
Posts: 266
Default edgeR with uneven groups

Hi!
I have two groups:

Healthy=26
Diabetic=22

> colnames(design)
[1] "(Intercept)" "DiseaseDiabetic"
[3] "DiseaseHealthy:Patients2" "DiseaseDiabetic:Patients2"
[5] "DiseaseHealthy:Patients3" "DiseaseDiabetic:Patients3"
[7] "DiseaseHealthy:Patients4" "DiseaseDiabetic:Patients4"
[9] "DiseaseHealthy:Patients5" "DiseaseDiabetic:Patients5"
[11] "DiseaseHealthy:Patients6" "DiseaseDiabetic:Patients6"
[13] "DiseaseHealthy:Patients7" "DiseaseDiabetic:Patients7"
[15] "DiseaseHealthy:Patients8" "DiseaseDiabetic:Patients8"
[17] "DiseaseHealthy:Patients9" "DiseaseDiabetic:Patients9"
[19] "DiseaseHealthy:Patients10" "DiseaseDiabetic:Patients10"
[21] "DiseaseHealthy:Patients11" "DiseaseDiabetic:Patients11"
[23] "DiseaseHealthy:Patients12" "DiseaseDiabetic:Patients12"
[25] "DiseaseHealthy:Patients13" "DiseaseDiabetic:Patients13"
[27] "DiseaseHealthy:TreatmentAfterTreatment" "DiseaseDiabetic:TreatmentAfterTreatment"

> fit <- glmFit(d,design)
Error in glmFit.default(y = y$counts, design = design, dispersion = dispersion, :
Design matrix not of full rank. The following coefficients not estimable:
DiseaseDiabetic:Patients12 DiseaseDiabetic:Patients13

How can I adjust for uneven groups?

Thanks!
sindrle is offline   Reply With Quote
Old 10-22-2013, 01:50 PM   #2
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

You're trying to test with patients that don't exist (since there are only 11 diabetic patients, you can't look for a DiseaseDiabetic:Patients12 interaction). Presumably you mistyped the design formula (it looks like you used ~Disease:Patients + Disease + Disease:Treatment, which doesn't really make sense given your experiment).
dpryan is offline   Reply With Quote
Old 10-22-2013, 01:53 PM   #3
sindrle
Senior Member
 
Location: Norway

Join Date: Aug 2013
Posts: 266
Default

Thats exactly what I did, because I dont understand the command...

design <- model.matrix(~Disease+Disease:Patients+Disease:Treatment)

I will google some. I dont understand the difference between really basic aspects. i.e. "*" vs "+" vs ":" vs "~".

I have fiddled around a bit, Ill try some more..


For future people struggling with the same read this:

https://stat.ethz.ch/pipermail/bioco...ly/053686.html

Last edited by sindrle; 10-22-2013 at 01:58 PM.
sindrle is offline   Reply With Quote
Old 10-22-2013, 02:18 PM   #4
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

Quote:
Originally Posted by sindrle View Post
I will google some. I dont understand the difference between really basic aspects. i.e. "*" vs "+" vs ":" vs "~".
Ah, yeah, that'll cause some issues then. Have a look at a few tutorials like this one (or even just the "details" section of "help(lm)" in R) to get a better feel about what these things are actually doing.
dpryan is offline   Reply With Quote
Old 10-22-2013, 02:52 PM   #5
sindrle
Senior Member
 
Location: Norway

Join Date: Aug 2013
Posts: 266
Default

Thanks!
I dont even understand why I should read up on linear regression.. Wow, I have alot to learn!

To sum up the fix for uneven groups:

Delete alle columns with only zeros i.e.

design <- design[,-24]
sindrle is offline   Reply With Quote
Old 10-22-2013, 03:01 PM   #6
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

FYI, once you've read up on linear models, you'll know why "design <- design[,-c(24,26)]" will fix the error but still not answer the actual biological question you want to ask
dpryan is offline   Reply With Quote
Old 10-22-2013, 03:08 PM   #7
sindrle
Senior Member
 
Location: Norway

Join Date: Aug 2013
Posts: 266
Default

Oh man, I look forward to that!

But hold on.. Is this incorrect then?

fit <- glmFit(d,design)

#Genes responding to Treatment in healthy patients
ExHealthy <- glmLRT(fit, coef="DiseaseHealthy:TreatmentTreatment")

#Genes responding to Treatment in diabetic patients
ExDiabetics <- glmLRT(fit, coef="DiseaseDiabetic:TreatmentTreatment")

#Genes responding to Treatment in any group
ExAny <- glmLRT(fit, coef=25:26)

#Genes responding differently to Treatment in diabetic vs normals
ExAny <- glmLRT(fit, contrast=c)

I dont know what "contrast" does.. Googling that aswell.

My brain is boiling, must sleep some hours..

Last edited by sindrle; 10-22-2013 at 05:28 PM.
sindrle is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 04:02 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO