注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

云之南

风声,雨声,读书声,声声入耳;家事,国事,天下事,事事关心

 
 
 

日志

 
 
关于我

专业背景:计算机科学 研究方向与兴趣: JavaEE-Web软件开发, 生物信息学, 数据挖掘与机器学习, 智能信息系统 目前工作: 基因组, 转录组, NGS高通量数据分析, 生物数据挖掘, 植物系统发育和比较进化基因组学

网易考拉推荐

NCBI的blast+软件使用说明书  

2017-01-17 12:53:36|  分类: 生信分析软件 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

2009年7月,NCBI发布了BLAST升级版——BLAST+,BLAST+使用了BLAST的核心算法,延 续了BLAST的优势功能,发展并增强了如BLAST的fastacmd程序,新增了如update_blastdb.pl等 程序。下面简单列举此次修改的主要内容:

  • 高度模块化是本次修改的主要目标,不仅从理论上,更是从代码上明 确模块化了BLAST的三个过程:setup, scanning, trace-back。
  • 选择的ISO C99标准,使得源代码可以同时被c以及c++使用,不需要做任何修改。
  • Database mask:之前的版本 需要第三方软件如RepeatMasker来mask数据库,c现在内置了WindowMasker和DUST来进行重复序列过滤。
  • 使 用Query split, Partial subject sequence retrieval以及Retrieving subject sequences from an arbitrary source等策略来提高长序列(如染色体序列)的比对效率,有效的降低了CPU时 间,充分使用了一、二级缓存。
  • 全新的命令行参数使用方式,添加了长字符串作为参数的支持,如-out,而不是以前的-o,关 于每一个程序其具体的命令行参数,可以通过添加-help参数来查阅。
  • 分离blastn, blastp, blastx等作为独立的程序以替代之前的blastall -p blastn模式。
  • makeblastdb, blastdb_aliastool, blastdbcmd三个程序都和数据库有关,增强了数据库方面的处理。
  • 添加 Best-Hit算法,只报告最优的Hit。比较有意思的是,最新的FASTA (version 36) 程序学习BLAST添加了multi-HSP 的功能,而BLAST+却学习FASTA添加了Best-Hit的功能。互相学习,互相提高。其实,在BLAST是学习并消化吸收了 一大批文章中的先进成果而发展起来的,例如MPBLAST, BLAST++, miBLAST, BLAT等。
  • 添加了保存search strategy的功能,所谓search strategy也就是程序运行时的参数等信息(还包括对数据库的一些定制,详细信息会在后面的文章中介绍)。

BLAST+的下载与使用

下面简要介绍一下BLAST+的使用:

BLAST+与BLAST相比,有很多改进和提高,前面已经有所介绍。NCBI强烈推荐放弃BLAST,使用BLAST+, 这里说的BLAST和BLAST+,都是本地单机版程序。

程序下载FTP地址:ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/

格式化数据库

de>1de> de>makeblastdb -in db.fasta -dbtype prot -parse_seqids -out dbnamede>

参数说明:

-in:待格式化的序列文件

-dbtype:数据库类型,prot或nucl

-out:数据库名

蛋白序列比对蛋白数据库(blastp)

de>1de> de>blastp -query seq.fasta -out seq.blast -db dbname -outfmt 6 -evalue 1e-5 -num_descriptions 10 -num_threads 8de>

参数说明:

-query: 输入文件路径及文件名

-out:输出文件路径及文件名

-db:格式化了的数据库路径及数据库名

-outfmt:输出文件格式,总共有12种格式,6是tabular格式对应BLAST的m8格式

-evalue:设置输出结果的e-value值

-num_descriptions:tabular格式输出结果的条数

-num_threads:线程数

附:Blast结果m8格式意义

进行Blast比对,用参数-m 8可以以列表的方式输出结果,结果中从左到右每一列的意义分别是:

[00] Query id

[01] Subject id

[02] % identity

[03] alignment length

[04] mismatches

[05] gap openings

[06] q. start

[07] q. end

[08] s. start

[09] s. end

[10] e-value

[11] bit score

核酸序列比对核酸数据库(blastn)以及核酸序列比对蛋白数据库(blastx)

与上面的blastp用法类似:

de>1de> de>blastn -query seq.fasta -out seq.blast -db dbname -outfmt 6 -evalue 1e-5 -num_descriptions 10 -num_threads 8de>
de>blastx -query seq.fasta -out seq.blast -db dbname -outfmt 6 -evalue 1e-5 -num_descriptions 10 -num_threads 8

de>
http://boyun.sh.cn/bio/?p=1887


一:下载安装该软件

在NCBI的ftp站点里面可以找到blast++的下载链接

 ftp://ftp.ncbi.nlm.nih.gov/blast/executables/LATEST/

解压即可使用

NCBI的blast使用414

可以把它们添加到PATH,前提是有root权限,或者把该目录添加到PATH也行。

cp  *  /home/my-bin/bin/

我把my-bin添加到了我的PATH,所以可以直接使用这些程序了
二:准备数据

只需要fasta文件的数据即可,query和target都可以是该fasta文件,可以随便找两个fa文件做测试

三:运行命令

1,建库,用makeblastdb,标准是

makeblastdb -in db.fasta -dbtype prot -parse_seqids -out dbname

具体参数看help里面的,但是我们一般用这几个就够了的

NCBI的blast使用953

我的例子 :对200M的蛋白文件

makeblastdb -in uniprot_sprot.trinotate_v2.0.pep -dbtype prot -parse_seqids -out sprot

NCBI的blast使用1255

输出的文件如下,基本不需要看,反正调用的时候只用sprot这个

NCBI的blast使用1489

对8G的uniref90,

makeblastdb -in uniprot_uniref90.trinotate_v2.0.pep -dbtype prot -parse_seqids -out uniref90

NCBI的blast使用1794

2,比对分为好几种,blastn, blastp,blastx,tblastn,tblastx

  • blastp -query seq.fasta -out seq.blast -db dbname -outfmt 6 -evalue 1e-5 -num_descriptions 10 -num_threads 8
  • blastn -query seq.fasta -out seq.blast -db dbname -outfmt 6 -evalue 1e-5 -num_descriptions 10 -num_threads 8
  • blastx -query seq.fasta -out seq.blast -db dbname -outfmt 6 -evalue 1e-5 -num_descriptions 10 -num_threads 8

参数说明:

  • -query: 输入文件路径及文件名
  • -out:输出文件路径及文件名
  • -db:格式化了的数据库路径及数据库名
  • -outfmt:输出文件格式,总共有12种格式,6是tabular格式对应BLAST的m8格式
  • -evalue:设置输出结果的e-value值
  • -num_descriptions:tabular格式输出结果的条数
  • -num_threads:线程数

四:输出文件解读

重点是-outfmt 6,也就是之前版本的m 8格式

结果中从左到右每一列的意义分别是:

  • [00] Query id
  • [01] Subject id
  • [02] % identity
  • [03] alignment length
  • [04] mismatches
  • [05] gap openings
  • [06] q. start
  • [07] q. end
  • [08] s. start
  • [09] s. end
  • [10] e-value
  • [11] bit score
用法说明
USAGE
  blastn [-h] [-help] [-import_search_strategy filename]
    [-export_search_strategy filename] [-task task_name] [-db database_name]
    [-dbsize num_letters] [-gilist filename] [-seqidlist filename]
    [-negative_gilist filename] [-entrez_query entrez_query]
    [-db_soft_mask filtering_algorithm] [-db_hard_mask filtering_algorithm]
    [-subject subject_input_file] [-subject_loc range] [-query input_file]
    [-out output_file] [-evalue evalue] [-word_size int_value]
    [-gapopen open_penalty] [-gapextend extend_penalty]
    [-perc_identity float_value] [-xdrop_ungap float_value]
    [-xdrop_gap float_value] [-xdrop_gap_final float_value]
    [-searchsp int_value] [-max_hsps_per_subject int_value] [-penalty penalty]
    [-reward reward] [-no_greedy] [-min_raw_gapped_score int_value]
    [-template_type type] [-template_length int_value] [-dust DUST_options]
    [-filtering_db filtering_database]
    [-window_masker_taxid window_masker_taxid]
    [-window_masker_db window_masker_db] [-soft_masking soft_masking]
    [-ungapped] [-culling_limit int_value] [-best_hit_overhang float_value]
    [-best_hit_score_edge float_value] [-window_size int_value]
    [-off_diagonal_range int_value] [-use_index boolean] [-index_name string]
    [-lcase_masking] [-query_loc range] [-strand strand] [-parse_deflines]
    [-outfmt format] [-show_gis] [-num_descriptions int_value]
    [-num_alignments int_value] [-html] [-max_target_seqs num_sequences]
    [-num_threads int_value] [-remote] [-version]

DESCRIPTION
   Nucleotide-Nucleotide BLAST 2.2.28+

OPTIONAL ARGUMENTS
 -h
   Print USAGE and DESCRIPTION;  ignore all other parameters
 -help
   Print USAGE, DESCRIPTION and ARGUMENTS; ignore all other parameters
 -version
   Print version number;  ignore other arguments

 *** Input query options
 -query <File_In>
   Input file name
   Default = `-'
 -query_loc <String>
   Location on the query sequence in 1-based offsets (Format: start-stop)
 -strand <String, `both', `minus', `plus'>
   Query strand(s) to search against database/subject
   Default = `both'

 *** General search options
 -task <String, Permissible values: 'blastn' 'blastn-short' 'dc-megablast'
                'megablast' 'rmblastn' >
   Task to execute
   Default = `megablast'
 -db <String>
   BLAST database name
    * Incompatible with:  subject, subject_loc
 -out <File_Out>
   Output file name
   Default = `-'
 -evalue <Real>
   Expectation value (E) threshold for saving hits
   Default = `10'
 -word_size <Integer, >=4>
   Word size for wordfinder algorithm (length of best perfect match)
 -gapopen <Integer>
   Cost to open a gap
 -gapextend <Integer>
   Cost to extend a gap
 -penalty <Integer, <=0>
   Penalty for a nucleotide mismatch
 -reward <Integer, >=0>
   Reward for a nucleotide match
 -use_index <Boolean>
   Use MegaBLAST database index
 -index_name <String>
   MegaBLAST database index name

 *** BLAST-2-Sequences options
 -subject <File_In>
   Subject sequence(s) to search
    * Incompatible with:  db, gilist, seqidlist, negative_gilist,
   db_soft_mask, db_hard_mask
 -subject_loc <String>
   Location on the subject sequence in 1-based offsets (Format: start-stop)
    * Incompatible with:  db, gilist, seqidlist, negative_gilist,
   db_soft_mask, db_hard_mask, remote

 
*** 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,
    11 = BLAST archive format (ASN.1)
  

   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
           qaccver means Query accesion.version
              qlen means Query sequence length
            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
           saccver means Subject accession.version
           sallacc means All subject accessions
              slen means Subject sequence length
            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
              btop means Blast traceback operations (BTOP)
           staxids means Subject Taxonomy ID(s), separated by a ';'
         sscinames means Subject Scientific Name(s), separated by a ';'
         scomnames means Subject Common Name(s), separated by a ';'
        sblastnames means Subject Blast Name(s), separated by a ';'
                         (in alphabetical order)
        sskingdoms means Subject Super Kingdom(s), separated by a ';'
                         (in alphabetical order)
            stitle means Subject Title
        salltitles means All Subject Title(s), separated by a '<>'
           sstrand means Subject Strand
             qcovs means Query Coverage Per Subject
           qcovhsp means Query Coverage Per HSP
   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'
 -show_gis
   Show NCBI GIs in deflines?
 -num_descriptions <Integer, >=0>
   Number of database sequences to show one-line descriptions for
   Not applicable for outfmt > 4
   Default = `500'
    * Incompatible with:  max_target_seqs
 -num_alignments <Integer, >=0>
   Number of database sequences to show alignments for
   Default = `250'
    * Incompatible with:  max_target_seqs
 -html
   Produce HTML output?

 *** Query filtering options
 -dust <String>
   Filter query sequence with DUST (Format: 'yes', 'level window linker', or
   'no' to disable)
   Default = `20 64 1'
 -filtering_db <String>
   BLAST database containing filtering elements (i.e.: repeats)
 -window_masker_taxid <Integer>
   Enable WindowMasker filtering using a Taxonomic ID
 -window_masker_db <String>
   Enable WindowMasker filtering using this repeats database.
 -soft_masking <Boolean>
   Apply filtering locations as soft masks
   Default = `true'
 -lcase_masking
   Use lower case filtering in query and subject sequence(s)?

 *** Restrict search or results
 -gilist <String>
   Restrict search of database to list of GI's
    * Incompatible with:  negative_gilist, seqidlist, remote, subject,
   subject_loc
 -seqidlist <String>
   Restrict search of database to list of SeqId's
    * Incompatible with:  gilist, negative_gilist, remote, subject,
   subject_loc
 -negative_gilist <String>
   Restrict search of database to everything except the listed GIs
    * Incompatible with:  gilist, seqidlist, remote, subject, subject_loc
 -entrez_query <String>
   Restrict search with the given Entrez query
    * Requires:  remote
 -db_soft_mask <String>
   Filtering algorithm ID to apply to the BLAST database as soft masking
    * Incompatible with:  db_hard_mask, subject, subject_loc
 -db_hard_mask <String>
   Filtering algorithm ID to apply to the BLAST database as hard masking
    * Incompatible with:  db_soft_mask, subject, subject_loc
 -perc_identity <Real, 0..100>
   Percent identity
 -culling_limit <Integer, >=0>
   If the query range of a hit is enveloped by that of at least this many
   higher-scoring hits, delete the hit
    * Incompatible with:  best_hit_overhang, best_hit_score_edge
 -best_hit_overhang <Real, (>=0 and =<0.5)>
   Best Hit algorithm overhang value (recommended value: 0.1)
    * Incompatible with:  culling_limit
 -best_hit_score_edge <Real, (>=0 and =<0.5)>
   Best Hit algorithm score edge value (recommended value: 0.1)
    * Incompatible with:  culling_limit
 -max_target_seqs <Integer, >=1>
   Maximum number of aligned sequences to keep
   Not applicable for outfmt <= 4
   Default = `500'
    * Incompatible with:  num_descriptions, num_alignments

 *** Discontiguous MegaBLAST options
 -template_type <String, `coding', `coding_and_optimal', `optimal'>
   Discontiguous MegaBLAST template type
    * Requires:  template_length
 -template_length <Integer, Permissible values: '16' '18' '21' >
   Discontiguous MegaBLAST template length
    * Requires:  template_type

 *** Statistical options
 -dbsize <Int8>
   Effective length of the database
 -searchsp <Int8, >=0>
   Effective length of the search space
 -max_hsps_per_subject <Integer, >=0>
   Override maximum number of HSPs per subject to save for ungapped searches
   (0 means do not override)
   Default = `0'

 *** Search strategy options
 -import_search_strategy <File_In>
   Search strategy to use
    * Incompatible with:  export_search_strategy
 -export_search_strategy <File_Out>
   File name to record the search strategy used
    * Incompatible with:  import_search_strategy

 *** Extension options
 -xdrop_ungap <Real>
   X-dropoff value (in bits) for ungapped extensions
 -xdrop_gap <Real>
   X-dropoff value (in bits) for preliminary gapped extensions
 -xdrop_gap_final <Real>
   X-dropoff value (in bits) for final gapped alignment
 -no_greedy
   Use non-greedy dynamic programming extension
 -min_raw_gapped_score <Integer>
   Minimum raw gapped score to keep an alignment in the preliminary gapped and
   traceback stages
 -ungapped
   Perform ungapped alignment only?
 -window_size <Integer, >=0>
   Multiple hits window size, use 0 to specify 1-hit algorithm
 -off_diagonal_range <Integer, >=0>
   Number of off-diagonals to search for the 2nd hit, use 0 to turn off
   Default = `0'

 *** Miscellaneous options
 -parse_deflines
   Should the query and subject defline(s) be parsed?
 -num_threads <Integer, >=1>
   Number of threads (CPUs) to use in the BLAST search
   Default = `1'
    * Incompatible with:  remote
 -remote
   Execute search remotely?
    * Incompatible with:  gilist, seqidlist, negative_gilist, subject_loc,
   num_threads

  评论这张
 
阅读(352)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017