BLAST-The?learning?notes?of?the?biostar?handbook(7)

Basic Local Alignment Search Tool (BLAST)

個(gè)用來(lái)比對(duì)生物序列的一級(jí)結(jié)構(gòu)(如不同蛋白質(zhì)的氨基酸序列或不同基因的DNA序列)的算法。 已知一個(gè)包含若干序列的數(shù)據(jù)庫(kù),BLAST可以讓研究者在其中尋找與其感興趣的序列相同或類(lèi)似的序列。 例如如果某種非人動(dòng)物的一個(gè)以前未知的基因被發(fā)現(xiàn),研究者一般會(huì)在人類(lèi)基因組中做一個(gè)BLAST搜索來(lái)確認(rèn)人類(lèi)是否包含類(lèi)似的基因(通過(guò)序列的相似性)。BLAST算法以及實(shí)現(xiàn)它的程序由美國(guó)國(guó)家生物技術(shù)信息中心(NCBI)的Warren Gish、David J. Lipman及Webb Miller博士開(kāi)發(fā)的。(from wikipedia)

A suite of tools

blast-table.png

The key concepts of BLAST

-Search may take place in nucleotide and/or protein space or translated spaces where nucleotides are translated into proteins.
-Searches may implement search “strategies”: optimizations to a certain task. Different search strategies will return different alignments.
-Searches use alignments that rely on scoring matrices
-Searches may be customized with many additional parameters. BLAST has many subtle functions that most users never need.

使用BLAST 的基本步驟

1.使用makeblastdb建立BLAST數(shù)據(jù)庫(kù)
2.合適的選擇blastn、blastp、blsatx等工具
3.運(yùn)行工具并在需要的時(shí)候格式化輸出結(jié)果

Build a blast database

#建立database目錄
mkdir -p ~/refs/ebola
#獲取ebola病毒核酸序列
efetch -db nucleotide -id KM233118 --format fasta > ~/refs/ebola/KM233118.fa

makeblastdb命令建立ebola核酸序列database
makeblastdb -help | more

USAGE
  makeblastdb [-h] [-help] [-in input_file] [-input_type type]
    -dbtype molecule_type [-title database_title] [-parse_seqids]
    [-hash_index] [-mask_data mask_data_files] [-mask_id mask_algo_ids]
    [-mask_desc mask_algo_descriptions] [-gi_mask]
    [-gi_mask_name gi_based_mask_names] [-out database_name]
    [-max_file_sz number_of_bytes] [-logfile File_Name] [-taxid TaxID]
    [-taxid_map TaxIDMapFile] [-version]
DESCRIPTION
   Application to create BLAST databases, version 2.7.1+
REQUIRED ARGUMENTS
 -dbtype <String, `nucl', `prot'>
   Molecule type of target db
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 options
 -in <File_In>
   Input file/database name
   Default = `-'
 -input_type <String, `asn1_bin', `asn1_txt', `blastdb', `fasta'>
   Type of the data specified in input_file
   Default = `fasta'
> *** Configuration options
 -title <String>
   Title for BLAST database
   Default = input file name provided to -in argument
 -parse_seqids
   Option to parse seqid for FASTA input if set, for all other input types
   seqids are parsed automatically
 -hash_index
   Create index of sequence hash values.
 *** Sequence masking options
 -mask_data <String>
   Comma-separated list of input files containing masking data as produced by
   NCBI masking applications (e.g. dustmasker, segmasker, windowmasker)
 -mask_id <String>
   Comma-separated list of strings to uniquely identify the masking algorithm
    * Requires:  mask_data
    * Incompatible with:  gi_mask
 -mask_desc <String>
   Comma-separated list of free form strings to describe the masking algorithm
   details
    * Requires:  mask_id
 -gi_mask
   Create GI indexed masking data.
    * Requires:  parse_seqids
    * Incompatible with:  mask_id
 -gi_mask_name <String>
   Comma-separated list of masking data output files.
    * Requires:  mask_data, gi_mask
 *** Output options
 -out <String>
   Name of BLAST database to be created
   Default = input file name provided to -in argumentRequired if multiple
   file(s)/database(s) are provided as input
 -max_file_sz <String>
   Maximum file size for BLAST database files
   Default = `1GB'
 -logfile <File_Out>
   File to which the program log should be redirected
 *** Taxonomy options
 -taxid <Integer, >=0>
   Taxonomy ID to assign to all sequences
    * Incompatible with:  taxid_map
 -taxid_map <File_In>
   Text file mapping sequence IDs to taxonomy IDs.
   Format:<SequenceId> <TaxonomyId><newline>
    * Requires:  parse_seqids
    * Incompatible with:  taxid
#創(chuàng)建ebola核酸序列數(shù)據(jù)庫(kù)
makeblastdb -in ~/refs/ebola/KM233118.fa -dbtype nucl -out ~/refs/ebola/KM233118

創(chuàng)建PRJNA257197氨基酸序列數(shù)據(jù)庫(kù)

#下載PRJNA257197所有蛋白質(zhì)序列fasta文件
esearch -db protein -query PRJNA257197 | efetch -format fasta > index/all-proteins.fa
#創(chuàng)建氨基酸序列數(shù)據(jù)庫(kù)
makeblastdb -in index/all-proteins.fa -dbtype prot -out index/all -parse_seqids
#列出數(shù)據(jù)庫(kù)內(nèi)的內(nèi)容,以“%a”accession格式顯示
blastdbcmd -db index/all -entry 'all' -outfmt "%a" | head

BLAST database的下載

NCBI提供許多物種和幾乎所有的已知序列的數(shù)據(jù)庫(kù)的下載
website

#創(chuàng)建目錄用于存放下載的數(shù)據(jù)庫(kù)
mkdir -p ~refs/refseq
cd ~/ref/refseq
#blast軟件包中已有update_blastdb.pl用于下載NCBI已經(jīng)做好的數(shù)據(jù)庫(kù)
#查看所有數(shù)據(jù)庫(kù)
update_blastdb.pl | more
#下載16 microbial database
update_blastdb.pl 16SMicrobial --decompress
#下載分類(lèi)數(shù)據(jù)庫(kù)
update_blastdb.pl taxdb --decompress
#將數(shù)據(jù)路徑加入系統(tǒng)環(huán)境變量,這也是分類(lèi)檢索所必須的(for MAC)
echo "export BLASTDB=$BLASTDB:~/refs/refseq/" >> ~/.bahs_profile
source ~/.bash_profile
(未完待續(xù))
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 有了黑夜的幽靜有了風(fēng)的微涼有了舊書(shū)的滄桑有了煙的灰燼有了詩(shī)意有了回憶也有了別離 沒(méi)了白晝的喧囂沒(méi)了雨的暖意沒(méi)了古道...
    嚴(yán)厚德閱讀 219評(píng)論 0 1
  • 安妮過(guò)完年回成都,我就說(shuō)請(qǐng)她吃晚飯。 問(wèn)她想吃什么,回答是不知道。但明確指出,不吃串串,因?yàn)槲覀儌z經(jīng)常去六年二班吃...
    土川兄一終身建設(shè)閱讀 1,550評(píng)論 0 0
  • 上單位通勤車(chē),一眼就看到L姐。她戴了頂毛線編織的帽子,嫻靜優(yōu)雅地坐在座位上。 “帽子真漂亮,自己織的?” “買(mǎi)的,...
    鉛筆芒種閱讀 663評(píng)論 0 2

友情鏈接更多精彩內(nèi)容