Algorithms for the analysis of molecular sequences