Abstract: The current invention concerns a computer-implemented method, a computer system and a tangible non-transitory computer-readable data carrier comprising a computer program product for aligning a query nucleic acid sequence against a reference nucleic acid sequence. An optimal alignment score of the query sequence against the reference sequence is determined by a dynamic programming algorithm. The algorithm is configured for locally optimizing a partial alignment score based on a nucleotide substitution cost, a gap insertion cost, an amino acid substitution cost, as well as a frameshift penalty.