美文网首页
安装R包-monocle3

安装R包-monocle3

作者: expgene | 来源:发表于2024-05-25 00:14 被阅读0次

探序基因肿瘤研究院  整理

作者系统为centos

R中运行:

devtools::install_github('cole-trapnell-lab/monocle3')

遇到问题:

── R CMD build ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

✔  checking for file ‘/tmp/Rtmprjj0OV/remotes1512fe2099eb60/cole-trapnell-lab-monocle3-98402ed/DESCRIPTION’ ...

─  preparing ‘monocle3’:

✔  checking DESCRIPTION meta-information ...

─  cleaning src

─  checking for LF line-endings in source and make files and shell scripts

─  checking for empty or unneeded directories

  Omitted ‘LazyData’ from DESCRIPTION

─  building ‘monocle3_1.3.7.tar.gz’

ERROR: dependencies ‘batchelor’, ‘sf’, ‘spdep’ are not available for package ‘monocle3’

* removing ‘/usr/local/lib64/R/library/monocle3’

Warning messages:

1: In i.p(...) : 安装程序包‘sf’时退出狀態的值不是0

2: In i.p(...) : 安装程序包‘spdep’时退出狀態的值不是0

3: In i.p(...) :

  安装程序包‘/tmp/Rtmprjj0OV/file1512fe11aa1370/monocle3_1.3.7.tar.gz’时退出狀態的值不是0

BiocManager::install("batchelor")

BiocManager::install("sf")

** using staged installation

configure: CC: gcc

configure: CXX: g++ -std=gnu++17

checking for gdal-config... no

no

configure: error: gdal-config not found or not executable.

ERROR: configuration failed for package ‘sf’

* removing ‘/usr/local/lib64/R/library/sf’

安装顺序:SQLITE3, proj,gdal

参考:https://www.cnblogs.com/echohye/p/17844185.html

安装proj-8.1.0遇到问题:

checking for SQLITE3... configure: error: Package requirements (sqlite3 >= 3.11) were not met:

Package 'sqlite3', required by 'virtual:world', not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you

installed software in a non-standard prefix.

Alternatively, you may set the environment variables SQLITE3_CFLAGS

and SQLITE3_LIBS to avoid the need to call pkg-config.

See the pkg-config man page for more details.

解决方法:

在环境变量文件bashrc中添加:

export SQLITE3_CFLAGS=/usr/local/include

export SQLITE3_LIBS=/usr/local/lib

source ~/.bashrc

注意自己重新安装的sqlite3在/usr/local/lib,但是/usr/lib64有系统之前安装的,此时会出现编译错误:

...

./.libs/libproj.so: undefined reference to `sqlite3_initialize'

./.libs/libproj.so: undefined reference to `sqlite3_bind_int'

注意在系统有sqlite3库时,应该yum install sqlite3-devel就行,并注意不要把自己编译的sqlite3安装到usr/local中,如有,要把lib,bin,include,share的都要移除。

安装R包添加参数的方法:

install.packages("sf", configure.args = "--with-gdal-config=/usr/local/bin/gdal-config --with-proj-include=/usr/local/include --with-proj-lib=/usr/local/lib --with-proj-share=/usr/local/share/proj")

install.packages("sf", configure.args = "--with-gdal-config=/usr/local/bin/gdal-config --with-proj-include=/usr/local/include --with-proj-lib=/usr/local/lib --with-proj-share=/usr/local/share --with-sqlite3-lib=/usr/lib64")

其他报错:

configure: error: geos-config not found or not executable.

解决:yum install geos-devel

参考:

知乎-【单细胞转录组】从0开始记录monocle3安装过程

https://gdal.org/development/building_from_source.html

http://download.osgeo.org/gdal/

相关文章

网友评论

      本文标题:安装R包-monocle3

      本文链接:https://www.haomeiwen.com/subject/gvymfjtx.html