/* Convert base codes into their complements. * These are standard IUPAC-IUB single-letter base codes. */ /* Copyright (c) 2004 Blossom Associates West */ /* All rights reserved. */ #include int main( int argc, char* argv[] ) { int c; int p = 0; while ( EOF != ( c = getchar() ) ) { if ( 'c' == c ) c = 'g'; else if ( 'g' == c ) c = 'c'; else if ( 'a' == c ) c = 't'; else if ( 't' == c ) c = 'a'; else if ( 'u' == c ) c = 'a'; else if ( 'C' == c ) c = 'G'; else if ( 'G' == c ) c = 'C'; else if ( 'A' == c ) c = 'T'; else if ( 'T' == c ) c = 'A'; else if ( 'U' == c ) c = 'A'; else if ( 'm' == c ) c = 'k'; else if ( 'r' == c ) c = 'y'; /* else if ( 'w' == c ) c = 'w'; */ /* else if ( 's' == c ) c = 's'; */ else if ( 'y' == c ) c = 'r'; else if ( 'k' == c ) c = 'm'; else if ( 'v' == c ) c = 'b'; else if ( 'h' == c ) c = 'd'; else if ( 'd' == c ) c = 'h'; else if ( 'b' == c ) c = 'v'; /* else if ( 'x' == c ) c = 'x'; */ else if ( 'n' == c ) c = 'x'; else if ( 'M' == c ) c = 'K'; else if ( 'R' == c ) c = 'Y'; /* else if ( 'W' == c ) c = 'W'; */ /* else if ( 'S' == c ) c = 'S'; */ else if ( 'Y' == c ) c = 'R'; else if ( 'K' == c ) c = 'M'; else if ( 'V' == c ) c = 'B'; else if ( 'H' == c ) c = 'D'; else if ( 'D' == c ) c = 'H'; else if ( 'B' == c ) c = 'V'; /* else if ( 'X' == c ) c = 'X'; */ else if ( 'N' == c ) c = 'X'; /* else if ( '.' == c ) c = '.'; */ putchar( c ); } }