BLAST: basic local alignment search tool。包括:blastn, blastp, blastx, tblastn, tblastx
BLAST 基本步驟
- 準(zhǔn)備數(shù)據(jù)庫(kù):makeblastdb
- 選擇blast工具:包括blastn, blastp等
- 運(yùn)行得到結(jié)果,對(duì)輸出進(jìn)行修飾
Blast工具類型:

Blast 術(shù)語(yǔ) terminology
- Query: 檢索的序列
- Target:需要比對(duì)的數(shù)據(jù)集合,數(shù)據(jù)庫(kù)。
- Subject:how we refer to an entry that matches.
- Score:比對(duì)的得分
- E-value:期望值閾值。1.E值適合與有一定長(zhǎng)度,且復(fù)雜度不能太低的序列。2. 當(dāng)E值小于10-5時(shí),表明序列有較高的同源性,而非因計(jì)算錯(cuò)誤。3.當(dāng)e值小于10-6表明兩序列的同源性非常高,幾乎沒有必要再做確認(rèn)。
建庫(kù)
以水稻cds數(shù)據(jù)為例,搜索擬南芥REV的同源基因
### 下載水稻cds和pep數(shù)據(jù)
wget ftp://ftp.ensemblgenomes.org/pub/plants/release-39/fasta/oryza_sativa/cds/Oryza_sativa.IRGSP-1.0.cds.all.fa.gz
ftp://ftp.ensemblgenomes.org/pub/plants/release-39/fasta/oryza_sativa/pep/Oryza_sativa.IRGSP-1.0.pep.all.fa.gz
gunzip *.gz
### 建庫(kù)
makeblastdb -in Oryza_sativa.IRGSP-1.0.cds.all.fa -dbtype nucl -out oriza.cds.fa
makeblastdb -in Oryza_sativa.IRGSP-1.0.pep.all.fa -dbtype prot -out oriza.pep.fa
### bio_handbook示例
esearch -db protein -query PRJNA257197|efetch -format=fasta >index/all-protein.fa
makeblastdb -in all-protein.fa -dbtype nucl -parse_seqids
blastdbcmd -db all-protein.fa -entry 'all' -outfmt '%a' |les
檢索比對(duì)
BLAST 常用命令:
-
task命令: 指不同的檢索算法,目的為適應(yīng)某些特殊的序列(短序列等)其中blastn包括以下task:
-
blastn:更為寬松的檢索,find more divergent sequences -
megablast:較為嚴(yán)格的檢索,此為blastn的默認(rèn)檢索算法,find less divergent sequences -
blastn-short:對(duì)短序列進(jìn)行的檢索
-
-
db:數(shù)據(jù)庫(kù)位置 -
query:檢索的文件 -
out:輸出的文件 -
evalue:期望值閾值1e-5 -
perc_identity:根據(jù)相似度對(duì)輸出結(jié)果過濾 -
remote:遠(yuǎn)程N(yùn)CBI的數(shù)據(jù)庫(kù) ,需-db nr -
query_loc:檢索的位置 -
outfmt:輸出的數(shù)據(jù)格式,常用的為6,7- qaccver: 檢索序列的ac號(hào)
- saccver: 目標(biāo)序列的ac號(hào)
- pident:完全匹配百分比
- length:聯(lián)配的長(zhǎng)度
- mismatch:錯(cuò)配數(shù)目
- gapopen:gap的數(shù)目
- qstart:檢索序列的起始
- sstart:目標(biāo)序列起始
- send:目標(biāo)序列起始
- evalue:期望值
- bitscore:BIT得分
- score:原始得分
### 檢索
blastn -db oriza.cds.fa -query ath_REV.fa -outfmt 7 ###無檢索結(jié)果
blastn -task blastn -db oriza.cds.fa -query ath_REV.fa -outfmt 7 ###較為寬松,結(jié)果很多。
### 指定輸出格式 pident 為identity值
blastn -task blastn -db oriza.cds.fa -query ath_REV.fa -outfmt "6 qseqid sseqid pident"
## 書中按照identity值進(jìn)行排序
blastn -task blastn -db oriza.cds.fa -query ath_REV.fa -outfmt "6 qseqid sseqid pident" | sort -k3 -rn |head 5
- 對(duì)于低復(fù)雜度的序列(low complexity,重復(fù)序列較多),加上參數(shù)-dust no
- 序列聯(lián)配,兩兩比對(duì)加參數(shù)-subject
efectch -id NC_001133 -db nucleotide -format fasta > NC_001133.fa
blastn -query start.fa -subject NC_001133.fa
其它的一些BLAST-like的程序
- Diamond快速blast
- RAPSearch2:A memory-efficient implementation of RAPSearch algorithm for protein similarity search with a large database and a large queryset.
一些diamond命令
###建庫(kù)
diamond makedb --in nr.faa -d nr
##比對(duì)
diamond blastp -d nr -q reads.fa -o align.txt -f 6
快速是會(huì)以準(zhǔn)確性為代價(jià)的,尚不知道diamond的準(zhǔn)確度有多好?