上次写了个帖子下载最新版NCBI NR和NT库小技巧之后自己亲身实践想用2026年3月份下载的NCBI NR库来建立蛋白快速比对工具DIAMOND的参比数据库。1NCBI NR的blast文件是3月20号下载的先使用如下命令提取NR的fasta序列文件大小有500多GBcd /data/Database/NCBI/NR_20260330 find . -name *.tar.gz | xargs -P 3 -I {} tar -zxvf {} blastdbcmd -db nr -entry all -out nr_20260320.fna -logfile nr_20260320.log2然后尝试使用DIAMOND进行建库操作此时DIAMOND的版本是2.1使用的分类学数据库从NCBI Taxonomy下载cd /data/Database/NCBI/NR_20260330 diamond makedb --threads 40 --db nr_20260320 --in nr_20260320.fna --taxonmap /data/Database/NCBI/Taxonomy/prot.accession2taxid.FULL.gz --taxonnodes /data/Database/NCBI/Taxonomy/nodes.dmp --taxonnames /data/Database/NCBI/Taxonomy/names.dmp苦苦等待了4个小时结果报错了。Error: Invalid taxonomic rank: domain不信邪又跑了一遍同样的命令结果还是报错。就去DIAMOND的github主页去搜issues果真不是只有我一个人踩坑。原来是NCBI Taxonomy分类学数据库更新以后引入了一些DIAMOND不识别的分类学单元比如“domain”、“acellular root”等字段导致DIAMOND在运行makedb命令时报错。作者给出了2种解决方案一种是替换字段但可能还有不识别的其他字段sed -i s/domain/superkingdom/g nodes.dmp sed -i s/acellular root/superkingdom/g nodes.dmp sed -i s/domain/superkingdom/g names.dmp sed -i s/acellular root/superkingdom/g names.dmp另外一种是更新DIAMOND到2.2版本以上。保险起见我更新了DIAMOND版本到2.2.2然后再次运行diamond makedb命令这次成功了。然后用一些数据测试diamond blastp和diamond blastx命令都能正常运行。Accession parsing rules triggered for database seqids (use --no-parse-seqids to disable): UniRef prefix 0 gi|xxx| prefix 0 xxx| prefix 31026 |xxx suffix 31026 .xxx suffix 1777776974 :PDB suffix 0 Loading taxonomy names... [74.716s] Loaded taxonomy names for 2832430 taxon ids. Loading taxonomy mapping file... [6247.04s] Joining accession mapping... [2411.12s] Writing taxon id list... [132.179s] Accession parsing rules triggered for mapping file seqids (use --no-parse-seqids to disable): UniRef prefix 0 gi|xxx| prefix 0 xxx| prefix 0 |xxx suffix 0 .xxx suffix 9627320595 :PDB suffix 13 Building taxonomy nodes... [0.013s] 2832430 taxonomy nodes processed. Maximum taxon id: 3713442 Number of nodes assigned to rank: no rank 1144486 superkingdom 0 cellular root 1 acellular root 1 domain 3 realm 7 kingdom 22 subkingdom 1 superphylum 1 phylum 335 subphylum 36 superclass 6 class 620 subclass 169 infraclass 17 cohort 5 subcohort 3 superorder 57 order 2127 suborder 379 infraorder 144 parvorder 33 superfamily 943 family 11495 subfamily 3507 tribe 2552 subtribe 591 genus 131967 subgenus 2157 section 565 subsection 41 series 10 species group 387 species subgroup 134 species 2310534 subspecies 35480 varietas 10832 forma 767 strain 49109 biotype 18 clade 949 forma specialis 853 genotype 22 isolate 1322 morph 11 pathogroup 6 serogroup 164 serotype 573 subvariety 1 Closing the input file... [0s] Closing the database file... [0s] Database sequences 1039527765 Database letters 394734686754 Accessions in database 1778845136 Entries in accession to taxid file 9628382701 Database accessions mapped to taxid 1777684180 Database sequences mapped to taxid 1038852533 Database hash 2bbeccd146905dbc7330e08e1db0b536 Total time 15204s总结有条件的话更新DIAMOND到2.2.*版本是不二法门。