0

I am using this code https://drive.google.com/file/d/1CXluzyYqNoPqu1DI3HwvDAmRVGMe825m/view in order to undertake a pathway analysis using MetaboAnalystR.

When I get to this stage

 mSet<-CalculateOraScore(mSet, "rbc", "hyperg")

I get this error

Loading files from server unsuccessful. Ensure curl is downloaded on your computer

Error in if (is_http) { : argument is of length zero

I have gone through the FAQs and troubleshooting pages, and can't rectify this. I have gone through all of the installation steps on another computer ( Windows again unfortunately, and I get the same issue).

This is likely to be a curl problem on Windows. ( It is already installed for me on Windows 10, please see other question What else can I do to make sure that curl is working when I am using R ( MetaboAnalyst package) in Windows 10?).

The trouble shooting advice on https://github.com/xia-lab/MetaboAnalystR/blob/master/R/general_data_utils.R regarding curl issues also does not work for me.

EDIT 2: larger list of compounds

If possible, I would be very grateful if anybody would please be willing to run the below code, and get the graph of Pathway Impact vs -log(p), with a results output, so I can annotate the spots on the graph if neccessary. The code is as follows;

  library(MetaboAnalystR)
     tmp.vec <- c(tmp.vec <- c("Indole-3-carboxylic acid", "4-O-Methylgallic acid", "Hippuric acid", "Pyrocatechol", "Hydroquinone",
        "Aspartame", "trans-Ferulic acid", "2,6-Dimethoxyphenol", "2-Methylhippuric acid", "2-(Hydroxymethyl)benzoic acid", 
        "3-(2-Hydroxyphenyl)propanoic acid", "1-Methyluric acid", "Dehydroisoandrosterone 3-glucuronide", "Ascorbic acid",
        "D-Tartaric acid", "Kynurenic acid", "Xanthine", "Vanillic acid", "Glyceraldehyde", "D-Lactic acid", "Pregnanediol", 
        "7-Methylguanine", "Gluconic acid", "4-Aminophenol", "Caffeic acid", "Enterolactone", "Adipic acid", 
        "1H-Indole-3-carboxaldehyde", "4-Hydroxybenzoic acid", "Creatinine", "2-Aminobenzoic acid", "Uric acid")

 mSet<-InitDataObjects("conc", "pathora", FALSE)
 mSet<-Setup.MapData(mSet, tmp.vec);
 mSet<-CrossReferencing(mSet, "name");
 mSet<-CreateMappingResultTable(mSet);

 ##4-O-Methylgallic acid and 2-Methylhippuric acid need correct kegg ID format

 mSet$dataSet$map.table[2,5] <- "C05616"
 mSet$dataSet$map.table[9,5] <- "C01586"


 mSet<-SetKEGG.PathLib(mSet, "hsa", "current")
 mSet<-SetMetabolomeFilter(mSet, F)
 mSet<-CalculateOraScore(mSet, "rbc", "hyperg")
 mSet<-PlotPathSummary(mSet, "path_view_0_", "png", 72, width=NA)

1 Answers1

0

After spending at least 30 minutes installing dependencies from CRAN and Bioconductor, I was able to get the code to work.

If I had to guess your issue, you probably haven't installed all the dependency packages.

Follow the instructions here:

#install.packages("pacman")
library(pacman)
pacman::p_load(Rserve, ellipse, scatterplot3d, Cairo, randomForest,
               caTools, e1071, som, impute, pcaMethods, RJSONIO, ROCR, 
               globaltest, GlobalAncova, Rgraphviz, preprocessCore, genefilter,
               pheatmap, SSPA, sva, Rcpp, pROC, data.table, limma, car, fitdistrplus,
               lars, Hmisc, magrittr, methods, xtable, pls, caret, lattice, igraph,
               gplots, KEGGgraph, reshape, RColorBrewer, tibble, siggenes, plotly,
               xcms, CAMERA, fgsea, MSnbase)

For whatever reason, I had to install the following packages manually as well:

BiocManager::install("edgeR")
install.packages("crmn")
devtools::install_github("xia-lab/MetaboAnalystR")

I ran the analysis on your data. See the output below.

library(MetaboAnalystR)
tmp.vec <- c("Indole-3-carboxylic acid", "4-O-Methylgallic acid", "Hippuric acid", "Pyrocatechol", "Hydroquinone",
        "Aspartame", "trans-Ferulic acid", "2,6-Dimethoxyphenol", "2-Methylhippuric acid", "2-(Hydroxymethyl)benzoic acid", 
        "3-(2-Hydroxyphenyl)propanoic acid", "1-Methyluric acid", "Dehydroisoandrosterone 3-glucuronide", "Ascorbic acid",
        "D-Tartaric acid", "Kynurenic acid", "Xanthine", "Vanillic acid", "Glyceraldehyde", "D-Lactic acid", "Pregnanediol", 
        "7-Methylguanine", "Gluconic acid", "4-Aminophenol", "Caffeic acid", "Enterolactone", "Adipic acid", 
        "1H-Indole-3-carboxaldehyde", "4-Hydroxybenzoic acid", "Creatinine", "2-Aminobenzoic acid", "Uric acid")  
mSet<-InitDataObjects("conc", "pathora", FALSE)
mSet<-Setup.MapData(mSet, tmp.vec)
mSet$dataSet$map.table
      Query                                  Match                                  HMDB          PubChem    KEGG        SMILES                                                                             Comment
 [1,] "Indole-3-carboxylic acid"             "Indole-3-carboxylic acid"             "HMDB0003320" "69867"    "C19837"    "C1=CC=C2C(=C1)C(=CN2)C(=O)O"                                                      "1"    
 [2,] "4-O-Methylgallic acid"                "4-O-Methylgallic acid"                "HMDB0013198" "78016"    NA          "COC1=C(C=C(C=C1O)C(=O)O)O"                                                        "1"    
 [3,] "Hippuric acid"                        "Hippuric acid"                        "HMDB0000714" "464"      "C01586"    "C1=CC=C(C=C1)C(=O)NCC(=O)O"                                                       "1"    
 [4,] "Pyrocatechol"                         "Pyrocatechol"                         "HMDB0000957" "3390"     "C15571"    "C1=CC=C(C(=C1)O)O"                                                                "1"    
 [5,] "Hydroquinone"                         "Hydroquinone"                         "HMDB0002434" "785"      "C00530"    "C1=CC(=CC=C1O)O"                                                                  "1"    
 [6,] "Aspartame"                            "Aspartame"                            "HMDB0001894" "134601"   "C11045"    "COC(=O)[C@H](CC1=CC=CC=C1)NC(=O)[C@H](CC(=O)O)N"                                  "1"    
 [7,] "trans-Ferulic acid"                   "trans-Ferulic acid"                   "HMDB0000954" "445858"   "C01494"    "COC1=C(C=CC(=C1)/C=C/C(=O)O)O"                                                    "1"    
 [8,] "2,6-Dimethoxyphenol"                  "2,6-Dimethoxyphenol"                  "HMDB0034158" "7041"     "C10787"    "COC1=C(C(=CC=C1)OC)O"                                                             "1"    
 [9,] "2-Methylhippuric acid"                "2-Methylhippuric acid"                "HMDB0011723" "91637"    "\t C01586" "CC1=CC=CC=C1C(=O)NCC(=O)O"                                                        "1"    
[10,] "2-(Hydroxymethyl)benzoic acid"        "2-(Hydroxymethyl)benzoic acid"        "HMDB0032594" "11920"    "C10804"    "C1=CC=C(C(=C1)CO)C(=O)O"                                                          "1"    
[11,] "3-(2-Hydroxyphenyl)propanoic acid"    "3-(2-Hydroxyphenyl)propanoic acid"    "HMDB0033752" "873"      "C01198"    "C1=CC=C(C(=C1)CCC(=O)O)O"                                                         "1"    
[12,] "1-Methyluric acid"                    "1-Methyluric acid"                    "HMDB0003099" "69726"    "C16359"    "CN1C(=O)C2=C(NC(=O)N2)NC1=O"                                                      "1"    
[13,] "Dehydroisoandrosterone 3-glucuronide" "Dehydroisoandrosterone 3-glucuronide" "HMDB0010327" "53480448" "C03033"    "CC12CCC3C(C1CCC2=O)CC=C4C3(CCC(C4)O[C@H]5[C@@H]([C@H]([C@@H](C(O5)C(=O)O)O)O)O)C" "1"    
[14,] "Ascorbic acid"                        "Ascorbic acid"                        "HMDB0000044" "54670067" "C01041"    "C([C@@H]([C@@H]1C(=C(C(=O)O1)O)O)O)O"                                             "1"    
[15,] "D-Tartaric acid"                      "D-Tartaric acid"                      "HMDB0029878" "439655"   "C02107"    "[C@H]([C@@H](C(=O)O)O)(C(=O)O)O"                                                  "1"    
[16,] "Kynurenic acid"                       "Kynurenic acid"                       "HMDB0000715" "3845"     "C01717"    "C1=CC=C2C(=C1)C(=O)C=C(N2)C(=O)O"                                                 "1"    
[17,] "Xanthine"                             "Xanthine"                             "HMDB0000292" "1188"     "C00385"    "C1=NC2=C(N1)C(=O)NC(=O)N2"                                                        "1"    
[18,] "Vanillic acid"                        "Vanillic acid"                        "HMDB0000484" "8468"     "C06672"    "COC1=C(C=CC(=C1)C(=O)O)O"                                                         "1"    
[19,] "Glyceraldehyde"                       "Glyceraldehyde"                       "HMDB0001051" "751"      "C02154"    "C(C(C=O)O)O"                                                                      "1"    
[20,] "D-Lactic acid"                        "D-Lactic acid"                        "HMDB0001311" "61503"    "C00256"    "C[C@H](C(=O)O)O"                                                                  "1"    
[21,] "Pregnanediol"                         "Pregnanediol"                         "HMDB0004025" "3032822"  "C05484"    "CC[C@H]1CC[C@@H]2[C@@]1(CC[C@H]3[C@H]2CCC4[C@@]3(CCC(C4)(O)O)C)C"                 "1"    
[22,] "7-Methylguanine"                      "7-Methylguanine"                      "HMDB0000897" "11361"    "C02242"    "CN1C=NC2=C1C(=O)N=C(N2)N"                                                         "1"    
[23,] "Gluconic acid"                        "Gluconic acid"                        "HMDB0000625" "10690"    "C00257"    "C([C@H]([C@H]([C@@H]([C@H](C(=O)O)O)O)O)O)O"                                      "1"    
[24,] "4-Aminophenol"                        "4-Aminophenol"                        "HMDB0001169" "403"      "C02372"    "C1=CC(=CC=C1N)O"                                                                  "1"    
[25,] "Caffeic acid"                         "Caffeic acid"                         "HMDB0001964" "1549111"  "C01481"    "C1=CC(=C(C=C1/C=C\\C(=O)O)O)O"                                                    "1"    
[26,] "Enterolactone"                        "Enterolactone"                        "HMDB0006101" "123917"   "C18165"    "C1C(C(C(=O)O1)CC2=CC(=CC=C2)O)CC3=CC(=CC=C3)O"                                    "1"    
[27,] "Adipic acid"                          "Adipic acid"                          "HMDB0000448" "196"      "C06104"    "C(CCC(=O)O)CC(=O)O"                                                               "1"    
[28,] "1H-Indole-3-carboxaldehyde"           "1H-Indole-3-carboxaldehyde"           "HMDB0029737" "10256"    "C08493"    "C1=CC=C2C(=C1)C(=CN2)C=O"                                                         "1"    
[29,] "4-Hydroxybenzoic acid"                "4-Hydroxybenzoic acid"                "HMDB0000500" "135"      "C00156"    "C1=CC(=CC=C1C(=O)O)O"                                                             "1"    
[30,] "Creatinine"                           "Creatinine"                           "HMDB0000562" "588"      "C00791"    "CN1CC(=O)N=C1N"                                                                   "1"    
[31,] "2-Aminobenzoic acid"                  "2-Aminobenzoic acid"                  "HMDB0001123" "227"      "C00108"    "C1=CC=C(C(=C1)C(=O)O)N"                                                           "1"    
[32,] "Uric acid"                            "Uric acid"                            "HMDB0000289" "1175"     "C00366"    "C12=C(NC(=O)N1)NC(=O)NC2=O"                                                       "1"  
mSet$dataSet$map.table[2,5] <- "C05616"
mSet$dataSet$map.table[9,5] <- "C01586"
mSet<-SetKEGG.PathLib(mSet, "hsa", "current")
mSet<-SetMetabolomeFilter(mSet, F)
mSet<-CalculateOraScore(mSet, "rbc", "hyperg")
mSet$analSet$ora.mat
                                         Total Expected Hits   Raw p -log(p) Holm adjust FDR  Impact
Caffeine metabolism                         10     0.20    1 0.18341 1.69600           1   1 0.00000
Phenylalanine metabolism                    10     0.20    1 0.18341 1.69600           1   1 0.00000
Pentose and glucuronate interconversions    18     0.36    1 0.30627 1.18330           1   1 0.14062
Pentose phosphate pathway                   22     0.44    1 0.36079 1.01940           1   1 0.04712
Pyruvate metabolism                         22     0.44    1 0.36079 1.01940           1   1 0.08398
Purine metabolism                           65     1.30    2 0.37638 0.97717           1   1 0.01217
Tryptophan metabolism                       41     0.82    1 0.56799 0.56566           1   1 0.00202
PlotPathSummary(mSet, "path_view_0_", "png", 300, width=NA)

enter image description here

Ian Campbell
  • 23,484
  • 14
  • 36
  • 57
  • Thank-you for your updates and help. Please could you also let me know whether you needed to download curl? If so, how did you do this and where have you placed the unzipped curl folder ( in the same working directory that you are in? This is where mine is?). I can now get past the SetKegg.Pathlib without an error. However, when I try and calculate the ORA score I still get the "Loading files from server unsuccessful. Ensure curl is downloaded on your computer." Error in if (is_http) { : argument is of length zero I have downloaded and loaded all of the aforementioned packages now too. – Willow9898 May 31 '20 at 19:01
  • I am able to run the mSet<-Set.KEGG.PathLib(mSet, "hsa", "current") , there are no errors. It is when I get to the mSet<-CalculateOraScore(mSet, "rbc", "hyperg"), that I get the Error in if (is_http) { argument is of length 0). I have curl downloaded on my computer from their troubleshooting advice, so not sure what is wrong, which is a bit frustrating. Did you install curl from https://curl.haxx.se/download.html? – Willow9898 May 31 '20 at 19:15
  • `curl` is a pretty common utility that I probably installed the first day I got this laptop. Unfortunately, I'm not much of a Windows user anymore, but maybe [this question](https://stackoverflow.com/questions/9507353/how-do-i-install-and-use-curl-on-windows) can help you. – Ian Campbell May 31 '20 at 19:49
  • Thank you very much for your help and for running the above! If you are able to run it again with a final longer list of compounds, please find the longer list above. Before was just FDR significant, now it is all of the nominally significant ones too. – Willow9898 Jun 01 '20 at 22:28
  • OK, there you go. – Ian Campbell Jun 01 '20 at 23:04
  • Thank you very much for your help, I really appreciate it! – Willow9898 Jun 02 '20 at 08:32