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ù)庫名字