  In this paper we consider the problem of segmenting $n$ aligned random
sequences of equal length $m$, into a finite number of independent blocks. We
propose to use a penalized maximum likelihood criterion to infer simultaneously
the number of points of independence as well as the position of each one of
these points. We show how to compute the estimator efficiently by means of a
dynamic programming algorithm with time complexity $O(m^2n)$. We also propose
another algorithm, called hierarchical algorithm, that provides an
approximation to the estimator when the sample size increases and runs in time
$O(mn)$. Our main theoretical result is the proof of almost sure consistency of
the estimator and the convergence of the hierarchical algorithm when the sample
size $n$ grows to infinity. We illustrate the convergence of these algorithms
through some simulation examples and we apply the method to a real protein
sequence alignment of Ebola Virus.
