当我试图运行路径分析时,如何克服R中MetaboAnalyst的问题?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了当我试图运行路径分析时,如何克服R中MetaboAnalyst的问题?相关的知识,希望对你有一定的参考价值。

我正在使用这段代码 https:/drive.google.comfiled1CXluzyYqNoPqu1DI3HwvDAmRVGMe825mview 为了进行路径分析,使用 MetaboAnalystR.

当我到了这个阶段

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

我得到这个错误

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

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

我查看了常见问题和故障排除页面,但无法解决这个问题。我已经在另一台电脑上完成了所有的安装步骤(不幸的是,又是在Windows上,我得到了同样的问题)。

这很可能是Windows上的curl问题。( 我已经在Windows 10上安装了,请看其他问题。当我在Windows 10中使用R ( MetaboAnalyst包)时,我还可以做什么来确保curl工作?).

故障处理建议 https:/github.comxia-labMetaboAnalystRblobmasterRgeneral_data_utils.R。 关于卷曲问题,对我来说也不起作用。

EDIT 2:更大的化合物列表

如果可能的话,我将非常感激,如果有人愿意运行下面的代码,并得到Pathway Impact vs -log(p)的图表,并输出结果,如果需要的话,我可以在图表上注释这些点。代码如下。

  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)
答案

在花了至少30分钟安装CRAN和Bioconductor的依赖包后,我得以让代码工作。

如果要我猜测你的问题,你可能还没有安装所有的依赖包。

请按照以下说明进行安装 此处:

#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)

不管出于什么原因,我也不得不手动安装以下软件包。

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

我对你的数据进行了分析。请看下面的输出。

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

以上是关于当我试图运行路径分析时,如何克服R中MetaboAnalyst的问题?的主要内容,如果未能解决你的问题,请参考以下文章

将网络测功机添加到 Heroku django 应用程序时如何克服“无法找到该编队”错误?

尝试运行 jetpack compose 仪器测试时如何克服此构建错误

如何在 cython 中包含 C++ 所需的路径?

使用 qBittorrent 运行脚本时如何克服 Python 中的 IO 错误 13

运行 R 内核时如何在 google Colab 中访问 shell

如何在Automation Anywhere中关闭虚拟机时使对象克隆和管理Windows控件正常工作?