Before starting, why phylogenetic inference?#

(If you are only interested on the ‘how’, you can directly go to the summary section).

Phylogenetic inference allows the exploration of evolutionary relationships among taxa beyond a pure pair-wise comparison of their differences.
Evolutionary relationships are normally inferred from observed intrinsic properties of a group of organisms such as DNA sequences, protein sequences or morphological traits.
The first molecular phylogenetic analysis was performed by Carl Woese and George Fox (Woese and Fox, 1977). They defined the primary domains of life through 16S rRNA characterization. They provided a simple matrix of pairwise comparisons among DNA sequences, yet opened the doors for a much more complex field of molecular evolution.
Nowadays, when reconstructing evolutionary patterns, we assume common ancestry and a dichotomic diversification of the studied organisms. And the best (or most accepted) way to represent such patterns is the so called phylogenetic tree.