Computes a pairwise distance matrix based on the year embedded in sequence names. Supported methods are `"absolute"` (symmetric), `"forward"` (x - y), and `"backward"` (y - x).
Details
This function extracts years from the names of `seqs` using a regular expression, then computes pairwise temporal distances using the specified method.
Which distance is "backwards" or "forwards" is semantic and depends on the order of your strain names. They are both provided for convenience.
Examples
seqs <- c(
"A/H1N1/South Carolina/1/1918" = "mktiialsyifclvlgqdfpgndnstatlclgh",
"A/H3N2/Darwin/9/2021" = "mktiialsnilclvfaqkipgndnstat",
"B/Sichuan/379/1999" = "drictgitssnsphvvktatqgevnvtgai"
)