By chenyi, 27 March, 2025

1、错误问题:BLAST Database creation error: Near line 68473, the local id is too long.  Its length is 68 but the maximum allowed local id length is 50.  Please find and correct all local ids that are too long.


[root@db7d3cd5bc06 nucleotide]# /var/www/html/ViroblastStandalone/blast+/bin/makeblastdb -in /var/www/html/ViroblastStandalone/raw/Torreya_grandis_raw/Tgra.chr.cds -out Tgra.chr.cds -dbtype nucl -parse_seqids

Building a new DB, current time: 09/23/2024 08:39:45
New DB name:   /var/www/html/ViroblastStandalone/db/nucleotide/Tgra.chr.cds
New DB title:  /var/www/html/ViroblastStandalone/raw/Torreya_grandis_raw/Tgra.chr.cds
Sequence type: Nucleotide
Keep MBits: T
Maximum file size: 1000000000B

BLAST Database creation error: Near line 68473, the local id is too long.  Its length is 68 but the maximum allowed local id length is 50.  Please find and correct all local ids that are too long.


错误消息表明文件中的本地序列 ID 超出了允许的最大长度 50 个字符。这时候我们可以通过命令提取超过50字符的ID的位置

[root@db7d3cd5bc06 nucleotide]# awk '/^>/ { if(length($0) > 50) print "Line " NR ": " $0 }' /var/www/html/ViroblastStandalone/raw/Torreya_grandis_raw/Tgra.chr.cds

 

这是版本不同的原因,要么把这个ID修改掉,这样这个ID就无法对应到其他文件的这个ID。所以我用的我之前建好的库。

2、blast结果download的时候,下载的是.download.fas,但是在data目录里可以看到我们需要的是.out.par。

先全局搜索哪个文件里面包含了.download.fas

[root@db7d3cd5bc06 viroblast]# grep -r ".download.fas" /var/www/html/viroblast/
/var/www/html/viroblast/sequence.php:$downloadFile = $jobid.".download.fas


搜索出来这个设置是在sequence.php中修改的。
$downloadFile = $jobid.".out.par";

修改了之后再去下载页面点击download会出现Not allowed file type.

出现“Not allowed file type”的错误,说明 Viroblast 的下载功能或安全配置中对文件类型进行了限制,导致 .out.par 文件不被允许下载。这个限制存在于download.php的配置文件。所以要可以修改download.php文件

在download.php文件中有一串代码,在里面添加红色的部分。问题就解决


// Allowed extensions list in format 'extension' => 'mime type'
// If myme type is set to empty string then script will try to detect mime type 
// itself, which would only work if you have Mimetype or Fileinfo extensions
// installed on server.
$allowed_ext = array (
 // archives
 'zip' => 'application/zip',
 // documents
 'pdf' => 'application/pdf',
 'doc' => 'application/msword',
 'xls' => 'application/vnd.ms-excel',
 'ppt' => 'application/vnd.ms-powerpoint',
 'txt' => 'application/txt',
 'fas' => 'application/fas',
 'tar' => 'application/tar',
 'par' => 'text/plain', 

 // executables
 'exe' => 'application/octet-stream',
 // images
 'gif' => 'image/gif',
 'png' => 'image/png',
 'jpg' => 'image/jpeg',
 'jpeg' => 'image/jpeg',
 // audio
 'mp3' => 'audio/mpeg',
 'wav' => 'audio/x-wav',
 // video
 'mpeg' => 'video/mpeg',
 'mpg' => 'video/mpeg',
 'mpe' => 'video/mpeg',
 'mov' => 'video/quicktime',
 'avi' => 'video/x-msvideo'
);