www.gusucode.com > bioinfo 案例源码程序 matlab代码 > bioinfo/AlignMultipleSequencesExample.m

    %% Align multiple sequences
% This example shows how to align multiple protein sequences.

% Copyright 2015 The MathWorks, Inc.


%%
% Use the |fastaread| function to read p53samples.txt, a FASTA-formatted file
% included with Bioinformatics Toolbox(TM), which contains p53 protein
% sequences of seven species.
p53 = fastaread('p53samples.txt')

%%
% Compute the pairwise distances between each pair of sequences using
% the 'GONNET' scoring matrix.
dist = seqpdist(p53,'ScoringMatrix','GONNET');

%%
% Build a phylogenetic tree using an unweighted average distance (UPGMA)
% method. This tree will be used as a guiding tree in the next step of
% progressive alignment.

tree = seqlinkage(dist,'average',p53)

%%
% Perform progressive alignment using the PAM family scoring matrices.
ma = multialign(p53,tree,'ScoringMatrix',...
                {'pam150','pam200','pam250'})
showalignment(ma)