I'm currently doing 30 samples of RNAseq anaylsis with DESeq, but now I have problem with model matrix again.
I posted my sample colData below.
donor disease batch donor.n A Control B1 1 A Control B2 1 A Control B3 1 B Control B1 2 B Control B2 2 B Control B3 2 C Control B1 3 C Control B2 3 C Control B3 3 D Control B1 4 D Control B2 4 D Control B3 4 E muta B1 1 E muta B2 1 E muta B3 1 F muta B1 2 F muta B2 2 F muta B3 2 G muta B1 3 G muta B2 3 G muta B3 3 H mutb B1 1 H mutb B2 1 H mutb B3 1 I mutb B1 2 I mutb B2 2 I mutb B3 2 J mutb B1 3 J mutb B2 3 J mutb B3 3
I want to find disease samples' transcriptomic change without batch variation or donor variation, so I added donor.n to distinguish donor's effect.
Problem was that I had 4 donors samples in control group so I have to remove levels without samples as vignettes of DESeq says.
I tried with this code to make matrix model just like vignettes says.
m1<-model.matrix(~ disease+ disease:donor.n+ disease:batch, samples) colnames(m1) unname(m1) all.zero <- apply(m1, 2, function(x) all(x==0)) all.zero idx <- which(all.zero) m1 <- m1[,-idx] unname(m1)
It worked with
colData = samples,
design = m1)
but when I tired to make the results, I couldn't find
This is the results of the resultsNames()
resultsNames(dds)  "Intercept" "diseasemuta" "diseaseControl" "diseasemutb.donor.n2"  "diseasemuta.donor.n2" "diseaseControl.donor.n2" "diseasemutb.donor.n3" "diseasemuta.donor.n3"  "diseaseControl.donor.n3" "conditionControl.donor.n4" "diseasemutb.batchB2" "diseasemuta.batchB2"  "diseaseControl.batchB2" "diseasemutb.batchB3" "diseasemuta.batchB3" "diseaseControl.batchB3"
I can make results with
res <- results(dds, contrast=list("diseasemuta","diseaseControl")) to get muta versus Control but I cannot compare mutb versus Control.
Can anyone explain what I missed and how to make model matix of this situation?
Always thanks to everyone's kind response.