ad3a176457ad1d21a0fedc47f349ec3484e751f1
angie
  Fri Feb 9 16:27:51 2018 -0800
Cleaning up some old ugliness about the size parameter to isAllDna and isAllNt.
hgc's printSnpAlignment code that parsed snpNNN.fa was using lineSize as length
but lineSize is length+1.  Then isAllDna was written with "i<size-1" as the
loop test instead of "i < size".  I didn't fix that properly when I separated
out isAllNt from isAllDna.
Later, I (re?)discovered that isAllNt needed length+1 as its size and just
added some FIXME comments.  Thanks Brian R for prodding me to actually fix it.
refs #20895

diff --git src/inc/iupac.h src/inc/iupac.h
index 2ff3318..0d94f8f 100644
--- src/inc/iupac.h
+++ src/inc/iupac.h
@@ -26,17 +26,38 @@
 /* Return IUPAC complement for a single base */
 
 void iupacComplementLower(char *iupac, int iuSize);
 /* Return IUPAC complement many bases. Assumes iupac is lower case. */
 
 void iupacReverseComplement(char *iu, int iuSize);
 /* Reverse complement a string containing DNA and IUPAC codes. Result will be always
  * lower case. */
 
 boolean iupacMatchStart(char *iupacPrefix, char *dnaString);
 /* Return TRUE if start of DNA is compatible with iupac */
 
 char *iupacIn(char *needle, char *haystack);
 /* Return first place in haystack (DNA) that matches needle that may contain IUPAC codes. */
 
+INLINE boolean isIupacAmbiguous(char c)
+/* Return TRUE if c is an IUPAC ambiguity code. */
+{
+switch (tolower(c))
+    {
+    case 'r':
+    case 'y':
+    case 's':
+    case 'w':
+    case 'k':
+    case 'm':
+    case 'b':
+    case 'd':
+    case 'h':
+    case 'v':
+    case 'n':
+        return TRUE;
+    }
+return FALSE;
+}
+
 #endif /* IUPAC_H */