Entering edit mode
16 months ago
Maliha
▴
20
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")
Can you please show the output of
class(scores)
andstr(scores)
?the output of class(scores) is
The output of str(scores) is
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.