1 /*****************************************************************
2 * HMMER - Biological sequence analysis with profile HMMs
3 * Copyright (C) 1992-1999 Washington University School of Medicine
6 * This source code is distributed under the terms of the
7 * GNU General Public License. See the files COPYING and LICENSE
9 *****************************************************************/
13 * Reverse complement of a IUPAC character string
14 * RCS $Id: revcomp.c,v 1.1.1.1 2005/03/22 08:34:16 cmzmasek Exp $
29 revcomp(char *comp, char *seq)
37 if (comp == NULL) return NULL;
38 if (seq == NULL) return NULL;
42 bckp = seq + bases -1;
43 for (pos = 0; pos < bases; pos++)
47 for (idx = 0; c != iupac[idx].sym && idx < IUPACSYMNUM; idx++);
48 if (idx == IUPACSYMNUM)
50 Warn("Can't reverse complement an %c, pal. Using N.", c);
54 *fwdp = iupac[idx].symcomp;
55 if (islower((int) *bckp)) *fwdp = (char) sre_tolower((int) *fwdp);