I have several organisms and I want to calculate for each one of these their codon composition implementing a pairwise distance matrix between these codon vectors to build a phylogenetic tree. Therefore, the matrix will have on the principal diagonal 0 values (since each organism will have a distance of zero from itself) and the other matrix members will represent the euclidean distance among one organism and another one. Thus we will have a square matrix. To assess to robustness of the various phylogenetic relationships I would bootstrap this matrix building the tree on these data. Is this a good strategy?

  • $\begingroup$ Are you looking to build a codon phylogeny? The method you specified is a distance method, which lacks bootstrapping. There are alternative methods $\endgroup$
    – M__
    Aug 11, 2020 at 13:23
  • $\begingroup$ Thank You!May You indicate to me some work to have a reference?I Would like to explore the theory before starting the work. $\endgroup$ Aug 11, 2020 at 16:39
  • $\begingroup$ Hi @Firingam I will respond in full over the weekend $\endgroup$
    – M__
    Aug 12, 2020 at 21:44
  • $\begingroup$ Thank you! Best regards! $\endgroup$ Aug 13, 2020 at 18:23

1 Answer 1


The method you are proposing is called a distance method, because you are constructing a distance matrix and then using a clustering algorithm to make a tree. The things to watch out for are:

  • Multiple substitutions, traditionally this is take care of using a Jukes-Cantor correction. You could argue this is less of a concern because this is a 64 substition matrix model rather than just 4 or 20 substition matrix for nucleotides or amino acids.
  • Use the neighbour-joining clustering algorithm. Do not use a standard hierarchical clustering algorithm such as UPGMA. I'm sure R must have the nj in something like R's ape, pretty sure scipy will have something like that
  • Code for bootstrap resampling. That is a method for measuring robustness

The codon model for phylogenetic trees has been implemented in MrBayes, I suspect it will be in phyloBayes. This method will be Bayesian and you should run this is parallel with your own solution.

Concerns Codon models are very prone to mutation saturation (which is complicated) so you must only use it for closely related sequences. If e.g. 3rd codon distances start exceeding 70% codon models go kaput, because it will select a different codon, which is a completely separate part of the matrix - completely by chance. So whilst mutation saturation in a nucleotide model (4 substitution matrix) would invalidate the tree in theory, they would be sufficient 'good' signal for key phylogenetic signals to be identified, this wouldn't happen for a codon model.

I recognise the 'concerns' might sound a bit confusing at present, but just to reiterate, codon models need sequence data that is really closely related. For this data they excel and give excellent bootstrap support.

  • $\begingroup$ Very good points. So a whole organism nucleotide content approach would be misleading? My idea was to analyse a set of parasites to get their nucleotide content (vector of 61 sense codons) and to apply the neighbour-joining algorithm. Maybe a k-mean approach would be better for my intentions ?(it, naturally would imply a different approach to analyse data not distance based of course) $\endgroup$ Aug 20, 2020 at 10:54
  • 2
    $\begingroup$ Hi @Firingam It doesn't matter what method you use, the same theory will apply. Codon-models are particularly bad however. So really it depends on the genetic distance between the genomes. If its 61 Drosophila melanogaster genomes ... codon models will work well. It is split between hemimetabolous and homometabolous insects its a total disaster. Alternative methods allow you to 'ditch' the saturated mutations which you can't do with codons (otherwise you have no codons). I'm away for a few days. $\endgroup$
    – M__
    Aug 20, 2020 at 11:43
  • $\begingroup$ When you will newly available maybe we can chat privately. Best regards! $\endgroup$ Aug 20, 2020 at 12:35
  • 1
    $\begingroup$ Hi, @Firingam, thanks for your enthusiasm but ... whilst your supervisor probably knows some stuff I've done, its ages since I've worked in insects. So I've no problem answering site questions but I'm a rusty on developments in entomology now.. Hope thats ok. $\endgroup$
    – M__
    Aug 26, 2020 at 18:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.