Help with error using camera() in limma
1
0
Entering edit mode
Chris ▴ 20
@3fdb6f97
Last seen 3 months ago
United States

Hi all,

After googling and ask chatGPT, I don't know how to fix this error. Would you please have a suggestion? Thank you so much!

gene_sets_dir <- "gene_sets"
c2_gmt_url <- "https://data.broadinstitute.org/gsea-msigdb/msigdb/release/2023.2.Hs/c2.all.v2023.2.Hs.entrez.gmt"
c2_gmt_file <- file.path(
  gene_sets_dir,
  "c2.all.v2023.2.Hs.entrez.gmt"
c2_list <- qusage::read.gmt(c2_gmt_file) # geneSets <- getGmt(c2_gmt_file) also get the same error. GeneSets is large genesetcollection.

w <- arrayWeights(numeric_matrix, design) 
fit <- lmFit(numeric_matrix, design, weights=w)
cameraRes <- camera(fit, c2_list, inter.gene.cor=0.01) # fit is large MArrayLM, c2_list is large list.

Error in getEAWP(y) : data object isn't of a recognized data class

I guess the c2_list or geneSets is not in the correct format.

CAMERA limma • 563 views
ADD COMMENT
2
Entering edit mode
@james-w-macdonald-5106
Last seen 2 days ago
United States

The first step should be to read the help page, which says

Usage:

     ## Default S3 method:
     camera(y, index, design, contrast = ncol(design), weights = NULL,
            use.ranks = FALSE, allow.neg.cor=FALSE, inter.gene.cor=0.01, trend.var = FALSE,
            sort = TRUE, ...)
     ## Default S3 method:
     cameraPR(statistic, index, use.ranks = FALSE, inter.gene.cor=0.01, sort = TRUE, ...)
     interGeneCorrelation(y, design)

Arguments:

       y: a numeric matrix of log-expression values or log-ratios of
          expression values, or any data object containing such a
          matrix.  Rows correspond to probes and columns to samples.
          Any type of object that can be processed by 'getEAWP' is
          acceptable.  'NA' or infinite values are not allowed.

An MArrayLM object is none of the choices for the first argument.

0
Entering edit mode

Thanks James! That is a great tip.

cameraRes <- camera(numeric_matrix, geneSets, inter.gene.cor=0.01, design)
Error in Stat[iset] : invalid subscript type 'S4'

Now I guess the error is because geneSets is not in the correct format but I don't know how to fix.

ADD REPLY
1
Entering edit mode

Again, this is where you need to read the help page and try to diagnose. It says

 index: an index vector or a list of index vectors.  Can be any
          vector such that 'y[index,]' of 'statistic[index]' selects
          the rows corresponding to the test set.  The list can be made
          using 'ids2indices'.

And if you do ?read.gmt it says the output is a list, with each item representing a gene set. Most likely the gene sets are just gene symbols. Unless the row.names of your 'y' object are the same thing as the values in your geneSets list, y[index] isn't going to select the rows corresponding to the gene set, right?

ADD REPLY
0
Entering edit mode

Thanks James! I fixed the error. I try gene symbol instead of entrez and it worked.

ADD REPLY

Login before adding your answer.

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