BLAST用法

1.1程序下载 链接到:ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST

1.2安装

1.3用户环境变量设置

右键点击“我的电脑”-“属性”,然后选择“高级系统设置”标签-“环境变量”(图1),在用户变量下方“Path”随安装过程已自动添加其变量值,即“E:\Blast\bin”。 此时点击“新建”-变量名“BLASTDB”,变量值为“E:\Blast\db”(即数据库路径,图2)。 

1.4查看程序版本信息
点击 Windows 的“开始”菜单,输入“cmd”(XP系统在运行中输入cmd)(图3)调出 MS-DOS 命令行,转到 Blast 安装目录,输入命令“blastn -version”即可查看版本


2.blast+本地数据库的构建

2.1 数据的获取

法 1:直接从 NCBI或者其他数据库网站下载所需序列做成数据库,或者自己已有的测序数据(格式必须是 fasta,名字可以自己随便命名,具体做法下面有说明 )。

法 2:从NCBI中的 ftp 库下载所需要的某一个库或几个库,其链接为ftp://ftp.ncbi.nlm.nih.gov/blast/db/FASTA/其中 nr.gz 为非冗余的数据库,nt.gz 为核酸数据库,month.nt.gz 为最近一个月的核酸序列数据。下载的month.nt.gz先用winrar解压缩,然后用makeblastdb.exe格式化。

法 3:利用新版 blast自带的 update_blastdb.pl进行下载,这需要安装 perl 程序。

上述三种方法各有优缺点,前两种下载速度较快,但是每次进行检索都需要对数据库进行格式化(转化成二进制数据),第三种方法下载速度较慢,但是是 NCBI 中已经格式化好的,在进行本地检索时不需再进行格式化,直接用即可。

2.2数据的格式化

本文以ratwy.fasta作为查询序列,以rat.fasta作为数据库文件为例进行讲解。首先将rat.fasta放到E:\blast\db文件夹下,然后调出MS-DOS命令行,转到E:\blast\db文件夹下运行以下命令:

格式化rat.fasta命令:makeblastdb.exe -in rat.fasta -parse_seqids -hash_index -dbtype prot

-in参数后面接将要格式化的数据库,-parse_seqids, -hash_index两个参数一般都带上,主要是为blastdbcmd取子序列时使用,-dbtype  后接所格式化的序列的类型,核酸用 nucl,蛋白质用prot;如图

至此,本地数据库已经建立完毕!!!


3.序列间的相似性检索

BLAST+系列程序均要求查询序列以fasta格式存在,fasta格式已经程序事实上的序列标准被广泛采用,几乎所有的序列处理程序都要求fasta格式。所谓FASTA格式是指DNA序列第一行开始于一个标识符:">",紧接着(没有空格)是对该序列的唯一描述(即ID),然后一个空格,接着是对该序列的描述(也可以没有),从第二行开始就是一行行的序列,中间的空格,换行没有影响。为了方便阅读,每一行序列最好不要超过80个字母。详细的说明请看着这里http://biocompute.bmi.ac.cn/MPprimer/Fasta_help.html 。

本文以ratwy.fasta作为查询序列,以rat.fasta作为数据库文件为例进行讲解。首先将ratwy.fasta放到E:\blast文件夹下,然后调出MS-DOS命令行,转到E:\blast文件夹下运行以下命令:

blastp.exe -task blastp -query rat1.fasta -db rat.fasta -out text.txt

相关参数说明:blastp.exe  程序执行命令,exe 前的程序根据自己的需要而换;

-task  后面选择你所要用的程序,blastn,blatp,tblastx 等;

-query  后接查询序列的文件名称;

-db  后接格式化好的数据库名称;

-out  后接要输出的文件名称及格式; 如图:

比对结束后可在blast文件夹下查看结果,本文存结果的文件名为ratwy_rat.txt。

4.从格式化本地数据库到序列比对如图:

核酸的比对与蛋白质相似,用blastn.exe。

blastn 的相关命令参数可用 blastn –help 命令查询,blastp 的相关命令参数可用 blastp –help查询,依次类推,如图。这里面有很多参数,比上网找参数的意义省事的多,这个就得自己研究吧!

另外新版blastn还有一个可以定制输出结果的参数-outfmt,有了这个参数,BioPerl、 Biopython中的blast解析器就可以不必使用了。这确实又是BLAST+新版另外一个最大的提高,非常非常方便。本人的一些工作就依赖于BLAST结果的解析,有了这个参数,就不需要解析BLAST结果了,确实很好很强大。具体如何使用,各位可以摸索一下,非常简单。

希望各位战友将自己的经验分享以将 blast 越用越好。

附:以下来自于网友

个人在使用blastn的过程中总结了一些自认为常用的参数,总结如下:

blastn -db database_name -query input_file -out output_file -evalue evalue -max_target_seqs num_sequences -num_threads int_value -outfmt format format_string

blastn -db database_name -query input_file -out output_file -evalue evalue -max_target_seqs num_sequences -num_threads int_value -outfmt format "7 qacc sacc evalue length pident"

例如:

blastn -db plant_rna -query test.fa -out test.out -evalue 0.00001 -max_target_seqs 5 -num_threads 4 -outfmt format "7 qacc sacc evalue length pident"

blastn:这个不用说了吧,核酸对核酸的比对

-db: 指定blast搜索用的数据库,详见上篇文章

-query:用来查询的输入序列,fasta格式

-out:输出结果文件

-evalue: 设置e值cutoff

-max_target_seqs:设置最多的目标序列匹配数(以前我都用-b 5 -v 5,理解不对请指教)

-num_threads:指定多少个cpu运行任务(依赖于你的系统,同于以前的-a参数)

-outfmt format "7 qacc sacc evalue length pident" :这个是新BLAST+中最拉风的功能了,直接控制输出格式,不用再用parser啦, 7表示带注释行的tab格式的输出,可以自定义要输出哪些内容,用空格分格跟在7的后面,并把所有的输出控制用双引号括起来,其中qacc查询序列的acc,sacc表示目标序列的acc,evalue即是e值,length即是匹配的长度,pident即是序列相同的百分比,其他可用的特征(红色字体)如下:

*** Formatting options
-outfmt <String>
alignment view options:
0 = pairwise,
1 = query-anchored showing identities,
2 = query-anchored no identities,
3 = flat query-anchored, show identities,
4 = flat query-anchored, no identities,
5 = XML Blast output,
6 = tabular,
7 = tabular with comment lines,
8 = Text ASN.1,
9 = Binary ASN.1
10 = Comma-separated values

Options 6, 7, and 10 can be additionally configured to produce
a custom format specified by space delimited format specifiers.
The supported format specifiers are:
qseqid means Query Seq-id
qgi means Query GI
qacc means Query accesion
sseqid means Subject Seq-id
sallseqid means All subject Seq-id(s), separated by a ';'
sgi means Subject GI
sallgi means All subject GIs
sacc means Subject accession
sallacc means All subject accessions
qstart means Start of alignment in query
qend means End of alignment in query
sstart means Start of alignment in subject
send means End of alignment in subject
qseq means Aligned part of query sequence
sseq means Aligned part of subject sequence
evalue means Expect value
bitscore means Bit score
score means Raw score
length means Alignment length
pident means Percentage of identical matches
nident means Number of identical matches
mismatch means Number of mismatches
positive means Number of positive-scoring matches
gapopen means Number of gap openings
gaps means Total number of gaps
ppos means Percentage of positive-scoring matches
frames means Query and subject frames separated by a '/'
qframe means Query frame
sframe means Subject frame
When not provided, the default value is:
'qseqid sseqid pident length mismatch gapopen qstart qend sstart send
evalue bitscore', which is equivalent to the keyword 'std'
Default = `0'


  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值