Problems with pulling specific variables
1
0
Entering edit mode
Bine ▴ 40
@bine-23912
Last seen 2 days ago
UK

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 • 778 views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 10 hours 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 <- ....

ADD COMMENT
0
Entering edit mode

Thank you for your quick reply.

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!

ADD REPLY
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.

ADD REPLY
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.

ADD REPLY

Login before adding your answer.

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