在终端R安装了SeuratDisk,并且可以载入,但是在网页RStudio则载入报错:
library(SeuratDisk)
错误: package or namespace load failed for ‘SeuratDisk’ in dyn.load(file, DLLpath = DLLpath, ...):
无法载入共享目标对象‘.../Rlibrary/hdf5r/libs/hdf5r.so’::
libhdf5_hl.so.10: 无法打开共享对象文件: 没有那个文件或目录
解决办法:(在终端操作)
$ ldd .../Rlibrary/hdf5r/libs/hdf5r.so(此处为你报错的路径,也就是这个动态库)
linux-vdso.so.1 => (0x00007ffc62f66000)
libz.so.1 => /lib64/libz.so.1 (0x00007f76a45e4000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f76a43e0000)
libm.so.6 => /lib64/libm.so.6 (0x00007f76a40de000)
libhdf5_hl.so.10 => /usr/local/hdf5-1.8.17/lib/libhdf5_hl.so.10 (0x00007f76a495f000)
libhdf5.so.10 => /usr/local/hdf5-1.8.17/lib/libhdf5.so.10 (0x00007f76a3df7000)
libR.so => not found
libc.so.6 => /lib64/libc.so.6 (0x00007f76a3a29000)
/lib64/ld-linux-x86-64.so.2 (0x00007f76a47fa000)
看起来没有问题,但是,
libhdf5_hl.so.10 => /usr/local/hdf5-1.8.17/lib/libhdf5_hl.so.10 (0x00007f76a495f000)
libhdf5.so.10 => /usr/local/hdf5-1.8.17/lib/libhdf5.so.10 (0x00007f76a3df7000)
这两项疑似都需要root权限才可以打开,因此就修改hdf5r.so 的动态库依赖,改为用户可以访问的路径,
$sudo yum install patchelf
$patchelf --set-rpath /home/lpt/hdf5/hdf5-1.8.17/hdf5/lib /Rlibrary/hdf5r/libs/hdf5r.so
重新在网页RStudio 载入SeuratDisk
library(SeuratDisk)
Registered S3 method overwritten by 'SeuratDisk':
method from
as.sparse.H5Group Seurat
成功!
至于,/home/lpt/hdf5/hdf5-1.8.17/hdf5/lib,可能需要在终端安装一遍hdf5,$conda install -c anaconda hdf5,或者本地安装。