This example shows how to estimate synonymous and nonsynonymous substitution rates between two nucleotide sequences that are not codon-aligned.
This example uses two nucleotide sequences representing the human HEXA gene (accession number NM_000520) and mouse HEXA gene (accession number AK080777).
If you have live internet connection, you can use the getgenbank
function to retrieve the sequence information from the NCBI data repository and load the data into MATLAB®.
humanHEXA = getgenbank('NM_000520');
mouseHEXA = getgenbank('AK080777');
For your convenience, MATLAB provides these two sequences in hexosaminidase.mat
. Note that data in public databases are frequently updated and curated, and the results in this example may slightly differ if you use the latest data. Load the sequences.
Extract the coding regions from the two nucleotide sequences.
Align the amino acid sequences encoded by the nucleotide sequences.
Use the seqinsertgaps
function to copy the gaps from the aligned amino acid sequences to their corresponding nucleotide sequences, thus codon-aligning them.
humanHEXA_aligned =
'atgacaagctccaggctttggttttcgctgctgctggcggcagcgttcgcaggacgggcgacggccctctggccctggcctcagaacttccaaacctccgaccagcgctacgtcctttacccgaacaactttcaattccagtacgatgtcagctcggccgcgcagcccggctgctcagtcctcgacgaggccttccagcgctatcgtgacctgcttttcggttccgggtcttggccccgtccttacctcacagggaaacggcatacactggagaagaatgtgttggttgtctctgtagtcacacctggatgtaaccagcttcctactttggagtcagtggagaattataccctgaccataaatgatgaccagtgtttactcctctctgagactgtctggggagctctccgaggtctggagacttttagccagcttgtttggaaatctgctgagggcacattctttatcaacaagactgagattgaggactttccccgctttcctcaccggggcttgctgttggatacatctcgccattacctgccactctctagcatcctggacactctggatgtcatggcgtacaataaattgaacgtgttccactggcatctggtagatgatccttccttcccatatgagagcttcacttttccagagctcatgagaaaggggtcctacaaccctgtcacccacatctacacagcacaggatgtgaaggaggtcattgaatacgcacggctccggggtatccgtgtgcttgcagagtttgacactcctggccacactttgtcctggggaccaggtatccctggattactgactccttgctactctgggtctgagccctctggcacctttggaccagtgaatcccagtctcaataatacctatgagttcatgagcacattcttcttagaagtcagctctgtcttcccagatttttatcttcatcttggaggagatgaggttgatttcacctgctggaagtccaacccagagatccaggactttatgaggaagaaaggcttcggtgaggacttcaagcagctggagtccttctacatccagacgctgctggacatcgtctcttcttatggcaagggctatgtggtgtggcaggaggtgtttgataataaagtaaagattcagccagacacaatcatacaggtgtggcgagaggatattccagtgaactatatgaaggagctggaactggtcaccaaggccggcttccgggcccttctctctgccccctggtacctgaaccgtatatcctatggccctgactggaaggatttctacatagtggaacccctggcatttgaaggtacccctgagcagaaggctctggtgattggtggagaggcttgtatgtggggagaatatgtggacaacacaaacctggtccccaggctctggcccagagcaggggctgttgccgaaaggctgtggagcaacaagttgacatctgacctgacatttgcctatgaacgtttgtcacacttccgctgtgaattgctgaggcgaggtgtccaggcccaacccctcaatgtaggcttctgtgagcaggagtttgaacagacctga'
mouseHEXA_aligned =
'atggccggctgcaggctctgggtttcgctgctgctggcggcggcgttggcttgcttggccacggcactgtggccgtggccccagtacatccaaacctaccaccggcgctacaccctgtaccccaacaacttccagttccggtaccatgtcagttcggccgcgcaggcgggctgcgtcgtcctcgacgaggcctttcgacgctaccgtaacctgctcttcggttccggctcttggccccgacccagcttctcaaataaacagcaaacgttggggaagaacattctggtggtctccgtcgtcacagctgaatgtaatgaatttcctaatttggagtcggtagaaaattacaccctaaccattaatgatgaccagtgtttactcgcctctgagactgtctggggcgctctccgaggtctggagactttcagtcagcttgtttggaaatcagctgagggcacgttctttatcaacaagacaaagattaaagactttcctcgattccctcaccggggcgtactgctggatacatctcgccattacctgccattgtctagcatcctggatacactggatgtcatggcatacaataaattcaacgtgttccactggcacttggtggacgactcttccttcccatatgagagcttcactttcccagagctcaccagaaaggggtccttcaaccctgtcactcacatctacacagcacaggatgtgaaggaggtcattgaatacgcaaggcttcggggtatccgtgtgctggcagaatttgacactcctggccacactttgtcctgggggccaggtgcccctgggttattaacaccttgctactctgggtctcatctctctggcacatttggaccggtgaaccccagtctcaacagcacctatgacttcatgagcacactcttcctggagatcagctcagtcttcccggacttttatctccacctgggaggggatgaagtcgacttcacctgctggaagtccaaccccaacatccaggccttcatgaagaaaaagggcttt---actgacttcaagcagctggagtccttctacatccagacgctgctggacatcgtctctgattatgacaagggctatgtggtgtggcaggaggtatttgataataaagtgaaggttcggccagatacaatcatacaggtgtggcgggaagaaatgccagtagagtacatgttggagatgcaagatatcaccagggctggcttccgggccctgctgtctgctccctggtacctgaaccgtgtaaagtatggccctgactggaaggacatgtacaaagtggagcccctggcgtttcatggtacgcctgaacagaaggctctggtcattggaggggaggcctgtatgtggggagagtatgtggacagcaccaacctggtccccagactctggcccagagcgggtgccgtcgctgagagactgtggagcagtaacctgacaactaatatagactttgcctttaaacgtttgtcgcatttccgttgtgagctggtgaggagaggaatccaggcccagcccatcagtgtaggctgctgtgagcaggagtttgagcagacttga'
Estimate the synonymous and nonsynonymous substitutions rates of the codon-aligned nucleotide sequences and also display the codons considered in the computations and their amino acid translations.
DNDS:
Codons considered in the computations:
ATGACAAGCTCCAGGCTTTGGTTTTCGCTGCTGCTGGCGGCAGCGTTCGCAGGACGGGCGACGGCCCTCTGGCCCTGGCCTCAGAACTTCCAAACCTCCGACCAGCGCTACGTCCTTTACCCGAACAACTTTCAATTCCAGTACGATGTCAGCTCGGCCGCGCAGCCCGGCTGCTCAGTCCTCGACGAGGCCTTCCAGCGCTATCGTGACCTGCTTTTCGGTTCCGGGTCTTGGCCCCGTCCTTACCTCACAGGGAAACGGCATACACTGGAGAAGAATGTGTTGGTTGTCTCTGTAGTCACACCTGGATGTAACCAGCTTCCTACTTTGGAGTCAGTGGAGAATTATACCCTGACCATAAATGATGACCAGTGTTTACTCCTCTCTGAGACTGTCTGGGGAGCTCTCCGAGGTCTGGAGACTTTTAGCCAGCTTGTTTGGAAATCTGCTGAGGGCACATTCTTTATCAACAAGACTGAGATTGAGGACTTTCCCCGCTTTCCTCACCGGGGCTTGCTGTTGGATACATCTCGCCATTACCTGCCACTCTCTAGCATCCTGGACACTCTGGATGTCATGGCGTACAATAAATTGAACGTGTTCCACTGGCATCTGGTAGATGATCCTTCCTTCCCATATGAGAGCTTCACTTTTCCAGAGCTCATGAGAAAGGGGTCCTACAACCCTGTCACCCACATCTACACAGCACAGGATGTGAAGGAGGTCATTGAATACGCACGGCTCCGGGGTATCCGTGTGCTTGCAGAGTTTGACACTCCTGGCCACACTTTGTCCTGGGGACCAGGTATCCCTGGATTACTGACTCCTTGCTACTCTGGGTCTGAGCCCTCTGGCACCTTTGGACCAGTGAATCCCAGTCTCAATAATACCTATGAGTTCATGAGCACATTCTTCTTAGAAGTCAGCTCTGTCTTCCCAGATTTTTATCTTCATCTTGGAGGAGATGAGGTTGATTTCACCTGCTGGAAGTCCAACCCAGAGATCCAGGACTTTATGAGGAAGAAAGGCTTCGAGGACTTCAAGCAGCTGGAGTCCTTCTACATCCAGACGCTGCTGGACATCGTCTCTTCTTATGGCAAGGGCTATGTGGTGTGGCAGGAGGTGTTTGATAATAAAGTAAAGATTCAGCCAGACACAATCATACAGGTGTGGCGAGAGGATATTCCAGTGAACTATATGAAGGAGCTGGAACTGGTCACCAAGGCCGGCTTCCGGGCCCTTCTCTCTGCCCCCTGGTACCTGAACCGTATATCCTATGGCCCTGACTGGAAGGATTTCTACATAGTGGAACCCCTGGCATTTGAAGGTACCCCTGAGCAGAAGGCTCTGGTGATTGGTGGAGAGGCTTGTATGTGGGGAGAATATGTGGACAACACAAACCTGGTCCCCAGGCTCTGGCCCAGAGCAGGGGCTGTTGCCGAAAGGCTGTGGAGCAACAAGTTGACATCTGACCTGACATTTGCCTATGAACGTTTGTCACACTTCCGCTGTGAATTGCTGAGGCGAGGTGTCCAGGCCCAACCCCTCAATGTAGGCTTCTGTGAGCAGGAGTTTGAACAGACC
ATGGCCGGCTGCAGGCTCTGGGTTTCGCTGCTGCTGGCGGCGGCGTTGGCTTGCTTGGCCACGGCACTGTGGCCGTGGCCCCAGTACATCCAAACCTACCACCGGCGCTACACCCTGTACCCCAACAACTTCCAGTTCCGGTACCATGTCAGTTCGGCCGCGCAGGCGGGCTGCGTCGTCCTCGACGAGGCCTTTCGACGCTACCGTAACCTGCTCTTCGGTTCCGGCTCTTGGCCCCGACCCAGCTTCTCAAATAAACAGCAAACGTTGGGGAAGAACATTCTGGTGGTCTCCGTCGTCACAGCTGAATGTAATGAATTTCCTAATTTGGAGTCGGTAGAAAATTACACCCTAACCATTAATGATGACCAGTGTTTACTCGCCTCTGAGACTGTCTGGGGCGCTCTCCGAGGTCTGGAGACTTTCAGTCAGCTTGTTTGGAAATCAGCTGAGGGCACGTTCTTTATCAACAAGACAAAGATTAAAGACTTTCCTCGATTCCCTCACCGGGGCGTACTGCTGGATACATCTCGCCATTACCTGCCATTGTCTAGCATCCTGGATACACTGGATGTCATGGCATACAATAAATTCAACGTGTTCCACTGGCACTTGGTGGACGACTCTTCCTTCCCATATGAGAGCTTCACTTTCCCAGAGCTCACCAGAAAGGGGTCCTTCAACCCTGTCACTCACATCTACACAGCACAGGATGTGAAGGAGGTCATTGAATACGCAAGGCTTCGGGGTATCCGTGTGCTGGCAGAATTTGACACTCCTGGCCACACTTTGTCCTGGGGGCCAGGTGCCCCTGGGTTATTAACACCTTGCTACTCTGGGTCTCATCTCTCTGGCACATTTGGACCGGTGAACCCCAGTCTCAACAGCACCTATGACTTCATGAGCACACTCTTCCTGGAGATCAGCTCAGTCTTCCCGGACTTTTATCTCCACCTGGGAGGGGATGAAGTCGACTTCACCTGCTGGAAGTCCAACCCCAACATCCAGGCCTTCATGAAGAAAAAGGGCTTTACTGACTTCAAGCAGCTGGAGTCCTTCTACATCCAGACGCTGCTGGACATCGTCTCTGATTATGACAAGGGCTATGTGGTGTGGCAGGAGGTATTTGATAATAAAGTGAAGGTTCGGCCAGATACAATCATACAGGTGTGGCGGGAAGAAATGCCAGTAGAGTACATGTTGGAGATGCAAGATATCACCAGGGCTGGCTTCCGGGCCCTGCTGTCTGCTCCCTGGTACCTGAACCGTGTAAAGTATGGCCCTGACTGGAAGGACATGTACAAAGTGGAGCCCCTGGCGTTTCATGGTACGCCTGAACAGAAGGCTCTGGTCATTGGAGGGGAGGCCTGTATGTGGGGAGAGTATGTGGACAGCACCAACCTGGTCCCCAGACTCTGGCCCAGAGCGGGTGCCGTCGCTGAGAGACTGTGGAGCAGTAACCTGACAACTAATATAGACTTTGCCTTTAAACGTTTGTCGCATTTCCGTTGTGAGCTGGTGAGGAGAGGAATCCAGGCCCAGCCCATCAGTGTAGGCTGCTGTGAGCAGGAGTTTGAGCAGACT
Translations:
M T S S R L W F S L L L A A A F A G R A T A L W P W P Q N F Q T S D Q R Y V L Y P N N F Q F Q Y D V S S A A Q P G C S V L D E A F Q R Y R D L L F G S G S W P R P Y L T G K R H T L E K N V L V V S V V T P G C N Q L P T L E S V E N Y T L T I N D D Q C L L L S E T V W G A L R G L E T F S Q L V W K S A E G T F F I N K T E I E D F P R F P H R G L L L D T S R H Y L P L S S I L D T L D V M A Y N K L N V F H W H L V D D P S F P Y E S F T F P E L M R K G S Y N P V T H I Y T A Q D V K E V I E Y A R L R G I R V L A E F D T P G H T L S W G P G I P G L L T P C Y S G S E P S G T F G P V N P S L N N T Y E F M S T F F L E V S S V F P D F Y L H L G G D E V D F T C W K S N P E I Q D F M R K K G F E D F K Q L E S F Y I Q T L L D I V S S Y G K G Y V V W Q E V F D N K V K I Q P D T I I Q V W R E D I P V N Y M K E L E L V T K A G F R A L L S A P W Y L N R I S Y G P D W K D F Y I V E P L A F E G T P E Q K A L V I G G E A C M W G E Y V D N T N L V P R L W P R A G A V A E R L W S N K L T S D L T F A Y E R L S H F R C E L L R R G V Q A Q P L N V G F C E Q E F E Q T
M A G C R L W V S L L L A A A L A C L A T A L W P W P Q Y I Q T Y H R R Y T L Y P N N F Q F R Y H V S S A A Q A G C V V L D E A F R R Y R N L L F G S G S W P R P S F S N K Q Q T L G K N I L V V S V V T A E C N E F P N L E S V E N Y T L T I N D D Q C L L A S E T V W G A L R G L E T F S Q L V W K S A E G T F F I N K T K I K D F P R F P H R G V L L D T S R H Y L P L S S I L D T L D V M A Y N K F N V F H W H L V D D S S F P Y E S F T F P E L T R K G S F N P V T H I Y T A Q D V K E V I E Y A R L R G I R V L A E F D T P G H T L S W G P G A P G L L T P C Y S G S H L S G T F G P V N P S L N S T Y D F M S T L F L E I S S V F P D F Y L H L G G D E V D F T C W K S N P N I Q A F M K K K G F T D F K Q L E S F Y I Q T L L D I V S D Y D K G Y V V W Q E V F D N K V K V R P D T I I Q V W R E E M P V E Y M L E M Q D I T R A G F R A L L S A P W Y L N R V K Y G P D W K D M Y K V E P L A F H G T P E Q K A L V I G G E A C M W G E Y V D S T N L V P R L W P R A G A V A E R L W S S N L T T N I D F A F K R L S H F R C E L V R R G I Q A Q P I S V G C C E Q E F E Q T