一、软件下载与安装设置二、数据库格式化三、序列相似性检索
一、软件下载与安装设置1、进入网站,根据电脑系统选择相应最新版本下载,也可以选择需要的历史版本下载。
2、解压,双击exe文件安装软件,默认安装到C盘,可以自定义安装目录。如果是免安装版本,直接将解压后的文件夹移动到安装目录下。
3、在安装目录下新建文件夹并重命名为db,作为数据库文件夹。
4、右键打开我的电脑-属性-高级系统设置-环境变量用户变量中新建,变量名BLASTDB,变量值D:\blast-2.9.0+\db(即数据库文件夹路径)。系统变量中选择Path-编辑-新建,D:\blast-2.9.0+\bin(即安装目录下bin文件夹路径)。
5、查看程序版本信息。(1)运行cmd,显示如下。
C:\Users\用户名>(1.1)如果安装路径不在C盘,输入相应盘符+冒号后回车,显示如下。
C:\Users\用户名>D:D:\>再输入cd +文件夹路径后回车,完成命令,显示如下。
C:\Users\用户名>D:D:\>cd D:\blast-2.9.0+D:\blast-2.9.0+>(1.2)如果安装路径在C盘,直接输入cd +文件夹路径后回车,完成命令,显示如下。
C:\Users\用户名>cd C:\blast-2.9.0+C:\blast-2.9.0+>(2)转到安装目录下后,输入blastn -version查看版本,如下示例即为成功。
D:\blast-2.9.0+>blastn -versionblastn: 2.2.31+Package: blast 2.2.31, build Jun 2 2015 10:18:08D:\blast-2.9.0+>
二、数据库格式化1、下载需要的数据库,放到db文件夹下,必须是fasta格式。
2、执行命令转到db文件夹下,再执行如下命令。
makeblastdb -in xxx.fasta -dbtype nucl/prot -parse_seqids -hash_index -out abc
-in xxx.fasta 复制需要建库的fasta序列名称
-dbtype nucl/prot 如果是核酸库用nucl,蛋白库则用prot
-parse_seqids -hash_index 默认加上,不用修改
-out abc 所建数据库的名称,自己写
如果成功则显示如下类似。
D:\blast-2.9.0+\db>makeblastdb -in final_gene.cds.fasta -dbtype nucl -parse_seqids -hash_index -out CDSBuilding a new DB, current time: 06/01/2020 15:46:31New DB name: D:\blast-2.9.0+\db\CDSNew DB title: final_gene.cds.fastaSequence type: NucleotideKeep Linkouts: TKeep MBits: TMaximum file size: 1000000000BAdding sequences from FASTA; added 164632 sequences in 12.4702 seconds.D:\blast-2.9.0+\db>3、至此,本地数据库已建立完成。
三、序列相似性检索1、将查询序列整理为fasta格式,放入安装目录下。
2、运行cmd,转到安装目录下,输入如下命令。
blastx.exe -query xxx.fasta -db db\abc -evalue 1e-5 -out xxx.xml -outfmt "6" -num_alignments 10 -num_threads 2
blastx.exe 程序名,根据需要选择:
blastn:输入核酸序列与核酸库比对
blastx:输入核酸序列与蛋白库比对
blastp:输入蛋白序列与蛋白库比对
tblastn:输入蛋白序列与核酸库比对
tblastx:输入核酸序列与核酸库比对(蛋白质层面)
query xxx.fasta 查询序列的文件名
db abc 格式化后的数据库名称
evalue 1e-5 比对的e-value值
out xxx.xml 输出结果的文件名
outfmt “6” 输出格式,根据需要选择0-18,常用6、7、10:
0 = Pairwise
1 = Query-anchored showing identities
2 = Query-anchored no identities
3 = Flat query-anchored showing identities
4 = Flat query-anchored no identities
5 = BLAST XML
6 = Tabular
7 = Tabular with comment lines
8 = Seqalign (Text ASN.1)
9 = Seqalign (Binary ASN.1)
10 = Comma-separated values
11 = BLAST archive (ASN.1)
12 = Seqalign (JSON)
13 = Multiple-file BLAST JSON
14 = Multiple-file BLAST XML2
15 = Single-file BLAST JSON
16 = Single-file BLAST XML2
17 = Sequence Alignment/Map (SAM)
18 = Organism Report
num_alignments 10 输出比对上的序列的最大值条目数
num_threads 线程数,一般不用管
如果成功则显示如下类似,等待一会儿当第二行跳出来时,结果文件已经输出到安装目录下。
D:\blast-2.9.0+>blastx.exe -query CDS.fasta -db db\PROTEIN -evalue 1e-5 -out 1.txt -outfmt "6" -num_alignments 50 -num_threads 2D:\blast-2.9.0+>