Hi Michael and other DESeq2 users,
My dilemma is setting the best analysis for this design.
I have been trying the following code:
dds <-DESeqDataSetFromMatrix(countData=counttable, colData=colData, design= ~group)
dds <- DESeq (dds)
This works but I want to take account the patient so making a paired design.
So I did this:
design(dds) <- ~ group + patient
then rerun DESeq again,
I got the model matrix not full rank error. I would like to do a paired analysis where I have to compare CondA_7 of a specific subject to CondA_0 of the same patient, CondA_63 of the same patient vs CondA_0 of the same patient then compare them as a group afterwards versus other groups, taking account the time and the condition for each.So I tried this:
mm1 <- model.matrix(~ group + group:patient, colData)
mm1
idx <- which(colSums(mm1 == 0) == nrow(mm1))
mm1 <- mm1[,-idx]
mm1
mm0 <- model.matrix(~ group, colData)
colnames(mm1)
dds <- estimateSizeFactors(dds)
dds <- estimateDispersionsGeneEst(dds, modelMatrix=mm1)
error: inv(): matrix seems singular
Error: inv(): matrix seems singular
dds <- estimateDispersionsFit(dds)
found already estimated fitted dispersions, removing these
dds <- estimateDispersionsMAP(dds, modelMatrix=mm1)
found already estimated dispersions, removing these
using supplied model matrix
dds <- nbinomLRT(dds, full=mm1, reduced=mm0)
using supplied model matrix
found results columns, replacing these
3 rows did not converge in beta, labelled in mcols(object)$fullBetaConv. Use larger maxit argument with nbinomLRT
Did I run it correctly? What am I missing? I have search on most paired analysis and tried most of them but I think I am missing a great point to make this work. Im currently using DESeq2 v. 1.12.3.
Here is the colData:
colData
sampleName | patient | condition | time | group |
A16_6_12_12 | A16 | CondA | Day0 | CondADay0 |
A16_6_19_12 | A16 | CondA | Day7 | CondADay7 |
A16_8_14_12 | A16 | CondA | Day63 | CondADay63 |
A77_3_25_13 | A77 | CondA | Day0 | CondADay0 |
A77_4_1_13 | A77 | CondA | Day7 | CondADay7 |
A77_5_28_13 | A77 | CondA | Day63 | CondADay63 |
A25_4_17_13 | A25 | CondA | Day0 | CondADay0 |
A25_4_24_13 | A25 | CondA | Day7 | CondADay7 |
A25_6_19_13 | A25 | CondA | Day63 | CondADay63 |
A74_6_3_13 | A74 | CondA | Day0 | CondADay0 |
A74_6_10_13 | A74 | CondA | Day7 | CondADay7 |
A\74_8_5_13 | A74 | CondA | Day63 | CondADay63 |
A29_7_31_13 | A29 | CondA | Day0 | CondADay0 |
A29_8_7_13 | A29 | CondA | Day7 | CondADay7 |
A29_10_2_13 | A29 | CondA | Day63 | CondADay63 |
A85_6_6_12 | A85 | CondB | Day0 | CondBDay0 |
A85_6_13_12 | A85 | CondB | Day7 | CondBDay7 |
A85_8_8_12 | A85 | CondB | Day63 | CondBDay63 |
A23_7_9_12 | A23 | CondB | Day0 | CondBDay0 |
A23_7_18_12 | A23 | CondB | Day7 | CondBDay7 |
A23_9_10_12 | A23 | CondB | Day63 | CondBDay63 |
A84_3_26_13 | A84 | CondB | Day0 | CondBDay0 |
A84_4_2_13 | A84 | CondB | Day7 | CondBDay7 |
A84_5_28_13 | A84 | CondB | Day63 | CondBDay63 |
A79_5_21_13 | A79 | CondB | Day0 | CondBDay0 |
A79_5_28_13 | A79 | CondB | Day7 | CondBDay7 |
A79_7_23_13 | A79 | CondB | Day63 | CondBDay63 |
A34_6_17_13 | A34 | CondB | Day0 | CondBDay0 |
A34_6_24_13 | A34 | CondB | Day7 | CondBDay7 |
A34_8_19_13 | A34 | CondB | Day63 | CondBDay63 |
A87_6_6_12 | A87 | CondC | Day0 | CondCDay0 |
A87_6_13_12 | A87 | CondC | Day7 | CondCDay7 |
A87_8_8_12 | A87 | CondC | Day63 | CondCDay63 |
A54_8_27_12 | A54 | CondC | Day0 | CondCDay0 |
A54_9_4_12 | A54 | CondC | Day7 | CondCDay7 |
A54_10_29_12 | A54 | CondC | Day63 | CondCDay63 |
A87_4_15_13 | A87 | CondC | Day0 | CondCDay0 |
A87_4_22_13 | A87 | CondC | Day7 | CondCDay7 |
A87_6_17_13 | A87 | CondC | Day63 | CondCDay63 |
A32_5_29_13 | A32 | CondC | Day0 | CondCDay0 |
A32_6_5_13 | A32 | CondC | Day7 | CondCDay7 |
A32_7_31_13 | A32 | CondC | Day63 | CondCDay63 |
A26_7_29_13 | A26 | CondC | Day0 | CondCDay0 |
A26_8_5_13 | A26 | CondC | Day7 | CondCDay7 |
A26_9_30_13 | A26 | CondC | Day63 | CondCDay63 |
A86_6_6_12 | A86 | CondD | Day0 | CondDDay0 |
A86_6_13_12 | A86 | CondD | Day7 | CondDDay7 |
A86_8_8_12 | A86 | CondD | Day63 | CondDDay63 |
A01_7_31_12 | A01 | CondD | Day0 | CondDDay0 |
A01_8_7_12 | A01 | CondD | Day7 | CondDDay7 |
A01_10_2_12 | A01 | CondD | Day63 | CondDDay63 |
A86_4_15 | A86 | CondD | Day0 | CondDDay0 |
A86_4_22_13 | A86 | CondD | Day7 | CondDDay7 |
A86_6_17_13 | A86 | CondD | Day63 | CondDDay63 |
A15_5_28_13 | A15 | CondD | Day0 | CondDDay0 |
A15_6_4_13 | A15 | CondD | Day7 | CondDDay7 |
A15_7_30_13 | A15 | CondD | Day63 | CondDDay63 |
A46_6_24_13 | A46 | CondD | Day0 | CondDDay0 |
A46_7_1_13 | A46 | CondD | Day7 | CondDDay7 |
A46_8_26_13 | A46 | CondD | Day63 | CondDDay63 |
Thank you!
A note on the support site: you are posting "Answers" to the original question (your first post) when what you want to do is post comments to my answer, if you want to receive follow up information.
I can help a bit with how to use the software, but in the end, to interpret the results you may need to work with a statistician who can help to interpret linear model coefficients. The coefficients from the design I recommended in my answer allow you to test for different day effects across condition A-D and also to contrast the day comparisons across condition. Can you post the code you are using and the resultsNames(dds) that you get when you follow the recommendation in my original answer?