### How are IUPAC ambiguity codes handled?

openPrimeR fully supports all IUPAC nucleotide ambiguity codes (see Table 1). Ambiguities are considered in both, sequencing templates and primers. This is done by considering all possible variants arising from the ambiguous nucleotides present in a sequence.

For example, given the primer

AAGGTGTCCAGTGTGARGTGCAG

containing the ambiguous code R (A or G), openPrimeR determines its coverage by analyzing the coverage of both,

AAGGTGTCCAGTGTGAAGTGCAG
and
AAGGTGTCCAGTGTGAGGTGCAG.

Template sequences containing ambiguities are expanded in the same way and each resulting variant is considered as a possible primer template. Note that a sequence with n ambiguities can represent n4 possible sequences in the worst-case, which is why many ambiguities increase the computational demands.

Table 1: IUPAC ambiguity codes
IUPAC Code | Nucleotide
--- | ---
A | A
C | C
G | G
T | T
M | A or C
R | A or G
W | A or T
S | C or G
Y | C or T
K | G or T
V | A or C or G
H | A or C or T
D | A or G or T
B | C or G or T
N | A or C or G or T