To run the code, please download all the files in a directory. Then run: [alignment vpath] = viterbiPathPair(fileName1, fileName2); in Matlab where fileName1 is the name of the file containing input 1 and fileName2 contains input 2. 'alignment' now contains the alignment of the two sequences in reverse order. A '1' refers to 'A', '2' to 'C', '3' to 'G' and a '4' to a 'T' and a '-1' refers to a deletion at that position. 'vpath' contains the viterbi path (i.e. the sequence of states) of the alignment in reverse order (from back to front).