從InterPro網(wǎng)站(https://www.ebi.ac.uk/interpro/download/Pfam/)下載多序列比對(duì)文件Pfam-A.seed.gz(含多個(gè)多序列比對(duì))
?wget?https://ftp.ebi.ac.uk/pub/databases/Pfam/current_release/Pfam-A.seed.gz
解壓,取第一個(gè)多多序列比對(duì)文件
cat Pfam-A.seed | while read line; do if [[ ${line} != "http://" ]]; then echo ${line}; else; echo ${line}; break; fi; done > Pfam-A-1.seed
InterPro 通過(guò)將蛋白質(zhì)分類為家族并預(yù)測(cè)結(jié)構(gòu)域和重要位點(diǎn),對(duì)蛋白質(zhì)進(jìn)行功能分析。為了以這種方式對(duì)蛋白質(zhì)進(jìn)行分類,InterPro 使用了由組成 InterPro 聯(lián)盟的幾個(gè)不同數(shù)據(jù)庫(kù)(稱為成員數(shù)據(jù)庫(kù))提供的預(yù)測(cè)模型(稱為特征)。我們將這些成員數(shù)據(jù)庫(kù)中的蛋白質(zhì)特征整合到一個(gè)單一的可搜索資源中,利用它們各自的優(yōu)勢(shì)來(lái)生成一個(gè)強(qiáng)大的集成數(shù)據(jù)庫(kù)和診斷工具。文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-650433.html
from Bio import AlignIO
align_file = "/path_to_file/Pfam-A-1.seed"
### 1. 讀取序列比對(duì)文件
## read方法用于讀取給定文件中可用的單個(gè)比對(duì)數(shù)據(jù)。
# 文件格式為 Stockholm
align = AlignIO.read(open(align_file), "stockholm")
# 常見(jiàn)的多序列比對(duì)格式還有 "clustal" "phylip"等
print("Alignment length %i" % align.get_alignment_length())
for record in align:
? ? print(record.seq + " " + record.id)
## parse方法返回可迭代的對(duì)齊對(duì)象,可以對(duì)其進(jìn)行迭代以獲得實(shí)際的對(duì)齊方式
alignments = AlignIO.parse(open(align_file), "stockholm")?
print(alignments)?
for alignment in alignments:?
? ? print(alignment)
### 2. 雙序列比對(duì)
from Bio import pairwise2
from Bio.Seq import Seq?
seq1 = Seq("ACCGGT")?
seq2 = Seq("ACGT")
alignments = pairwise2.align.globalxx(seq1, seq2)
print(alignments)
for alignment in alignments:?
? ? print(alignment)
## 格式化輸出
from Bio.pairwise2 import format_alignment?
alignments = pairwise2.align.globalxx(seq1, seq2)?
for alignment in alignments:?
? ? print(format_alignment(*alignment))?
### 3. Biopython通過(guò)Bio.Align.Applications模塊為許多序列比對(duì)工具提供接口。
from Bio.Align.Applications import ClustalwCommandline
參考
https://www.yiibai.com/biopython/biopython_sequence_alignments.html
https://biopython.org/wiki/AlignIO文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-650433.html
到了這里,關(guān)于Biopython序列比對(duì)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!