Clustal, Multiple alignment of nucleic acid and protein sequences. official website: http://www.clustal.org/
使用biopython, 有相应的接口可以直接调用clustalw.
from Bio.Align.Applications import ClustalwCommandline # the path of clustalw clustalw_exe = r'clustalw2.exe' # the command of clustalw clustalw_cline = ClustalwCommandline(clustalw_exe, infile=pairFile) # run the command stdout, stderr = clustalw_cline()
结果会直接生成aln文件,名字和infile名字一样,后缀为aln。
也可以直接使用biopython中的接口解析结果文件。
from Bio import AlignIO align = AlignIO.read("opuntia.aln", "clustal") print align