服务器丨Linux安装测试单细胞分析软件copykat,遇到的常见报错与解决思路与方法

简介: 服务器丨Linux安装测试单细胞分析软件copykat,遇到的常见报错与解决思路与方法

今天分享的内容是copykat在云服务器Linux端的部署的方法,主要包括安装和测试两大部分,最终的效果是调用服务器进行计算。

测试环境

  • Linux centos 7
  • R 4.2.3
  • minconda3
  • 天意云 24C 192GB

主要的思路是先在linux下创建一个新的conda环境,安装上新版的R,然后再依次安装各种依赖包,但是由于linux系统有时缺少系统支持库文件,因此需要根据报错提示解决各种连锁软件的安装,主要遇到的问题集中在XML、GSVA、httpuv、seurat、RcppEigen、hdf5r等,接来下依次介绍解决办法。

安装步骤

新建环境

最好新建一个环境copykat,该步骤不是必需的。

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

如果以上代码运行完没有任何ERROR,恭喜你运气比较好,如果中间出现报错,请接着看下面的内容。

报错与解决办法

XML引起GSVA安装失败

image-20230411190940520

解决方法:退出R,利用conda安装r-XML

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_opts = '--no-lock'再安装

install.packages("httpuv",INSTALL_opts = '--no-lock')
conda install r-httpuv

image-20230411191801893

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

解决方法:yum安装后用conda安装r-hdf5r

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

如果出现版本不符提示,解决方法:

  1. 下载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
  1. 编译安装
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
  1. 设置环境变量
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
  1. 重新安装R包hdf5r
install.packages('hdf5r')

使用测试

示例脚本代码

t1 <- Sys.time()
library(copykat)
library(Seurat)
library(hdf5r)
download.file("https://cf.10xgenomics.com/samples/cell-exp/6.0.0/Brain_Tumor_3p/Brain_Tumor_3p_filtered_feature_bc_matrix.h5",
destfile = "matrix.h5")
mat <- Read10X_h5("matrix.h5")
sco <- CreateSeuratObject(mat,project="Glioblastoma")
Glioblastoma <- copykat(rawmat = sco@assays$RNA@counts, sam.name = "Glioblastoma", n.cores = 18)
pred <- data.table::fread("Glioblastoma_copykat_prediction.txt")
table(pred$copykat.pred)
t2 <- Sys.time()

运行结果

29K Apr 11 20:34 Glioblastoma_copykat_clustering_results.rds
 209M Apr 11 20:33 Glioblastoma_copykat_CNA_raw_results_gene_by_cell.txt
 296M Apr 11 20:35 Glioblastoma_copykat_CNA_results.txt
 924K Apr 11 20:35 Glioblastoma_copykat_heatmap.jpeg
  42K Apr 11 20:34 Glioblastoma_copykat_prediction.txt
  71M Apr 11 20:36 Glioblastoma_copykat_with_genes_heatmap.pdf
 7.1M Apr 11 20:26 matrix.h5
  333 Apr 11 20:26 out.log
  533 Apr 11 20:13 testcode.R

image-20230411210300234

测试完成,能够正常使用copykat进行单细胞数据分析,并且能够充分调用服务器计算资源,计算速度相对比较快,通过这个方式能够进行更大规模的单细胞数据分析。

[1] "running copykat v1.1.0"
[1] "step1: read and filter data ..."
[1] "36601 genes, 1615 cells in raw data"
[1] "filtered out 106 cells with less than 200 genes; remaining 1510 cells"
[1] "12101 genes past LOW.DR filtering"
[1] "step 2: annotations gene coordinates ..."
[1] "start annotation ..."
[1] "step 3: smoothing data with dlm ..."
[1] "step 4: measuring baselines ..."
number of iterations= 160
number of iterations= 111
number of iterations= 1030
number of iterations= 193
number of iterations= 186
number of iterations= 234
[1] "step 5: segmentation..."
[1] "step 6: convert to genomic bins..."
[1] "step 7: adjust baseline ..."
[1] "step 8: final prediction ..."
[1] "step 9: saving results..."
[1] "step 10: ploting heatmap ..."
Time difference of 4.411825 mins
参考:https://www.omicsclass.com/article/1637

image-20230411211928280

END

© 素材来源于网络,侵权请联系后台删除

往期推荐:

文献丨群体转录组分析锁定关键转录因子

文献丨转录组RNA seq——青年阶段!

文献丨高通量表型组图像识别与GWAS

笔记丨ggplot2热图入门学习笔记

笔记丨PCA分析基本知识和数学原理

图书丨R语言、Python、Linux

超算丨数据分析时电脑配置不够用?试试

软件 | 如何进行基因家族分析?TBtools

服务器丨家用联想台式机重装Linux系统

转录组丨一套完整的操作流程案例

转录组丨利用limma包进行差异表达分析

Python笔记丨函数和类相关基础知识总结

Python笔记丨条件与循环流程知识总结

Python笔记丨数据类型基础与易错点总结

GWAS丨全基因组关联分析工具GAPIT最新版

数据可视化丨优雅的带显著性标记的箱线散点图

相关文章
|
8天前
|
设计模式 测试技术 持续交付
深入白盒测试:提升软件质量与性能的关键策略
【4月更文挑战第20天】 在软件开发的复杂世界中,确保产品的质量和性能始终是至关重要的任务。白盒测试,作为软件测试领域的重要分支,提供了对程序内部结构和逻辑的深入分析手段。本文将探讨如何通过有效的白盒测试策略来优化软件性能,减少缺陷,并最终提高用户满意度。通过剖析代码检查、单元测试、集成测试等白盒测试技术,我们将了解这些方法如何揭示潜在的问题点,并为改进提供方向。
|
19天前
|
Linux 网络安全
linux免密登录报错 Bad owner or permissions on /etc/ssh/ssh_config.d/05-redhat.conf
linux免密登录报错 Bad owner or permissions on /etc/ssh/ssh_config.d/05-redhat.conf
25 1
|
19天前
|
关系型数据库 MySQL Linux
linux CentOS 7.4下 mysql5.7.20 密码改简单的方法
linux CentOS 7.4下 mysql5.7.20 密码改简单的方法
22 0
|
26天前
|
Ubuntu Linux
常用Linux开机启动添加方法
常用Linux开机启动添加方法
16 1
|
1天前
|
网络协议 Serverless 应用服务中间件
Serverless 应用引擎操作报错合集之在阿里云函数计算中,服务器调用FC函数时出现 "[Errno -3] Temporary failure in name resolution)" 错误如何解决
Serverless 应用引擎(SAE)是阿里云提供的Serverless PaaS平台,支持Spring Cloud、Dubbo、HSF等主流微服务框架,简化应用的部署、运维和弹性伸缩。在使用SAE过程中,可能会遇到各种操作报错。以下是一些常见的报错情况及其可能的原因和解决方法。
11 4
|
1天前
|
XML 敏捷开发 存储
深入理解软件自动化测试中的数据驱动策略
【4月更文挑战第27天】 在现代软件开发过程中,自动化测试是确保产品质量和加快市场投放速度的关键步骤。本文专注于探讨数据驱动测试(DDT)策略,它是一种将测试脚本与测试数据分离的方法,旨在提高测试覆盖率和效率。通过分析数据驱动测试的工作原理、实施方法以及面临的挑战,本文为读者提供一个清晰的视角来理解和应用这一策略,以优化其自动化测试流程。
|
3天前
|
人工智能 Linux
Linux查找大文件的方法
Linux查找大文件的方法
|
5天前
|
算法 测试技术 持续交付
深入白盒测试:提升软件质量与效率的关键策略
【4月更文挑战第23天】 在软件开发的复杂多变的环境中,确保产品的质量和可靠性是至关重要的。白盒测试作为一种重要的软件测试方法,允许测试者通过检查内部结构、设计和编码来验证软件的功能性和正确性。本文将探讨白盒测试的关键概念、技术及其在提升软件测试效率和质量中的应用。我们将重点讨论如何借助白盒测试发现潜在缺陷、优化测试用例设计,并通过具体案例分析展示其在实际中的应用效果。
|
5天前
|
测试技术
深入白盒测试:提升软件结构透视能力
【4月更文挑战第23天】在软件测试的广阔天地中,白盒测试以其独特的内在逻辑和代码透视能力而显得尤为重要。它不仅仅是一个测试方法,更是一种确保软件质量和可靠性的重要手段。本文将深入探讨白盒测试的概念、方法和最佳实践,旨在为软件开发和测试人员提供一种系统的视角,以帮助他们更好地理解并应用白盒测试技术,进而提高软件产品的质量。
5 0
|
6天前
|
分布式计算 Hadoop Scala
Spark【环境搭建 01】spark-3.0.0-without 单机版(安装+配置+测试案例)
【4月更文挑战第13天】Spark【环境搭建 01】spark-3.0.0-without 单机版(安装+配置+测试案例)
8 0

热门文章

最新文章