This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Subscript out of bounds in plotcounts in DESeq2

HelloI

I am running this code:

dds <- DESeqDataSetFromMatrix(countData = cts, colData = coldata, design= ~ CDKN2A)
dds<-DESeq(dds)
plotCounts(dds, gene="ENSG00000147889.12", intgroup="CDKN2B")

I get this error:

Error in counts(dds, normalized = normalized, replaced = replaced)[gene,  : 
  subscript out of bounds

When I look into it

counts<-counts(dds)

Has equal number columns to rows in coldata

Additionally:

> head(dds)
class: DESeqDataSet 
dim: 6 576 
metadata(1): version
assays(6): counts mu ... replaceCounts replaceCooks
rownames(6): ENSG00000000003.14 ENSG00000000005.6 ... ENSG00000000460.17 ENSG00000000938.13
rowData names(27): baseMean baseVar ... maxCooks replace
colnames(576): M99 M98 ... QM10 QM1
colData names(38): ExpID ID ... sizeFactor replaceable

head(coldata)
# A tibble: 6 × 36
  ExpID    ID Source_name  Origi…¹ XYZ…² Source Platf…³ Gender   Age CDKN2A CDKN2B Any C…⁴ Prima…⁵ 1p_lo…⁶ 22_lo…⁷ XYZ…⁸ WHO g…⁹ WHO S…˟   MIB Recur…˟
  <chr> <dbl> <chr>        <chr>   <chr>   <chr>  <chr>   <chr>  <dbl> <fct>  <fct>  <chr>   <chr>   <chr>   <chr>   <chr> <chr>     <dbl> <chr>   <dbl>   <dbl>
DATA OMITTED
# … with 15 more variables: `Recurrence Free Survival` <dbl>, Location <chr>, Simpson_grade <chr>, `Date of Surgery` <chr>, EOR <chr>, KM_survival <dbl>,
#   KM_outcome <dbl>, `Vital Status` <chr>, `NF2 SNV + 22 Loss CAVEAT* Some have complete 22 data, incomplete NF2` <dbl>, `NF2 SNV` <dbl>, `SMARCB1 SNV` <dbl>,
#   `TRAF7 SNV` <dbl>, `AKT1 SNV` <dbl>, `KLF4 SNV` <dbl>, `SMO SNV` <dbl>, and abbreviated variable names ¹​Original_name, ²​XYZ, ³​Platform,
#   ⁴​`Any CDKN2 Loss`, ⁵​PrimaryTumor, ⁶​`1p_loss`, ⁷​`22_loss`, ⁸​RNA_Class, ⁹​`WHO grade`, ˟​`WHO Subtype`, ˟​Recurrence
# ℹ Use `colnames()` to see all variable names

To me it seems like the appropiate column is in coldata and also has the correct size.

THANKS

rnaseq r deseq2

Obvious thing to check...that gene exists in dds?

"ENSG00000147889.12" %in% rownames(dds) -- does that return TRUE?

0 answers

No answers yet.

Log in to answer this question.