Helper function to convert a character vector to an integer vector of positions in substitution matrix.

seq_to_idx(x, mtx)

Arguments

x

Sequence as a character vector.

mtx

Substitution matrix as a numeric matrix.

Value

A integer vector converting input sequence to 0-based index in col/row names of mtx.