Efficient pattern searching for genomes