使用blast建立數(shù)據(jù)庫并提取相關(guān)序列

1. 安裝blast
conda install -c bioconda blast

2. BLAST數(shù)據(jù)庫的構(gòu)建

#蛋白質(zhì)數(shù)據(jù)庫:
makeblastdb -in name.pep.fasta  -parse_seqids -hash_index  -out name.db -dbtype prot  #-out 指定數(shù)據(jù)庫位置和名字
#核酸數(shù)據(jù)庫:
makeblastdb -in name.cds.fasta  -parse_seqids -hash_index  -out name.db -dbtype nucl    
#一般帶上-parse_seqids -hash_index 

3. 運(yùn)行blast

blastp -query yourfasta.fa -db name.db -out blast_out
#-out后面為輸出的文件名??梢灾付ㄝ敵龈袷剑缭诿詈蠹由?-outfmt ' 6 qseqid sseqid pident length mismatch gapopen qstart qend sstart send qseq sseq evalue bitscore'  就是以blast6格式輸出引號(hào)中的字段,這些字段都是可選的,如果只想獲得blast的序列ID,則只加上-outfmt ' 6 sseqid' 

從上一步中獲得的blast結(jié)果的list,blast結(jié)果文件中只能提取比對上的相同字段,不能提取blast數(shù)據(jù)庫中對應(yīng)的整個(gè)蛋白序列,需要使用ID list來提取對應(yīng)的序列,可以使用seqkit來進(jìn)行提取

seqkit grep -f ID.list name.db > blast.pep
# -f 有ID列表的文件,name.db為你的數(shù)據(jù)庫名字
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

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

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