<DESeqDataSet>[i,] index out of bounds - subsetting DESeqDataSet
1
0
Entering edit mode
4.4 years ago
mbk0asis ▴ 700

Hi, all!

I'm troubling in subsetting DESeqDataSet by a list of genes, and I got an 'index out of bounds' error.

Following is the code I used.

> skeletal_muscle <- scan("GTEx_Skeletal_Muscle2.csv", what = "", quiet = TRUE)
> skeletal_muscle[1:10]
 [1] "ACADVL" "ACTA1"  "ACTN2"  "ALDOA"  "ATP1A2" "ATP2A1" "ATP2A2" "ATP5B"  "BIN1"   "CA3"   
> dds[skeletal_muscle[1:10],]
Error in .SummarizedExperiment.charbound(i, rownames(x), fmt) : 
  <DESeqDataSet>[i,] index out of bounds: ACADVL ACTA1 ... BIN1 CA3

I tested with another list of genes, and it worked well.

> de <- rownames(res[res$padj<0.05 & !is.na(res$padj), ])
> de[1:10]
 [1] "0610007N19Rik" "0610009L18Rik" "0610010F05Rik" "0610030E20Rik" "0610039K10Rik"
 [6] "0610040B10Rik" "1110004F10Rik" "1110007C09Rik" "1110008F13Rik" "1110008L16Rik"
> dds[de[1:10],]
class: DESeqDataSet 
dim: 10 99 
metadata(1): version
assays(6): counts mu ... replaceCounts replaceCooks
rownames(10): 0610007N19Rik 0610009L18Rik ... 1110008F13Rik 1110008L16Rik
rowData names(59): baseMean baseVar ... maxCooks replace
colnames(99): HD_Muscle_14w_F_1 HD_Muscle_14w_F_2 ... WT_PBMC_2m_4 WT_PBMC_2m_5
colData names(3): conds sizeFactor replaceable

Both lists look the same, but only later one works.

What could be the problem here?

Thank you, all!

DESeq • 2.9k views
ADD COMMENT
4
Entering edit mode
4.4 years ago

Are the gene names in the first list actually in dds?

ADD COMMENT
0
Entering edit mode

Thank you, Devon Ryan!

The error might be caused by gene name conventions.

All my gene names were from human data so they were all in uppercases while gene symbols in "dds" were the mouse form.

ABCD - Human
Abcd - mouse

How can I convert all uppercase strings to upper/lowercase combinations like above in R?

Thank you!

ADD REPLY
1
Entering edit mode

Have a look here

ADD REPLY
0
Entering edit mode

Solved!

Actually, there were two problems here!

Primarily the gene symbols I used were in all uppercases, and secondly some gene names were missing in "dds" as Devon Ryan suggested.

After converting gene symbols to mouse forms and removing missing genes, it worked.

Thank you, guys!

ADD REPLY
0
Entering edit mode

You're welcome. I moved Devon's comment to an answer - thanks for accepting it.

ADD REPLY

Login before adding your answer.

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