Problems with pulling specific variables
1
0
Entering edit mode
Bine ▴ 10
@bine-23912
Last seen 15 days ago
Spain

Dear all,

I am working with a DESEQ2 object and when I run dds0 <- DESeq(dds0) it works fine for the type "arm" as specified here:

dds0_sub <- dds0[,dds0$Sample.Site == "arm"]  But if I do the same with "leg" dds0_sub <- dds0[,dds0$Sample.Site == "leg"] and dds0 <- DESeq(dds0) I get the following error:

Error in designAndArgChecker(object, betaPrior) :
full model matrix is less than full rank


Has anyone an idea what it could be?

Thank you, Bine

DESeq2 • 118 views
0
Entering edit mode
@mikelove
Last seen 2 days ago
United States

DESeq2 relies on model.matrix from base R, which doesn't want factors to have levels with no samples:

table(dds$variable)  You can resolve this by running droplevels on the column and re-saving it to the colData of dds with the paradigm dds$variable <- ....

0
Entering edit mode

I have tried this: dds0$Sample.Site <- droplevels(dds0$Sample.Site) but then I get the error:

Error in UseMethod("droplevels") : no applicable method for 'droplevels' applied to an object of class "character"

Then I tried to convert to a factor with

dds0$Sample.Site <- factor(dds0$Sample.Site)
dds0$Sample.Site <- droplevels(dds0$Sample.Site)


Then I dont get an error anymore with droplevel but then running dds0 <- DESeq(dds0) again gives:

Error in designAndArgChecker(object, betaPrior) : full model matrix is less than full rank

What am I doing wrong here?

Thanks so much!

0
Entering edit mode

Oh then, it could just be because your design induces confounding. Do read the vignette section that the error message points to. You can consult further with a statistician on dealing with confounding.

0
Entering edit mode

Thank you.

Interestingly the ones, e.g. leg & heart with just a few samples are making problems. Arm and Head with more samples are fine.