mitoz安装taxdump.tar.gz时报错

1.安装mitoz

##网站
https://github.com/linzhi2013/MitoZ/version_2.4-alpha下载解压安装
##find the mitozEnv.yaml file after you download the source codes
cd version_2.4-alpha
conda env create -n mitozEnv -f mitozEnv.yaml
source activate mitozEnv
from ete3 import NCBITaxa
ncbi = NCBITaxa()
ncbi.update_taxonomy_database() ##若下载不了就手动下载放到自己服务器上(wget -c http://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz)
再运行:
python3
from ete3 import NCBITaxa
NCBITaxa(taxdump_file='/path/to/taxdump.tar.gz')

发现sqlite3数据库写不进去东西。

Uploading to /home/people/dinghe/.etetoolkit/taxa.sqlite

Inserting synonyms: 175000 Traceback (most recent call last):
File "", line 1, in
File "/home/projects/ku_00039/people/dinghe/working_dr/mito_genome_assembly/MitoZ_03082021/app/anaconda/lib/python3.6/site-packages/ete3/ncbi_taxonomy/ncbiquery.py", line 86, in init
self.update_taxonomy_database()
File "/home/projects/ku_00039/people/dinghe/working_dr/mito_genome_assembly/MitoZ_03082021/app/anaconda/lib/python3.6/site-packages/ete3/ncbi_taxonomy/ncbiquery.py", line 113, in update_taxonomy_database
update_db(self.dbfile)
File "/home/projects/ku_00039/people/dinghe/working_dr/mito_genome_assembly/MitoZ_03082021/app/anaconda/lib/python3.6/site-packages/ete3/ncbi_taxonomy/ncbiquery.py", line 740, in update_db
upload_data(dbfile)
File "/home/projects/ku_00039/people/dinghe/working_dr/mito_genome_assembly/MitoZ_03082021/app/anaconda/lib/python3.6/site-packages/ete3/ncbi_taxonomy/ncbiquery.py", line 779, in upload_data
db.execute("INSERT INTO synonym (taxid, spname) VALUES (?, ?);", (taxid, spname))
sqlite3.IntegrityError: UNIQUE constraint failed: synonym.spname, synonym.taxid

此时记得更新ete3即可

conda install  ete3=3.1.2
python3
>>> from ete3 import NCBITaxa
>>> NCBITaxa(taxdump_file='/path/taxdump.tar.gz')
Loading node names...

2464628 names loaded.
286261 synonyms loaded.
Loading nodes...
2464628 nodes loaded.
Linking nodes...
Tree is loaded.
Updating database: /home/lx_sky6/.etetoolkit/taxa.sqlite ...
 2464000 generating entries... 
Uploading to /home/lx_sky6/.etetoolkit/taxa.sqlite

Inserting synonyms:      285000 
Inserting taxid merges:  65000 
Inserting taxids:       2460000 

查看是否安装成功

>>> from ete3 import NCBITaxa
>>> a = NCBITaxa()
>>> a.get_name_translator(["Arthropoda"])
{'Arthropoda': [6656]}

安装成功!

你可能感兴趣的:(mitoz安装taxdump.tar.gz时报错)