Linux安装单细胞分析软件copykat
测试环境
- Linux centos 7
- R 4.1.2
- minconda3
- 天意云24C192GB
安装步骤
新建环境
conda activate copykat
conda install r-base=4.1.2
安装基础软件
checkPkg <- function(pkg){
return(requireNamespace(pkg, quietly = TRUE))
}
if(!checkPkg("BiocManager")) install.packages("BiocManager")
if(!checkPkg("devtools")) install.packages("devtools")
安装依赖软件
library(devtools)
if(!checkPkg("RcppArmadillo")) install.packages("RcppArmadillo")
if(!checkPkg("RcppProgress")) install.packages("RcppProgress")
if(!checkPkg("markdown")) install.packages("markdown")
if(!checkPkg("R.utils")) install.packages("R.utils")
if(!checkPkg("NNLM")) install_github("linxihui/NNLM")
if(!checkPkg("copykat")) install_github("navinlabcode/copykat")
if(!checkPkg("Seurat")) BiocManager::install("Seurat")
if(!checkPkg("knitr")) BiocManager::install("knitr")
if(!checkPkg("GSVA")) BiocManager::install("GSVA")
if(!checkPkg("pheatmap")) BiocManager::install("pheatmap")
if(!checkPkg("ComplexHeatmap")) BiocManager::install("ComplexHeatmap")
安装copykat
install_github("Miaoyx323/stCancer")
报错与解决办法
XML报错引起连锁错误GSVA安装失败

解决方法:
conda install r-XML
httpuv报错引起seurat安装失败
ERROR: failed to lock directory ‘/home/zjw/miniconda3/envs/work/lib/R/library’ for modifying
Try removing ‘/home/zjw/miniconda3/envs/work/lib/R/library/00LOCK-httpuv’
ERROR: failed to lock directory ‘/home/zjw/miniconda3/envs/work/lib/R/library’ for modifying
Try removing ‘/home/zjw/miniconda3/envs/work/lib/R/library/00LOCK-RcppEigen’
ERROR: dependency ‘httpuv’ is not available for package ‘shiny’
* removing ‘/home/zjw/miniconda3/envs/work/lib/R/library/shiny’
ERROR: dependency ‘shiny’ is not available for package ‘miniUI’
* removing ‘/home/zjw/miniconda3/envs/work/lib/R/library/miniUI’
ERROR: dependencies ‘miniUI’, ‘shiny’, ‘RcppEigen’ are not available for package ‘Seurat’
* removing ‘/home/zjw/miniconda3/envs/work/lib/R/library/Seurat’
解决方法:
install.packages("httpuv",INSTALL_opts = '--no-lock')
conda install r-httpuv

RcppEigen报错
ERROR: failed to lock directory ‘/home/zjw/miniconda3/envs/work/lib/R/library’ for modifying
Try removing ‘/home/zjw/miniconda3/envs/work/lib/R/library/00LOCK-RcppEigen’
解决方法:
install.packages("RcppEigen",INSTALL_opts = '--no-lock')
conda install r-RcppEigen
hdf5r报错
Error in Read10X_h5("matrix.h5") :
Please install hdf5r to read HDF5 files
解决方法:
sudo yum install hdf5-devel
install.packages("hdf5r")
conda install r-hdf5r
hdf5版本过低
configure: error: The version of hdf5 installed on your system is not sufficient. Please ensure that at least version 1.8.13 is installed
ERROR: configuration failed for package ‘hdf5r’
* removing ‘/home/zjw/miniconda3/envs/work/lib/R/library/hdf5r’
The downloaded source packages are in
‘/tmp/Rtmpr0m6Da/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("hdf5r") :
installation of package ‘hdf5r’ had non-zero exit status
解决方法:
- 下载hdf5-1.8.13的源码
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.13/src/hdf5-1.8.13.tar.bz2
- 编译安装
tar xjf hdf5-1.8.13.tar.bz2
cd hdf5-1.8.13
./configure --prefix=$HOME/.local/bin/hdf5-1.8.13
make && make install
- 设置环境变量
export PATH=$HOME/.local/bin/hdf5-1.8.13/bin:$PATH
export LD_LIBRARY_PATH=$HOME/.local/bin/hdf5-1.8.13/lib:$LD_LIBRARY_PATH
- 重新安装R包hdf5r
install.packages('hdf5r')
本文由mdnice多平台发布
网友评论