align(query, target; ...)

Align the query and target strings, returning the edit distance, start and end locations of opimal alignments, and the character alignment of the first one. Inputs are as for edit_distance.

alignment(query, target; opts...)

The edit distance, and the range, character alignments and cigar of an optimal alignment. Inputs are as for edit_distance.

cigar(a::Vector{Alignment}; extended=true)
cigar(query, target; extended=false, ...)

The cigar string of the given Vector{Alignment} (e.g. as returned from align or alignment).

It consists of pairs of multiplicities followed by a character I (inerstion), D (deletion), =/X (match/mismatch, extended only), M (match/mismatch).

The second form computes the cigar string for the alignment of query and target. The inputs are as for edit_distance.

edit_distance(query, target; max_distance=missing, mode=:global, equalities=nothing)

The edit distance between query and target strings, or vectors of bytes.

The available options are:

  • max_distance: The maximum edit distance to compute. If the actual edit distance is larger, it is reported as missing.
  • mode: One of :global (standard edit distance, the default), :prefix (gaps after the query don't count), :infix (gaps before and after the query don't count).
  • equalities: A vector of 2-tuples of characters which are considered equal. If you are calling this function many times, this should be a Vector{Tuple{UInt8,UInt8}} to avoid conversion.

If max_distance is given and the actual edit distance is larger, missing is returned.