/*------------------------------------------------------------- Copyright (C) 2000 Peter Clote, Sebastian Will. All Rights Reserved. written by Peter Clote modified by Sebastian Will 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. -------------------------------------------------------------*/ /************************************************* dotter.c Outputs a dot plot for 2 sequences. This is the original approach made by biologists towards identifying local and global alignments between 2 sequences. *************************************************/ #define MARK_DIAGONALS /* mark diagonals by DOT2 */ /* try define TAB 3 with MARK_DIAGONALS, without MARK_DIAGONALS TAB=2 may be more suitable*/ #include #include #include #define SPACE ' ' #define DOT '*' #define DOT2 '+' #define N 1000 #define M 1000 /* N,M upper bounds on length of sequences a,b resp. */ #define TAB 3 /* Function prototypes */ void error ( char *s ); void error ( char *s ) { fprintf(stderr,"%s\n",s); exit(1); } void display ( char *a, char *b, char s[N][M]){ int i,j,k,n,m; n=strlen(a); m=strlen(b); /****************** print letters of string b ***********/ printf("%c",SPACE); for (j=0;j