Error in ActivePathways in R
0
0
Entering edit mode
9 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")
DeSeq2 R ActivePathways Pathway • 596 views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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" ...
ADD REPLY
0
Entering edit mode
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.

ADD REPLY

Login before adding your answer.

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