-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest1.m
30 lines (25 loc) · 1.05 KB
/
test1.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
%--------------- test1----------
% Runs example for UPGMA and NJ
clc
clear all
data = {'Anolis' 'ATGACAATTACACGCAAATCCCACCCAATTTTCAAAATTATTAACGACTCCTTTATTGAT';
'Basili' 'ATGACAATCCTACGAAAATCCCACCCAATCCTTAAAATAATCAACTCTTCATTCATCGAC';
'Chalar' 'ATGACAATCATCCGAAAAACACACCCAATTTTCAAAATTGTAAACGACTCATTCATTGAC';
'Gambel' 'ATGACAATCACACGAAAATCCCACCCGATCATCAAAATCGTAAACAACTCATTTATTGAC';
'Leioce' 'ATGACAATCACACGAAAAACTCACCCACTATTTAAAATCATCAATAACTCCTTTATTGAC';
};
for ind = 1:length(data)
f(ind).Header = data{ind,1};
f(ind).Sequence = data{ind,2};
end
% UPGMA
distances = seqpdist(f,'Method','Jukes-Cantor','Alpha','DNA');
UPGMAtree = seqlinkage(distances,'UPGMA',f);
h = plot(UPGMAtree, 'orient', 'top');
title('UPGMA Distance Tree of Iguanas using Jukes-Cantor model');
ylabel('Evolutionary distance')
% NJ
NJtree = seqneighjoin(distances,'equivar',f);
h = plot(NJtree, 'orient', 'top');
title('Neighbor-Joining Distance Tree of Iguanas using Jukes-Cantor model');
ylabel('Evolutionary distance')