This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error in ActivePathways in R

I am trying to find the pathways using ActivePathways R package. I am following this tutorial - https://github.com/reimandlab/ActivePathways

I wrote this code -

install.packages('ActivePathways')
devtools::install_github('https://github.com/reimandlab/ActivePathways', build_vignettes = TRUE)
library(ActivePathways)
setwd('/home/sanjana/Downloads/miten')
fname_scores <- system.file("extdata", "c - Sheet1.tsv", package = "ActivePathways")
fname_GMT <- system.file("extdata", "hsapiens_REAC_subset.gmt", package = "ActivePathways")
scores <- read.table(fname_scores, header = TRUE, row.names = 'Gene')
scores <- as.matrix(scores)
scores[is.na(scores)] <- 1
enriched_pathways <- ActivePathways(scores, fname_GMT) 

I am encountering this error even thorugh I converted the dataframe into matrix-

Error in ActivePathways(scores, fname_GMT): scores must be a numeric matrix
Traceback:

1. ActivePathways(scores, fname_GMT)
2. stop("scores must be a numeric matrix")
deseq2 r activepathways pathway

Can you please show the output of class(scores) and str(scores)?

the output of class(scores) is

matrix array

The output of str(scores) is

chr [1:60683, 1:7] "MYH3" "MYH8" "MED12L" "TOGARAM2" "FHOD1" "FST" "PEG10" ...

  • attr(*, "dimnames")=List of 2 ..$ : NULL ..$ : chr [1:7] "X" "baseMean" "log2FoldChange" "lfcSE" ...
fname_scores <- system.file("extdata", "c - Sheet1.tsv", package = "ActivePathways")

Admittedly, I was quite confused, because data loaded with a command like the one above should always work. It loads the example dataset that ships with the package, so it is thoroughly tested - manually and in the meantime also usually via CI pipelines.

But then I realized you changed the file name from "Adenocarcinoma_scores_subset.tsv" to "c - Sheet1.tsv". Evidently, you have to adhere to the names the package's authors give to their example data if you want to use that.

If you actually want to run the analysis with your own data, you should load it separately and make sure that the result looks similar to the example data in terms of class, column names etc. Also, I recommend changing your filename, since "c - Sheet1.tsv" is dicey because of the blanks in there.

0 answers

No answers yet.

Log in to answer this question.