并行BLAST程序耗时太长



当我运行以下代码时,我甚至没有得到一个爆炸结果。谁要是发现了窃听器就告诉我一声?

from Bio.Blast import NCBIWWW
from Bio import SeqIO
from Bio.Blast import NCBIXML
from multiprocessing import Pool
import time

def blast_sequences_parallel(seq_record):
result_handle = NCBIWWW.qblast("blastn", "nt", seq_record.seq, entrez_query='txid10239[viruses]')
blast_records = NCBIXML.parse(result_handle)
return blast_records

if __name__ == "__main__":
file = "file.fa"
get_number_of_seqs(file)
seq_records = SeqIO.parse(file, "fasta")
t1 = time.time()
p = Pool()
results = p.map(blast_sequences_parallel, seq_records)
p.close()
p.join()
print("Pool took:", time.time() - t1)
print(results)

我有73,000序列运行,所以我试图使它更快。我在一台超级计算机上运行它。对于我需要多少内存和多少核心/节点,有什么建议吗?我还在shell中尝试了以下命令:

blastn -query file.fa -remote

但是我得到一个错误消息,建议我需要下载一个数据库?有办法使用在线服务器进行搜索吗?如果有办法,我可以只搜索病毒基因组吗?

对于73K序列,您应该下载一个适当的db并在本地运行BLAST,而不是尝试在线运行它。bioppython也有一个用于此from Bio.Blast.Applications import NcbiblastxCommandline的包装器,但从命令行运行BLAST可能更容易。参见相关的biopython文档。

NCBI提供了一组预先制作的dbs(或者您可以通过makeblastdb从FASTA文件构建自己的dbs): https://ftp.ncbi.nlm.nih.gov/blast/db/

最新更新