Algorithms for infection and cancer genomics