**** * ***** *** * * ***** * * * * * * * * * * * * * * * * * * * * * * * * * * * *** * * * * * * * * * ***** * * Version 3.0 By Ramin Nakisa Usage ~~~~~ dotplot [sequence filename] [sequence filename] Option 1: -------- Start out with Window ñ 5 Stringency > 1 You get best results by keeping stringency=1 and varying the window size. Option 2: -------- Start out with Window ñ 5 Stringency > 6 ie. write a dot if 6 out of 10 residues in the window are identical. For big protein sequences ( >> 500 residues ) or DNA sequences use window=10 stringency=11. Hardware ~~~~~~~~ * VGA or EGA graphics adapter. * Maths coprocessor not required, but preferable! Oooooh, A New Program, I Want To Try It NOW! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For fast satisfaction, try using the following command which compares two neuronal nicotinic acetylcholine receptor subunit sequences from swissprot. dotplot a2 a3 Use option 1. Dotplot using score matrix. Use a window size of 10 and a threshold of 1. Once the dotplot is drawn you can either move the pointer around with the cursor keys or with the mouse, if you have one. Shift with a cursor key moves in steps of 10. As the pointer moves you can see the thirty amino acids surrounding the current pointer position for both sequences in a text box with | for an identity and : for a similarity. Click on the left mouse button to align, and the aligned region will go grey and will be written out into the alignmnt.txt file when the program terminates. PGUP and PGDN increase or decrease the threshold for extending a diagonal alignment. Try to find the internal repeats in a human epidermal growth factor receptor by typing dotplot egfr egfr Use option 1 with a window of 8 and a stringency of 1. The feature table gives FT REPEAT 75 300 APPROXIMATE. FT REPEAT 390 600 APPROXIMATE. What Does It DO? ~~~~~~~~~~~~~~~~ This is the main menu: 1. Sensitive Dotplot using score matrix. 2. Quick dotplot using identities. 3. 3d wire frame bonanza. 4. Dotplot from a file. 5. 3d wire frame bonanza from a file. 6. Create a comparison file. 7. Create an HPGL vector file. 8. Create a POSTSCRIPT file. Option 1 reads in the file in the current directory called pam.mat, described below, and uses it to score the hits for the dotplot. This can be made to pick out any similarity you like by editing the score matrix. For example, you could look for similarities in hydrophobicity and use this to find transmembrane regions in a new sequence by comparing with a closely related transmembrane protein. Option 2 is very fast. Although both options 1 and 2 are written in assembler for greater speed, identity is just a single assembler command, whereas looking up a value in the score matrix needs several commands and is therefore much slower. Anyway, use this if your machine is slow ( CPU <= 80286 ) or if you are feeling impatient and don't care about subtle similarities. Option 3 is an attempt to give a 3d dotplot. It's not very good yet, because I haven't got round to looking up the 3d transformation matrices to rotate and zoom the dotplot. When I do you will be able to fly through your dotplots on fast machines (and chug through them on slow machines). Options 4, 5 and 6 are intended for slow machines. The scores for the entire dotplot are written into a binary file with option 6, then loaded back in with 4 or 5. The 3d wire frame bonanza is slow, so this is speeded up a bit if you go via this route. Make sure you start dotplot with the same sequences that you used to create the score file, or things could get sticky! Options 7 and 8 make ASCII files which can be sent to an appropriate printer. If you have a laserjet or some sort of dot-matrix printer then you should get PRINTGL by Cary Ravitz, a shareware program which is on the EMBL server. This is great, because it can print an HPGL file on all these printers N-Epson 9 [+,*] 1-IBM Pro 9 [+] 5-IBM Pro 24 comp [+] C-CGA H-HGC T-Epson 24 [+,*] 2-IBM QW2 6-IBM Pro 24 [+] E-EGA M-EGA/mono L-HP LJ [-] 3-IBM QW3 9-NEC 24 [+,*] P-HP PJ 4-IBM LP [-] B-bit map [i,j] V-VGA [+[b],*[b]] It can also preview an HPGL file on many types of graphic adapter. You just create an HPGL file with option 7 and type printgl hpgl.dat /FV to preview on a VGA graphics adapter, and if you like what you see, then printgl hpgl.dat /FL /Dcom1 to print the HPGL file hpgl.dat on a laserjet connected to COM1. Nice one, Cary Ravitz! The POSTSCRIPT files can just be sent to a postscript printer, and the printer should recognize them as postscript. The laserjet III in our lab works fine with the files made by dotplot. I simply FTP the ASCII postscript files to our decstations and type lpr See your local boffin for the command that you must use to print a postscript file. Window Size and Stringency ~~~~~~~~~~~~~~~~~~~~~~~~~~ The program will prompt you for a window size and a stringency. For the simplest case, where the program puts a dot on the screen for every identity, the window size is one and the stringency is one. This will be very NOISY, as can be seen in this dotplot of two well-known sequences. C A P T A I N K I R K C * C A * * A P * P T * T A * * A I * * I N * N N * * N E E M M O O C A P T A I N K I R K The real homology we are looking for is CAPTAIN, but there are hits off this main `diagonal'. We get around this problem by using a window, where for each diagonal the number of hits must exceed a certain threshold (or stringency). Here is the dotplot above with a window size of 2 and a stringency of 2. C A P T A I N K I R K C * C A * A P * P T * T A * A I * I N * N N N E E M M O O C A P T A I N K I R K The noise is gone! The same applies to dotplots using a score matrix, that is, the noise decreases for increasing window size and stringency, but eventually the signal decreases too. Experiment. Raison D'ˆtre ~~~~~~~~~~~~~ This program fills a niche in the PC molecular biology freeware/shareware world. I decided to write it because dotplots are easily implemented on a PC, not being too CPU intensive (unless the sequences to be compared are large) and being fun to play around with if made interactive. The program owes a great deal to Dan Gilbert's amazingly good sequence reading/writing module UREADSEQ.C available from his equally amazing molecular biology server at Indiana. This module allows DOTPLOT to read the following formats: 1. IG/Stanford 8. Pearson/Fasta 2. GenBank/GB 9. Zuker 3. NBRF/PIR 10. Olsen 4. EMBL 11. Phylip3.4/Phylip 5. GCG 12. Phylip3.3/Interleaved 6. DNAStrider 13. Plain/Raw 7. Fitch The Section for Computer Bullies ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I found that the score matrix was best dimensioned to a 20x32 matrix instead of a 20x20 matrix. This meant that the indexing in machine code was much faster, because, as any assembler speed-freak will tell you, what really slows up an 8088 is a multiply. You can save many clock cycles by using mov cl,5 shl ax,cl rather than multiplying by 20 to calculate the offset of the score for a particular pair of amino acids. I have speeded the program up by translating the entire dotplot calculation and drawing function into assembler. This turned out to be worthwhile because it gave a decrease in execution time of about 25%. Major speed savings were made by removing as many commands from the double-nested drawing loop, because each assembler command accounted for a couple of percent execution time. The assembler created by the C compiler was surprisingly inefficient. I made the calculation of scores even faster by calculating scores diagonal-by-diagonal rather than point-by-point. I created a local variable in which the running score for each diagonal was stored and then for each point on the diagonal added the new score from just beyond the window and subtracted the score from just before the window. In C, this was as follows sum -= aa_sim( sequence1[i+k-window], sequence2[k], score_table ); sum += aa_sim( sequence1[i+k+window+1], sequence2[k+win2+1], score_table ); This was a much more efficient way of doing the window averaging. You can play around with the PAM matrix if you like. By default it looks like X=0 C 12 S 0 2 T -2 1 3 P -3 1 0 6 A -2 1 1 1 2 G -3 1 0 -1 1 5 N -4 1 0 -1 0 0 2 D -5 0 0 -1 0 1 2 4 E -5 0 0 -1 0 0 1 3 4 Q -5 -1 -1 0 0 -1 1 2 2 4 H -3 -1 -1 0 -1 -2 2 1 1 3 6 R -4 0 -1 0 -2 -3 0 -1 -1 1 2 6 K -5 0 0 -1 -1 -2 1 0 0 1 0 3 5 M -5 -2 -1 -2 -1 -3 -2 -3 -2 -1 -2 0 0 6 I -2 -1 0 -2 -1 -3 -2 -2 -2 -2 -2 -2 -2 2 5 L -6 -3 -2 -3 -2 -4 -3 -4 -3 -2 -2 -3 -3 4 2 6 V -2 -1 0 -1 0 -1 -2 -2 -2 -2 -2 -2 -2 2 4 2 4 F -4 -3 -3 -5 -4 -5 -4 -6 -5 -5 -2 -4 -5 0 1 2 -1 9 W 0 -3 -3 -5 -3 -5 -2 -4 -4 -4 0 -4 -4 -2 -1 -1 -2 7 10 Y -8 -2 -5 -6 -6 -7 -4 -7 -7 -5 -3 2 -3 -4 -5 -2 -6 0 0 17 C S T P A G N D E Q H R K M I L V F W Y This is just a score matrix. For example, if the pair of amino acids to be compared are leucine and arginine, the score matrix above gives a score of -3. An identity generally gives a large positive score (tyrosine-tyrosine gives a score of 17) with the largest scores for the rare amino acids. The matrix is not calculated according to physico-chemical properties of amino acids, it is statistically derived from comparison of many related proteins. Some people claim that the particular score matrix used makes a great deal of difference in the database searches and alignments, but don't take their word for it; you should play around with it yourself. If the score matrix makes that much difference then maybe your sequence similarity is just a figment of your crazed imagination... Anyway, you can edit the PAM.MAT file. Just bear these things in mind: * Don't interchange columns and rows. The letters are there for your convenience, so that editing the matrix is easy. The program always reads the matrix in the same way regardless of the letters. * Use integers, preferably in the same range as the above matrix ie. -8 to +17. * Don't forget to back up the original PAM.MAT, or you could get into a pickle! I've included a CHARGE.MAT and a DNA.MAT. To use these, just type copy dna.mat pam.mat to compare DNA sequences, or copy charge.mat pam.mat to compare charges. Put things back to the protein PAM250 matrix when you've finished with copy pam250.mat pam.mat Grovelling Credits Section ~~~~~~~~~~~~~~~~~~~~~~~~~~ I think Dan Gilbert is a marvellous man. UREADSEQ is FAB. In case you ever read this, Dan, next time you're in London drop in to Imperial and I'll buy you a pint of Old Rosie at the Phoenix and Firkin. * Copyright 1990 by d.g.gilbert * biology dept., indiana university, bloomington, in 47405 * e-mail: gilbertd@bio.indiana.edu * * This program may be freely copied and used by anyone. * Developers are encouraged to incorporate parts in their * programs, rather than devise their own private sequence * format. * * This should compile and run with any ANSI C compiler. * Please advise me of any bugs, additions or corrections. Thanks also for feedback on Dotplot 2.0 from * Finn Drablos in Norway, who suggested a change in the cursor. * Francis Durst in France, who pointed out the emulator bug and understood that programming is heavily influenced by a girlfriend's trips. Desperate Plea for Recognition ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If you enjoyed using dotplot, please DON'T SEND ME ANY MONEY! I don't want money. If I did I wouldn't have started a PhD. I want PRAISE! RECOGNITION! FAME! PRAISE (again)! Please send your flattering minutiae, ego boosters, gripes and suggested improvements by EMAIL to ramin@ic.ac.uk ................ for Internet people Alternatively, SNAILMAIL: Ramin Nakisa, Biophysics Section, The Blackett Laboratory, Imperial College of Science, Technology and Medicine, Prince Consort Road, London SW7 2BZ Great Britain. Tel: 071 589-5111 x 6729 FAX: 071 589-0191