Linux 中安装R包 WGCNA

利用WGCNA构建基因共表达网络时,由于数据量比较大,本机上跑不起来。连接了实验室的服务器,服务器的R语言安装在conda的环境中,在安装WGCNA时,遇到报错“Error in download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb"): cannot open URL herf...”的提示。

以下是我安装成功的解决方案:

报错时第一个提示的就是‘stringi’的错误,参考了redhat - 在 Linux 脱机中从 r 安装字符串包时出现 icudt 错误 - 堆栈溢出 (stackoverflow.com)执行如下代码:

wget https://github.com/gagolews/stringi/archive/master.zip -O stringi.zip
unzip stringi.zip
sed -i '/\/icu..\/data/d' stringi-master/.Rbuildignore
R CMD build stringi-master
R CMD INSTALL stringi_1.7.8.9001.tar.gz

安装成功后,进入R进行如下操作,参考(82条消息) R语言安装WGCNA包_小丑尽欢的博客-CSDN博客_wgcna包安装

install.packages("BiocManager")
BiocManager::install(c("AnnotationDbi", "impute","GO.db", "preprocessCore"), force = TRUE)
BiocManager::install("stringi",force = TRUE)
site="https://mirrors.tuna.tsinghua.edu.cn/CRAN"
install.packages(c("WGCNA", "stringr", "reshape2"), repos=site)
library(WGCNA)

 如果有更好的方法欢迎指明~

猜你喜欢

转载自blog.csdn.net/qq_42101569/article/details/127583437
今日推荐