Escherichia coli and Shigella O antigens can be inferred using the rfb-restriction fragment length polymorphism (RFLP) molecular test. We present herein a dynamic programming algorithm-based software to compare the rfb-RFLP patterns of clinical isolates with those in a database containing the 171 previously published patterns corresponding to all known E. coli/Shigella O antigens.Classical Escherichia coli/Shigella O serogrouping is expensive, labor-intensive, and susceptible to errors due to cross-reactivity between adsorbed O-antigen rabbit antisera, as reviewed in reference 2. Furthermore, corrupted expression of genes involved in O-antigen synthesis renders some strains nontypeable ("rough"). Importantly, classical serotyping does not detect new O antigens. These drawbacks are surmounted by the rfb-restriction fragment length polymorphism (RFLP) test (1, 2). Briefly, the rfb locus containing most of the genes involved in O-antigen synthesis is amplified by PCR and digested with MboII, and products are resolved by electrophoresis. A database with 171 rfb-RFLP patterns representing each known Shigella and E. coli O antigen has been published and used to type reference and clinical strains, including an isolate that had become rough in the lab, with 100% specificity and sensitivity (1, 2). We present herein a web-based software program to compare the rfb-RFLP patterns of clinical isolates with those of known E. coli and Shigella O antigens.For the purpose of this work, the concepts of similarity and alignment between two rfb-RFLP patterns were adopted from Needleman and Wunsch's dynamic programming algorithm (7), which detects insertions, deletions, and substitutions as changes in the strings that represent nucleic acid or protein sequences. By analogy, restriction patterns represented by ordered fragment sizes can be aligned and their similarity can be calculated as the sum of penalties for the edit operations that transform one pattern into the other. These edit operations are deletions (missing bands) and transformations (errors on fragment sizing). A scoring function assigns a penalty to each transformation, and a dynamic programming algorithm computes the best editing scores between two patterns, producing an editing matrix. For two patterns, a ϭ a 1 a 2 ⅐ ⅐ ⅐ a m and b ϭ b 1 b 2 ⅐ ⅐ ⅐ b n , where a i is the fragment size at position i of test pattern a and b j is the fragment size at position j of reference pattern b, the editing matrix has (m ϩ 1) ϫ (n ϩ 1) positions, where n is the number of fragments in pattern a and m is the number of fragments in pattern b. The matrix is initialized, filling the first column with each fragment of pattern a and the first row with each fragment of pattern b. The aim is to move across the matrix from the first column and first row to the last column and last row. At each position, it is possible to move only one step either in the diagonal to align two fragments and advance one position in both patterns or in the horizontal (or vertical) to acknowledge a missing fragmen...