Newly1992的个人博客分享 http://blog.sciencenet.cn/u/Newly1992

博文

antismash 本地安装教程

已有 9203 次阅读 2020-7-4 20:50 |个人分类:生物信息|系统分类:科研笔记| Antismash, 次级代谢产物簇

antismash 安装教程

写在前面: antismash软件需要的依赖包很多,本地安装很麻烦,我也是安装了两三天才搞定,所以把安装心得和遇到的问题记录下来,网上的antismash的安装教程比较多,不过基本上是使用Conda辅助安装。Conda辅助安装会有很多问题,我尝试了很多次,都是卡在最后一步,所以这里只能使用Conda和手动安装结合。

首先是依赖包

官方安装说明地址:https://docs.antismash.secondarymetabolites.org/install/#manual-install

Github网址:https://github.com/antismash/

根据官方的说明提供需要antismash的依赖包是:

Install the following dependencies:

diamond (versions 0.8.36, 0.9.17, and 0.9.24 tested, we recommended the 0.9 series)
fasttree (version 2.1.9 tested)
GlimmerHMM (version 3.0.4 tested)
hmmer2 (version 2.3.2 tested, append a 2 to all hmmer2 executables to avoid conflict with hmmer3 executable names, like hmmalign -> hmmalign2)
hmmer3 (3.1b2 tested)
meme (version 4.11.2 tested. Version 4.11.4 changes output file formats, so don't use that.)
muscle (version 3.8.31 tested)
NCBI blast+ (version 2.6.0 tested)
prodigal (version 2.6.3 tested)
python (version 3.5.3 tested, any version >= 3.5.0 should work)
python-virtualenv (not needed, but highly recommended)

我们使用conda创建一个新的环境:(这里只建立新的环境)

## 创建新的环境
$ conda create -n antismash
## 切换到antismash环境中
$ conda activate antismash

然后安装需要的依赖包:

$ conda install -y diamond=0.8.36
$ conda install -y fasttree=2.1.9
$ conda install -y glimmerhmm=3.0.4
$ conda install -y hmmer=2.3.2
$ conda install -y hmmer=3.1b2
$ conda install -y meme=4.11.2
$ conda install -y muscle=3.8.1551
$ conda install -y blast=2.2.31
$ conda install -y prodigal=2.6.3
$ conda install -y java-jdk
$ conda install -y python

官方的说明是说要建立python的环境,不过我们这里使用的是conda环境,所以就可以直接跳过建立python环境。

外部的一些依赖包安装好以后,接下来是下载antismash

$ wget https://dl.secondarymetabolites.org/releases/5.1.2/antismash-5.1.2.tar.gz
$ tar -zxf antismash-5.1.2.tar.gz
$ pip install ./antismash-5.1.2

这里就完成了antismash的本地安装,接下来是下载需要的数据库。

## 这里我们可以使用官方的办法进行下载数据库,不过下载速度很慢(因为是国外网站,你们都懂的)
$ download-antismash-databases

所以我推荐是直接去相应的地址下载,可以用IDM下载器,或者其他方式,但是我们首先要知道要下载哪些数据文件。通过查看源代码,知道需要下载的数据如下:

## Pfam27.0/Pfam-A.hmm.gz
url=ftp://ftp.ebi.ac.uk/pub/databases/Pfam/releases/Pfam27.0/Pfam-A.hmm.gz
## Pfam31.0/Pfam-A.hmm.gz
url=ftp://ftp.ebi.ac.uk/pub/databases/Pfam/releases/Pfam31.0/Pfam-A.hmm.gz
## CLUSTERBLAST_database
url=https://dl.secondarymetabolites.org/releases/clusterblast/clusterblast_20190415.tar.xz
## resfams/Resfams.hmm.gz
url=http://dantaslab.wustl.edu/resfams/Resfams.hmm.gz

将上诉数据下载下来以后,接下来是放在相应的文件夹内,(这里是按照我的安装路径进行存放)

$ cd ~/miniconda3/envs/antismash/lib/python3.7/site-packages/antismash/databases
$ mkdir -p pfam/27.0
$ cp Pfam27.0/Pfam-A.hmm.gz pfam/27.0
$ mkdir -p pfam/31.0
$ cp Pfam31.0/Pfam-A.hmm.gz pfam/31.0
$ mkdir -p resfam
$ cp resfams/Resfams.hmm.gz resfam
$ cp clusterblast_20190415.tar.xz ./

把下载好的数据放在相应的文件夹后,使用官方下载命令,可以对这些数据进行处理

$ download-antismash-databases
## 得到以下的结果则说明数据库下载并且配置成功
Creating checksum of Pfam-A.hmm
PFAM file present and ok for version 27.0
Downloading PFAM version 31.0
Creating checksum of Pfam-A.hmm.gz
Creating checksum of Pfam-A.hmm.gz
Extraction of Pfam-A.hmm.gz finished successfully.
Resfams database present and checked
Creating checksum of proteins.fasta
ClusterBlast fasta file present and checked
Pre-building all databases...
done.

当出现上诉输出时就说明数据安装已经没有问题了。接下来就是验证antismash软件是否安装成功!根据官方说明使用以下命令进行验证。

$ antismash --check-prereqs

当出现以下输出结果则表示antismash安装成功啦!

All prerequisites satisfied

查看antismash帮助文档:

$ antismash -h

此处的antiSMASH版本v5.1.2,与antismash 4.0版本略有不同,以下介绍主要参数。

注:以下参数大多直接根据字面意思翻译,并且涉及到的算法我也不很懂,可能翻译有误,所以仅供参考……

-h, --help:                                              帮助文档 

--help-showall                                      在此帮助文本上显示完整的参数列表 

-c CPUS, --cpus CPUS                          设置并行使用cpu数量(默认是12个)

基础分析选项:

 --taxon {bacteria,fungi}                    选择物种类型(默认是bacteria)

附加分析选项:

 --fullhmmer                                        进行全基因组的HMMER分析.  

--cassis                                                基于Motif的SM基因聚类区域预测.  

--cf-borders-only                               只注释现有集群的边界.  

--cf-create-clusters                            找额外的集群.  

--clusterhmmer                                 运行受群集限制的HMMer分析.  

--smcog-trees                                    生成次级代谢产物簇的直系同源组的系统发育树.  

--tta-threshold TTA_THRESHOLD   用于注释TTA密码子的最低GC含量(默认值:0.65)  

--cb-general                                       将确定的簇与antiSMASH预测的簇数据库进行比较.  

--cb-subclusters                                将识别出的簇与已知负责合成前体细胞的子簇进行比较。  

--cb-knownclusters                          MIBiG数据库中识别出的簇与已知确定的基因簇进行比较.  

--asf                                                    活性位点查找运行分析.  

--pfam2go                                         运行Pfam对同源基因映射模块.

输出参数:

 --output-dir OUTPUT_DIR              输出文件夹.  

--html-title HTML_TITLE                  HTML输出页面的标题(默认为输入文件名)。  

--html-description HTML_DESCRIPTION      自定义描述添加到输出中。

基因查找选项(注释ORF时忽略):

 --genefinding-tool {glimmerhmm,prodigal,prodigal-m,none,error}                

       指定用于基因发现的算法:GlimmerHMM,Prodigal,Prodigal Metagenomic / Anonymous 模式或无。 如果尝试基因发现,“错误”选项将引发错误。 'none'选项将不会运行基因查找。 (默认值:错误).  

--genefinding-gff3 GFF3_FILE   指定GFF3文件以提取特征。

antismash运行示例:

快速运行:四核计算机运行一个细菌基因组大概是2分钟

$ antismash streptomyces_coelicolor.gbk

最小运行:四核计算机运行一个细菌基因组大概是1分钟

$ antismash --minimal streptomyces_coelicolor.gbk

全功能运行:四核计算机运行一个细菌基因组大概是20分钟

$ antismash --cb-general --cb-knownclusters --cb-subclusters --asf --pfam2go \
--smcog-trees streptomyces_coelicolor.gbk


在这里我遇到的问题有:  

问题1报错:
Pre-building all databases...
Error encountered while preparing module data: Failed to hmmpress '/home/zhou/miniconda3/envs/antismash/lib/python3.7/site-packages/antismash/detection/hmm_detection/data/bgc_seeds.hmm':
Error: File /home/zhou/miniconda3/envs/antismash/lib/python3.7/site-packages/antismash/detection/hmm_detection/data/bgc_seeds.hmm does not appear to be in a recognized HMM format.

这个问题主要是因为一开始我只安装了hmmer2没有安装hmmer3所以导致的很多HMM格式的文件不能使用hmmer2进行处理,解决办法就是安装hmmer3了。问题答案相关链接:https://www.biostars.org/p/114774/

问题2报错:
muscle
Segmentation fault (core dumped)

这个问题解释就比较复杂了,照成的原因可能是我安装出了错,或者是muscle的版本出错了,所以这里解决方法是重新安装或者更新muscle软件。问题答案相关链接:https://www.jianshu.com/p/c23fa18c14f5

问题3报错
stdout:
stderr: Traceback (most recent call last):
File "/home/bac/anaconda2/envs/antismash/lib/python3.7/site-packages/helperlibs/bio/seqio.py", line 21, in
from cStringIO import StringIO
ModuleNotFoundError: No module named 'cStringIO'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/bac/anaconda2/envs/antismash/bin/download-antismash-databases", line 7, in
from antismash.download_databases import _main
File "/home/bac/anaconda2/envs/antismash/lib/python3.7/site-packages/antismash/init.py", line 12, in
from antismash.main import run_antismash, get_detection_modules,
File "/home/bac/anaconda2/envs/antismash/lib/python3.7/site-packages/antismash/main.py", line 31, in
from antismash.common import logs, record_processing, serialiser
File "/home/bac/anaconda2/envs/antismash/lib/python3.7/site-packages/antismash/common/record_processing.py", line 16, in
from helperlibs.bio import seqio
File "/home/bac/anaconda2/envs/antismash/lib/python3.7/site-packages/helperlibs/bio/seqio.py", line 23, in
from Bio._py3k import StringIO
ModuleNotFoundError: No module named 'Bio._py3k'

按照antismash作者的说明是,最新的biopython删除了_py3k模块,所以需要将这里的helperlibs升级到0.2.0版本即可。问题答案相关链接:https://github.com/antismash/antismash/issues/274#issuecomment-651766041

## 升级命令
pip install helperlibs

这个问题在使用我上诉方法时是不会出现的

问题和安装方法就说到这了,如果大家有什么问题可以私信我,或者需要antismash数据库文件的也可以私信我(不过仅限antismash5.1.2版本的数据库文件)





https://blog.sciencenet.cn/blog-3416913-1240614.html

上一篇:基于单个模板的乳酸脱氢酶进行建模--Modeller基础教程
收藏 IP: 218.204.139.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-3 03:10

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部