DESEq2 VST error
2
5
Entering edit mode
anpham ▴ 60
@anpham-7402
Last seen 7.2 years ago

I'd like to perform variance stabilization transformation in DESeq2 but got this error message. Any input would be much appreciated. Thank you.

 

vsd <- vst(dds, blind = TRUE)
Error in vst(dds, blind = TRUE) : less than 'nsub' rows,
  it is recommended to use varianceStabilizingTransformation directly

 

deseq2 variancestabilizingtransformation • 15k views
ADD COMMENT
1
Entering edit mode

how many rows are in your dds? ie. what is the output of nrow(dds)?

ADD REPLY
0
Entering edit mode

Thank you, you're right. This is a miRNA dataset so there are 767 rows. Would I have another option to do VST with this number of rows? 

ADD REPLY
1
Entering edit mode

The default number of rows for vst() is nsub=1000. You can just set nsub=nrow(dds), or you can use the function that is recommended by name in the error message.

ADD REPLY
2
Entering edit mode
Angli Xue ▴ 20
@b01f5b5a
Last seen 16 months ago
Australia

I found that the new error message is slightly different:

Error in vst(dds, blind = TRUE, nsub = nrow(dds)) : less than 'nsub' rows with mean normalized count > 5, it is recommended to use varianceStabilizingTransformation directly

In some cases, setting nsub=nrow(dds) still didn't solve the problem because the rows with mean normalized count are less than 1000.

So it's better to check the row number by

sum( rowMeans( counts(dds, normalized=TRUE)) > 5 )

And assign this number to nsub.

ADD COMMENT
0
Entering edit mode

thank you. this worked in my case.

ADD REPLY
1
Entering edit mode
@steve-lianoglou-2771
Last seen 21 months ago
United States

To put more meat on my comment above, take a look at the code in the vst function (look at ?vst and just type vst at the console and hit return, the code will reveal itself)

You'll find that the vst function does its magic on a subset of rows (ie. the size of the subset is equal to nsub) then can apply it to the entire dataset.

If you call varianceStabilizingTransform directly on your expression object dds, it doesn't try to work on a subset of the genes in your expression matrix, and just does its thing on the whole thing.

Your problem is that your expression matrix doesn't have more than 1000 genes (rows) in it.

ADD COMMENT

Login before adding your answer.

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