Algorithms for next -generation sequencing