HUMANS Example of sequence comparison by genetic distance



The discovery of Neanderthal skeletons in various parts of Europe raised many questions about human origis, among them the issue of our relation with these species. Now many questions about human and primate origins have been answered by the study of the mitochondrial genome and in particular of the hypervariable regions. These regions presents high sequence variability among humans, therefore they are ideal for studying the relationships among individuals. There are two hypervariable regions called HVR-I and HVR-II.

Load data into MATLAB workspace

In this demostration we first consider the HVR-1 and HVR-2 extracted from Nenderthal bones. Two Neanderthals are considered. The associated sequences can be download from the Genbank database.

% hvr-1

% hvr-2

If you don’t have a live web connection you can load them directly into the MATLAB workspace.

% load genbanknean    % <== Uncomment this if no internet connection

The mtDNA sequences of the Neanderthal are compared with 206 mtDNA sequences of modern humans. The complete D-loop is considered for each modern humans. The sequences have been extracted from the Max Ingman database. The associated web page can be explored by the URL.


The data corresponding to both the D-loop are in the FASTA format and can be read using the MATLAB function fastaread.


[Note: the d_loop.fasta file can be found here]

Since the sequence of the Neanderthal are incomplete, the corresponding fragments of D-loop of modern human are extracted by local alignment. To this aim the HVR-1 and 2 of the first Neanderthal is considered.

nea.Header='First Neanderthal';


for i=1:n
      [sc,alignment,st]=swalign(human_dloop(i).Sequence,nea.Sequence,'Alphabet', 'NT');
      [m,offset]=size(alignment);                                             % calculate the offset
      startat(i,1)=st(1);                                                     % record the starting index
      endat(i,1)=min(startat(i,1)+offset-1,length(human_dloop(i).Sequence));       % record the ending index
      % the ending index is calculate as minimum between start + offset and length of the sequence because
      % the alignment can produce a lot of gaps


The final sequences of humans and Neanderthals are saved in the same structure.

for i=1:n


Genetic distances

The genetic distances between each pair of sequences are computed with the Jukes-Cantor correction. It is a very time consuming task, therefore we give also the precomputed matrix. You can load it directly in the workspace.

%distances = seqpdist(hvr_tot,'Method','Jukes-Cantor','Alphabet', 'NT', 'PairwiseAlignment', true);


load D

The distance matrix can be plotted. From the image it clearly appears that the zone corresponding to the higher values of distances (red) are those of distances between humans and Neanderthals.


We can calculate also the mean distance among any two H. sapiens and between Neanderthal and any modern human.


D_mix=[D(1:n,n+1); D(1:n,n+2)];
human_dist =


mixed_dist =


The situation can be visualized also through multidimensional scaling, a statistical visualization method that enables us to enbed the datapoints on a plane in a way that respects their pairwise distances.

[Y,eigvals] = cmdscale(D);
hold on
title('Relative Distances: 206 H.Sapiens and 2 H.Neanderthalensis');
hold off

From the plot it is evident that the Neanderthal sequences are very distant to the 206 Homo Sapiens distances. It means that Homo Neanderthalensis were a different species and are very different from modern humans.

Primate evolution

We study the relationship between primates, humans and Neanderthal through phylogenetic analysis. The Hypervariable region II of human, Neanderthal, chimpanzee, bonobo, gorilla, orangutan and gibbon are considered. The genetic distance are estimated as above with the Jukes-Cantor correction.

distances= seqpdist(hvr_primates,'Method','Jukes-Cantor','Alphabet', 'NT');
tree = seqlinkage(distances,'UPGMA',hvr_primates);

The phylogenetic tree is shown.

h1 = plot(tree,'orient','bottom');
ylabel('Genetic Distance')

From the tree it is evident that the Neanderthals are more closely related to modern humans than are any of the other primates.
With view you can further explore/edit the phylogenetic tree using an interactive tool.