1 /* Pairwise identity program.
5 * Reads in a gapped alignment sequences in a FASTA file format.
6 * Assume gaps are represented by '-' characters.
8 * For each pair calculates the sequence percentage identity, see comments
9 * for pairwise() for details.
11 * Output is in the format for OC to read in, i.e. the number of sequences,
12 * followed by the sequence ID's, followed by the pairwise comparisons.
14 * Thu Dec 5 14:38:43 GMT 2002 Jon
15 * Added checking for eqilength sequences
17 * Thu Jul 24 12:14:04 BST 2003 Jon
18 * Moved FASTA reading into read_fasta function
28 main (int argc, char **argv) {
34 /* Read in the FASTA file */
36 fh = xfopen(argv[1], "r");
40 seqs = read_fasta(fh);
44 output = do_pairwise(seqs);
46 for (i = 0; seqs[i] != NULL; i++)
50 for (i = 0; output[i] != NULL; i++) {
51 printf("%s\n", output[i]);