/*------------------------------------------------------------- Copyright (C) 2000 Peter Clote. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for NON-COMMERCIAL purposes and without fee is hereby granted provided that this copyright notice appears in all copies. THE AUTHOR AND PUBLISHER MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THE AUTHORS AND PUBLISHER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -------------------------------------------------------------*/ /************************************************* dotter0.c P. Clote Outputs a text file of coordinates of the form n-i j+1 for each i,j such that a[i] = b[j], when given 2 sequences a[0],...,a[n-1] and b[0],...,b[m-1]. The idea is that in producing a dot plot for the sequences, sequence a appears down the left side and sequence b at the top, with a dot at each position where the character in a matches the character in b. Suppose the output is saved in a file "out". Then use gnuplot with command plot "out" with points produces a screen image of the dot plot of the two sequences. *************************************************/ #include #include #include #define N 1000 #define M 1000 // N,M upper bounds on length of sequences a,b resp. main(int argc, char *argv[]) { char *a, *b; int n,m,i,j; char s[N][M]; if ( argc != 3 ) error("Usage: %s string1 string 2.\n"); a = argv[1]; b = argv[2]; n = strlen(a); m = strlen(b); for (i=0;i out Here the 2 sequences are actually tRNA's from M. jannaschii. ---------------------------------------------------------------*/