Rigorous pattern-recognition methods for DNA sequences