function alignment = calculate_distance(alignment)
%---------------------------DESCRIPTION-----------------------------------%
%This method calculates distances between sequences, which basically mean,
%that it compares number of matches between both aligned sequences to
%number of characters in alignment
%-------------------------------------------------------------------------%

%Initialize local variables
align_length = length(alignment.temporary_pair_align);

seq01 = alignment.temporary_pair_align(1,:);
seq02 = alignment.temporary_pair_align(2,:);

%Calculate number of differences
match_cnt = seq01==seq02;

%Calculate distance between sequences
match_cnt = sum(match_cnt);

distance = match_cnt / align_length;

%Passing value of local variable to global object property
alignment.distance = distance;