Bioinformatica 10-11-2011-t5-database searching


Published on

Published in: Education, Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Bioinformatica 10-11-2011-t5-database searching

  1. 2. FBW 10-11-2011 Wim Van Criekinge
  2. 3. Inhoud Lessen: Bioinformatica <ul><li>don 29-09-2011: 1* Bioinformatics (practicum 8.30-11.00) </li></ul><ul><li>don 06-10-2011: 2* Biological Databases (practicum 9.00-11.30) </li></ul><ul><li>don 20-10-2011: 3 Sequence Similarity (Scoring Matrices) </li></ul><ul><li>don 27-10-2011: 4 Sequence Alignments </li></ul><ul><li>don 10 -11-2011: 5 Database Searching Fasta/Blast </li></ul><ul><li>don 17-11-2011: 6 Phylogenetics </li></ul><ul><li>don 24-11-2011: 7 Protein Structure </li></ul><ul><li>don 01-12-2011: 8 Gene Prediction, Gene Ontologies & HMM </li></ul><ul><li>don 08-12-2011: 9 ncRNA, Chip Data Analysis, AI </li></ul><ul><li>don 15-12-2011: 10 Bio- & Cheminformatics in Drug Discovery (inhaalweek) </li></ul><ul><li>Opgelet: Geen les op don 13-10-2010 en don 3-11-2010 </li></ul>
  3. 4. DataBase Searching <ul><li>Dynamic Programming </li></ul><ul><li>Reloaded </li></ul><ul><li>Database Searching </li></ul><ul><li>Fasta </li></ul><ul><li>Blast </li></ul><ul><li>Statistics </li></ul><ul><li>Practical Guide </li></ul><ul><li>Extentions </li></ul><ul><li>PSI-Blast </li></ul><ul><li>PHI-Blast </li></ul><ul><li>Local Blast </li></ul><ul><li>BLAT </li></ul>
  4. 5. The Score Matrix ---------------- Seq1(j) 1 2 3 4 5 6 7 8 9 10 Seq2 * C K H V F C R V C I (i) * 0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 1 C -1 1 0 -1 -2 -3 -4 -5 -6 -7 -8 2 K -2 0 2 1 0 -1 -2 -3 -4 -5 -6 3 K -3 -1 1 1 0 -1 -2 -3 -4 -5 -6 4 C -4 -2 0 0 0 -1 0 -1 -2 -3 -4 5 F -5 -3 -1 -1 -1 1 0 -1 -2 -3 -4 6 C -6 -4 -2 -2 -2 0 2 1 0 -1 -2 7 K -7 -5 -3 -3 -3 -1 1 1 0 -1 -2 8 C -8 -6 -4 -4 -4 -2 0 0 0 1 0 9 V -9 -7 -5 -5 -3 -3 -1 -1 1 0 0 A: matrix(i,j) = matrix(i-1,j-1) + (MIS)MATCH if (substr(seq1, j-1 ,1) eq substr(seq2, i-1 ,1) B: up_score = matrix(i-1,j) + GAP C: left_score = matrix(i,j-1) + GAP a b c
  5. 6. <ul><li>The most practical and widely used method in multiple sequence alignment is the hierarchical extensions of pairwise alignment methods. </li></ul><ul><li>The principal is that multiple alignments is achieved by successive application of pairwise methods . </li></ul><ul><ul><li>First do all pairwise alignments (not just one sequence with all others) </li></ul></ul><ul><ul><li>Then combine pairwise alignments to generate overall alignment </li></ul></ul><ul><ul><li>Multiple Alignment Method </li></ul></ul>
  6. 7. <ul><li>Consider the task of searching SWISS­PROT against a query sequence: </li></ul><ul><ul><li>say our query sequence is 362 amino­ acids long </li></ul></ul><ul><ul><li>SWISS­PROT release 38 contains 29,085,265 amino acids </li></ul></ul><ul><ul><li>finding local alignments via dynamic programming would entail O(10 10 ) matrix operations </li></ul></ul><ul><li>Given size of databases, more efficient methods needed </li></ul><ul><ul><li>Database Searching </li></ul></ul>
  7. 8. FASTA (Pearson 1995) Uses heuristics to avoid calculating the full dynamic programming matrix Speed up searches by an order of magnitude compared to full Smith-Waterman The statistical side of FASTA is still stronger than BLAST <ul><li>BLAST (Altschul 1990, 1997) </li></ul><ul><li>Uses rapid word lookup methods to completely skip most of the database entries </li></ul><ul><li>Extremely fast </li></ul><ul><ul><li>One order of magnitude faster than FASTA </li></ul></ul><ul><ul><li>Two orders of magnitude faster than Smith-Waterman </li></ul></ul><ul><li>Almost as sensitive as FASTA </li></ul><ul><ul><li>Heuristic approaches to DP for database searching </li></ul></ul>
  8. 9. <ul><li>« Hit and extend heuristic» </li></ul><ul><li>Problem: Too many calculations “wasted” by comparing regions that have nothing in common </li></ul><ul><li>Initial insight: Regions that are similar between two sequences are likely to share short stretches that are identical </li></ul><ul><li>Basic method: Look for similar regions only near short stretches that match exactly </li></ul><ul><ul><li>FASTA </li></ul></ul>
  9. 10. FASTA-Stages <ul><li>Find k-tups in the two sequences (k=1,2 for proteins, 4-6 for DNA sequences) </li></ul><ul><li>Score and select top 10 scoring “local diagonals” </li></ul><ul><li>Rescan top 10 regions, score with PAM250 (proteins) or DNA scoring matrix. Trim off the ends of the regions to achieve highest scores. </li></ul><ul><li>Try to join regions with gapped alignments. Join if similarity score is one standard deviation above average expected score </li></ul><ul><li>After finding the best initial region, FASTA performs a global alignment of a 32 residue wide region centered on the best initial region, and uses the score as the optimized score. </li></ul>
  10. 13. <ul><li>Sensitivity: the ability of a program to identify weak but biologically significant sequence similarity. </li></ul><ul><li>Selectivity: the ability of a program to discriminate between true matches and matches occurring by chance alone. </li></ul><ul><ul><li>A decrease in selectivity results in more false positives being reported. </li></ul></ul><ul><ul><li>FastA </li></ul></ul>
  11. 14. FastA ( Blosum50 default. Lower PAM higher blosum to detect close sequences Higher PAM and lower blosum to detect distant sequences Gap opening penalty -12, -16 by default for fasta with proteins and DNA, respectively Gap extension penalty -2, -4 by default for fasta with proteins and DNA, respectively The larger the word-length the less sensitive, but faster the search will be Max number of scores and alignments is 100
  12. 15. FastA Output Database code hyperlinked to the SRS database at EBI Accession number Description Length Initn, init1, opt, z-score calculated during run E score - expectation value, how many hits are expected to be found by chance with such a score while comparing this query to this database. E() does not represent the % similarity
  13. 16. <ul><li>FastA, TFastA, FastX, FastY </li></ul>FastA is a family of programs Query: DNA Protein Database:DNA Protein
  14. 17. <ul><li>FASTA can miss significant similarity since </li></ul><ul><ul><li>For proteins, similar sequences do not have to share identical residues </li></ul></ul><ul><ul><ul><li>Asp-Lys-Val is quite similar to </li></ul></ul></ul><ul><ul><ul><li>Glu-Arg-Ile yet it is missed even with ktuple size of 1 since no amino acid matches </li></ul></ul></ul><ul><ul><ul><li>Gly-Asp-Gly-Lys-Gly is quite similar to Gly-Glu-Gly-Arg-Gly but there is no match with ktuple size of 2 </li></ul></ul></ul><ul><ul><li>FASTA problems </li></ul></ul>
  15. 18. <ul><li>FASTA can miss significant similarity since </li></ul><ul><ul><li>For nucleic acids, due to codon “wobble”, DNA sequences may look like XXyXXyXXy where X’s are conserved and y’s are not </li></ul></ul><ul><ul><ul><li>GGuUCuACgAAg and GGcUCcACaAAA both code for the same peptide sequence (Gly-Ser-Thr-Lys) but they don’t match with ktuple size of 3 or higher </li></ul></ul></ul><ul><ul><li>FASTA problems </li></ul></ul>
  16. 19. DataBase Searching <ul><li>Dynamic Programming </li></ul><ul><li>Reloaded </li></ul><ul><li>Database Searching </li></ul><ul><li>Fasta </li></ul><ul><li>Blast </li></ul><ul><li>Statistics </li></ul><ul><li>Practical Guide </li></ul><ul><li>Extentions </li></ul><ul><li>PSI-Blast </li></ul><ul><li>PHI-Blast Local Blast </li></ul><ul><li>Blast </li></ul>
  17. 20. BLAST - B asic L ocal A lignment S earch T ool
  18. 21. What does BLAST do? <ul><li>Search a large target set of sequences... </li></ul><ul><li>… for hits to a query sequence ... </li></ul><ul><li>… and return the alignments and scores from those hits... </li></ul><ul><li>Do it fast. </li></ul><ul><li>Show me those sequences that deserve a second look. Blast programs were designed for fast database searching, with minimal sacrifice of sensitivity to distant related sequences. </li></ul>
  19. 22. The big red button Do My Job It is dangerous to hide too much of the underlying complexity from the scientists.
  20. 23. <ul><li>Approach: find segment pairs by first finding word pairs that score above a threshold, i.e., find word pairs of fixed length w with a score of at least T </li></ul><ul><li>Key concept “Neigborhood”: Seems similar to FASTA, but we are searching for words which score above T rather than that match exactly </li></ul><ul><li>Calculate neigborhood (T) for substrings of query (size W) </li></ul><ul><ul><li>Overview </li></ul></ul>
  21. 24. <ul><li>Compile a list of words which give a score above T when paired with the query sequence. </li></ul><ul><ul><li>Example using PAM-120 for query sequence ACDE ( w =4, T =17): </li></ul></ul><ul><ul><li>A C D E </li></ul></ul><ul><ul><li>A C D E = +3 +9 +5 +5 = 22 </li></ul></ul><ul><ul><ul><li>try all possibilities: </li></ul></ul></ul><ul><ul><li>A A A A = +3 -3 0 0 = 0 no good </li></ul></ul><ul><ul><li>A A A C = +3 -3 0 -7 = -7 no good </li></ul></ul><ul><ul><ul><li>...too slow, try directed change </li></ul></ul></ul><ul><ul><li>Overview </li></ul></ul>
  22. 25. <ul><ul><li>A C D E </li></ul></ul><ul><ul><li>A C D E = +3 +9 +5 +5 = 22 </li></ul></ul><ul><ul><ul><li>change 1st pos. to all acceptable substitutions </li></ul></ul></ul><ul><ul><li>g C D E = +1 +9 +5 +5 = 20 ok </li></ul></ul><ul><ul><li>n C D E = +0 +9 +5 +5 = 19 ok </li></ul></ul><ul><ul><li>I C D E = -1 +9 +5 +5 = 18 ok </li></ul></ul><ul><ul><li>k C D E = -2 +9 +5 +5 = 17 ok </li></ul></ul><ul><ul><ul><li>change 2nd pos.: can't - all alternatives negative and the other three positions only add up to 13 </li></ul></ul></ul><ul><ul><ul><li>change 3rd pos. in combination with first position </li></ul></ul></ul><ul><ul><li>gCnE = 1 9 2 5 = 17 ok </li></ul></ul><ul><ul><ul><li>continue - use recursion </li></ul></ul></ul><ul><li>For &quot;best&quot; values of w and T there are typically about 50 words in the list for every residue in the query sequence </li></ul><ul><ul><li>Overview </li></ul></ul>
  23. 26. <ul><li># Calculate neighborhood </li></ul><ul><li>my %NH; </li></ul><ul><li>for (my $i = 0; $i < @A; $i++) { </li></ul><ul><li>my $s1 = $S{$W[0]}{$A[$i]}; </li></ul><ul><li>for (my $j = 0; $j < @A; $j++) { </li></ul><ul><li>my $s2 = $S{$W[1]}{$A[$j]}; </li></ul><ul><li>for (my $k = 0; $k < @A; $k++) { </li></ul><ul><li>my $s3 = $S{$W[2]}{$A[$k]}; </li></ul><ul><li>my $score = $s1 + $s2 + $s3; </li></ul><ul><li>my $word = &quot;$A[$i]$A[$j]$A[$k]&quot;; </li></ul><ul><li>next if $word =~ /[BZX*]/; </li></ul><ul><li>$NH{$word} = $score if $score >= $T; </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li># Output neighborhood </li></ul><ul><li>foreach my $word (sort {$NH{$b} <=> $NH{$a} or $a cmp $b} keys %NH) { </li></ul><ul><li>print &quot;$word $NH{$word}n&quot;; </li></ul><ul><li>} </li></ul>
  24. 27. <ul><li>BLOSUM62 RGD 11 </li></ul><ul><li>RGD 17 </li></ul><ul><li>KGD 14 </li></ul><ul><li>QGD 13 </li></ul><ul><li>RGE 13 </li></ul><ul><li>EGD 12 </li></ul><ul><li>HGD 12 </li></ul><ul><li>NGD 12 </li></ul><ul><li>RGN 12 </li></ul><ul><li>AGD 11 </li></ul><ul><li>MGD 11 </li></ul><ul><li>RAD 11 </li></ul><ul><li>RGQ 11 </li></ul><ul><li>RGS 11 </li></ul><ul><li>RND 11 </li></ul><ul><li>RSD 11 </li></ul><ul><li>SGD 11 </li></ul><ul><li>TGD 11 </li></ul>PAM200 RGD 13 RGD 18 RGE 17 RGN 16 KGD 15 RGQ 15 KGE 14 HGD 13 KGN 13 RAD 13 RGA 13 RGG 13 RGH 13 RGK 13 RGS 13 RGT 13 RSD 13 WGD 13
  25. 29. S Length of extension Score Trim to max indexed * *Two non-overlapping HSP’s on a diagonal within distance A
  26. 30. S Length of extension Score Trim to max indexed * *Two non-overlapping HSP’s on a diagonal within distance A
  27. 31. The BLAST algorithm <ul><li>Break the search sequence into words </li></ul><ul><ul><li>W = 3 for proteins, W = 12 for DNA </li></ul></ul><ul><li>Include in the search all words that score above a certain value (T) for any search word </li></ul>MCGPFILGTYC MCG CGP MCG CGP MCT MGP … MCN CTP … … This list can be computed in linear time MCG, CGP, GPF, PFI, FIL, ILG, LGT, GTY, TYC
  28. 32. The Blast Algorithm (2) <ul><li>Search for the words in the database </li></ul><ul><ul><li>Word locations can be precomputed and indexed </li></ul></ul><ul><ul><li>Searching for a short string in a long string </li></ul></ul><ul><li>HSP (High Scoring Pair) = A match between a query word and the database </li></ul><ul><li>Find a “hit”: Two non-overlapping HSP’s on a diagonal within distance A </li></ul><ul><li>Extend the hit until the score falls below a threshold value, S </li></ul>
  29. 34. BLAST parameters <ul><li>Lowering the neighborhood word threshold (T) allows more distantly related sequences to be found, at the expense of increased noise in the results set. </li></ul><ul><li>Choosing a value for w </li></ul><ul><ul><li>small w: many matches to expand </li></ul></ul><ul><ul><li>big w: many words to be generated </li></ul></ul><ul><ul><li>w=4 is a good compromise </li></ul></ul><ul><li>Lowering the segment extension cutoff (S) returns longer extensions for each hit. </li></ul><ul><li>Changing the minimum E -value changes the threshold for reporting a hit. </li></ul>
  30. 35. Critical parameters: T,W and scoring matrix <ul><li>The proper value of T depends ons both the values in the scoring matrix and balance between speed and sensitivity </li></ul><ul><li>Higher values of T progressively remove more word hits and reduce the search space. </li></ul><ul><li>Word size (W) of 1 will produce more hits than a word size of 10. In general, if T is scaled uniformly with W, smaller word sizes incraese sensitivity and decrease speed. </li></ul><ul><li>The interplay between W,T and the scoring matrix is criticial and choosing them wisely is the most effective way of controlling the speed and sensiviy of blast </li></ul>
  31. 36. DataBase Searching <ul><li>Dynamic Programming </li></ul><ul><li>Reloaded </li></ul><ul><li>Database Searching </li></ul><ul><li>Fasta </li></ul><ul><li>Blast </li></ul><ul><li>Statistics </li></ul><ul><li>Practical Guide </li></ul><ul><li>Extentions </li></ul><ul><li>PSI-Blast </li></ul><ul><li>PHI-Blast </li></ul><ul><li>Local Blast </li></ul><ul><li>BLAT </li></ul>
  32. 37. Database Searching <ul><li>How can we find a particular short sequence in a database of sequences (or one HUGE sequence)? </li></ul><ul><li>Problem is identical to local sequence alignment, but on a much larger scale. </li></ul><ul><li>We must also have some idea of the significance of a database hit. </li></ul><ul><ul><li>Databases always return some kind of hit, how much attention should be paid to the result? </li></ul></ul><ul><li>How can we determine how “unusual” a particular alignment score is? </li></ul>
  33. 38. <ul><li>Sentence 1: </li></ul><ul><li>“ These algorithms are trying to find the best way to match up two sequences” </li></ul><ul><li>Sentence 2: </li></ul><ul><li>“ This does not mean that they will find anything profound” </li></ul><ul><li>ALIGNMENT: </li></ul><ul><li>THESEALGRITHMARETR--YINGTFINDTHEBESTWAYTMATCHPTWSEQENCES </li></ul><ul><li>:: :.. . .. ...: : ::::.. :: . : ... </li></ul><ul><li>THISDESNTMEANTHATTHEYWILLFINDAN-------YTHIN-GPRFND------ </li></ul><ul><li>12 exact matches </li></ul><ul><li>14 conservative substitutions </li></ul><ul><li>Is this a good alignment? </li></ul><ul><ul><li>Significance </li></ul></ul>
  34. 39. <ul><li>A key to the utility of BLAST is the ability to calculate expected probabilities of occurrence of Maximum Segment Pairs (MSPs) given w and T </li></ul><ul><li>This allows BLAST to rank matching sequences in order of “significance” and to cut off listings at a user-specified probability </li></ul><ul><ul><li>Overview </li></ul></ul>
  35. 40. Mathematical Basis of BLAST <ul><li>Model matches as a sequence of coin tosses </li></ul><ul><li>Let p be the probability of a “head” </li></ul><ul><ul><li>For a “fair” coin, p = 0.5 </li></ul></ul><ul><li>(Erd ö s-R é nyi) If there are n throws, then the expected length R of the longest run of heads is </li></ul><ul><li>R = log 1/p (n). </li></ul><ul><li>Example: Suppose n = 20 for a “fair” coin </li></ul><ul><li>R=log 2 (20)=4.32 </li></ul><ul><li>Trick is how to model DNA (or amino acid) sequence alignments as coin tosses. </li></ul>
  36. 41. Mathematical Basis of BLAST <ul><li>To model random sequence alignments, replace a match with a “head” and mismatch with a “tail”. </li></ul><ul><li>For DNA, the probability of a “head” is 1/4 </li></ul><ul><ul><li>What is it for amino acid sequences? </li></ul></ul>AATCAT ATTCAG HTHHHT
  37. 42. Mathematical Basis of BLAST <ul><li>So, for one particular alignment, the Erd ö s-R é nyi property can be applied </li></ul><ul><li>What about for all possible alignments? </li></ul><ul><ul><li>Consider that sequences are being shifted back and forth, dot matrix plot </li></ul></ul><ul><li>The expected length of the longest match is </li></ul><ul><li>R=log 1/p (mn) </li></ul><ul><ul><li>where m and n are the lengths of the two sequences. </li></ul></ul>
  38. 43. Analytical derivation <ul><li>Erd ö s-R é nyi </li></ul><ul><li>… </li></ul><ul><li>… </li></ul><ul><li>… </li></ul><ul><li>Karlin-Alschul </li></ul>
  39. 44. Karlin-Alschul Statistics <ul><ul><li>E=kmn - λ S </li></ul></ul><ul><ul><li>This equation states that the number of alignments expected by chance (E) during the sequence database search is a function of the size of the search space (m*n), the normalized score ( λ S) and a minor constant (k mostly 0.1) </li></ul></ul><ul><li>E-Value grows linearly with the product of target and query sizes. Doubling target set size and doubling query length have the same effect on e-value </li></ul>
  40. 45. Analytical derivation <ul><li>Erd ö s-R é nyi </li></ul><ul><li>… </li></ul><ul><li>… </li></ul><ul><li>… </li></ul><ul><li>Karlin-Alschul </li></ul>R=log 1/p (mn) E=kmn - λ S
  41. 46. Scoring alignments <ul><li>Score: S (~R) </li></ul><ul><ul><li>S=  M (qi,ti) -  gaps </li></ul></ul><ul><li>Any alignment has a score </li></ul><ul><li>Any two sequences have a(t least one) optimal alignment </li></ul>
  42. 47. <ul><li>For a particular scoring matrix and its associated gap initiation and extention costs one must calculate λ and k </li></ul><ul><li>Unfortunately (for gapped alignments), you can’t do this analytically and the values must be estimated empirically </li></ul><ul><ul><li>The procedure involves aligning random sequences (Monte Carlo approach) with a specific scoring scheme and observing the alignment properties (scores, target frequencies and lengths) </li></ul></ul>
  43. 48. <ul><li>“ Monte Carlo” Approach: </li></ul><ul><li>Compares result to randomized result, similarly to results generated by a roulette wheel at Monte Carlo </li></ul><ul><li>Typical procedure for alignments </li></ul><ul><ul><li>Randomize sequence A </li></ul></ul><ul><ul><li>Align to sequence B </li></ul></ul><ul><ul><li>Repeat many times (hundreds) </li></ul></ul><ul><ul><li>Keep track op optimal score </li></ul></ul><ul><li>Histogram of scores … </li></ul><ul><ul><li>Significance </li></ul></ul>
  44. 49. Assessing significance requires a distribution <ul><li>I have an pumpkin of diameter 1m. Is that unusual? </li></ul>Diameter (m) Frequency
  45. 52. <ul><li>In seeking optimal Alignments between two sequences, one desires those that have the highest score - i.e. one is seeking a distribution of maxima </li></ul><ul><li>In seeking optimal Matches between an Input Sequence and Sequence Entries in a Database, one again desires the matches that have the highest score, and these are obtained via examination of the distribution of such scores for the entries in the database - this is again a distribution of maxima. </li></ul><ul><li>“ A Normal Distribution is a distribution of Sums of independent variables rather than a sum of their Maxima. “ </li></ul>Normal Distribution does NOT Fit Alignment Scores !! <ul><ul><li>Significance </li></ul></ul>
  46. 53. Comparing distributions   Extreme Value: Gaussian:
  47. 54. P(x  S) = 1-exp(-k  m  n  e -  S ) m, n: sequence lengths. k,  free parameters. This can be shown analytically for ungapped alignments and has been found empirically to also hold for gapped alignments under commonly used conditions. Alignment of unrelated/random sequences result in scores following an extreme value distribution <ul><ul><li>Alignment scores follow extreme value distributions </li></ul></ul>E x P = 1 –e -E E=-ln(1-P)
  48. 55. Alignment algorithms will always produce alignments, regardless of whether it is meaningful or not => important to have way of selecting significant alignments from large set of database hits. Solution: fit distribution of scores from database search to extreme value distribution; determine p-value of hit from this fitted distribution. Example: scores fitted to extreme value distribution. 99.9% of this distribution is located below score=112 => hit with score = 112 has a p-value of 0.1% <ul><ul><li>Alignment scores follow extreme value distributions </li></ul></ul>
  49. 56. BLAST uses precomputed extreme value distributions to calculate E-values from alignment scores For this reason BLAST only allows certain combinations of substitution matrices and gap penalties This also means that the fit is based on a different data set than the one you are working on A word of caution: BLAST tends to overestimate the significance of its matches E-values from BLAST are fine for identifying sure hits One should be careful using BLAST’s E-values to judge if a marginal hit can be trusted (e.g., you may want to use E-values of 10 -4 to 10 -5 ). <ul><ul><li>Significance </li></ul></ul>
  50. 57. Determining P-values <ul><li>If we can estimate  and  , then we can determine, for a given match score x , the probability that a random match with score x or greater would have occurred in the database. </li></ul><ul><li>For sequence matches, a scoring system and database can be parameterized by two parameters, k and  , related to  and  . </li></ul><ul><ul><li>It would be nice if we could compare hit significance without regard to the scoring system used! </li></ul></ul>
  51. 58. Bit Scores <ul><li>The expected number of hits with score  S is: E = Kmn e  s </li></ul><ul><ul><li>Where m and n are the sequence lengths </li></ul></ul><ul><li>Normalize the raw score using: </li></ul><ul><li>Obtains a “bit score” S’, with a standard set of units. </li></ul><ul><li>The new E-value is: </li></ul>
  52. 59. -74 -73 -72 * -71 ***** -70 ******* -69 ********** -68 *************** -67 ************************* -66 ************************* -65 ************************************ -64 ***************************************** -63 ************************************************************ -61 ************************ -60 ***************************** -59 ******************* -58 ************** -57 ********* -56 ******** -55 ***** -54 **** -53 * -52 * -51 * -50 -49 (Average around -64 !)
  53. 60. <ul><li>The distribution of scores graph of frequency of observed scores </li></ul><ul><li>expected curve (asterisks) according to the extreme value distribution </li></ul><ul><ul><li>the theoretic curve should be similar to the observed results </li></ul></ul><ul><li>deviations indicate that the fitting parameters are wrong </li></ul><ul><ul><li>too weak gap penalties </li></ul></ul><ul><ul><li>compositional biases </li></ul></ul><ul><ul><li>FastA Output </li></ul></ul>
  54. 61. < 20 222 0 :* 22 30 0 :* 24 18 1 :* 26 18 15 :* 28 46 159 :* 30 207 963 :* 32 1016 3724 := * 34 4596 10099 :==== * 36 9835 20741 :========= * 38 23408 34278 :==================== * 40 41534 47814 :=================================== * 42 53471 58447 :============================================ * 44 73080 64473 :====================================================*======= 46 70283 65667 :=====================================================*==== 48 64918 62869 :===================================================*== 50 65930 57368 :===============================================*======= 52 47425 50436 :======================================= * 54 36788 43081 :=============================== * 56 33156 35986 :============================ * 58 26422 29544 :====================== * 60 21578 23932 :================== * 62 19321 19187 :===============* 64 15988 15259 :============*= 66 14293 12060 :=========*== 68 11679 9486 :=======*== 70 10135 7434 :======*== <ul><ul><li>FastA Output </li></ul></ul>
  55. 62. 72 8957 5809 :====*=== 74 7728 4529 :===*=== 76 6176 3525 :==*=== 78 5363 2740 :==*== 80 4434 2128 :=*== 82 3823 1628 :=*== 84 3231 1289 :=*= 86 2474 998 :*== 88 2197 772 :*= 90 1716 597 :*= 92 1430 462 :*= :===============*======================== 94 1250 358 :*= :============*=========================== 96 954 277 :* :=========*======================= 98 756 214 :* :=======*=================== 100 678 166 :* :=====*================== 102 580 128 :* :====*=============== 104 476 99 :* :===*============= 106 367 77 :* :==*========== 108 309 59 :* :==*======== 110 287 46 :* :=*======== 112 206 36 :* :=*====== 114 161 28 :* :*===== 116 144 21 :* :*==== 118 127 16 :* :*==== >120 886 13 :* :*============================== Related <ul><ul><li>FastA Output </li></ul></ul>
  56. 63. <ul><li>A summary of the statistics and of the program parameters follows the histogram. </li></ul><ul><ul><li>An important number in this summary is the Kolmogorov-Smirnov statistic, which indicates how well the actual data fit the theoretical statistical distribution. The lower this value, the better the fit, and the more reliable the statistical estimates. </li></ul></ul><ul><ul><li>In general, a Kolmogorov-Smirnov statistic under 0.1 indicates a good fit with the theoretical model. If the statistic is higher than 0.2, the statistics may not be valid, and it is recommended to repeat the search, using more stringent (more negative) values for the gap penalty parameters. </li></ul></ul><ul><ul><li>FastA Output </li></ul></ul>
  57. 64. Statistics summary <ul><li>Optimal local alignment scores for pairs of random amino acid sequences of the same length follow and extreme-value distribution. For any score S, the probability of observing a score >= S is given by the Karlin-Altschul statistic (P(score>=S)=1-exp(-kmne(-lambda.S)) </li></ul><ul><li>k en Lambda are parameters related to the position of the maximum and the with of the distribution, </li></ul><ul><li>Note the long tail at the right. This means that a score serveral standard deviations above the mean has higher probability of arising by chance (that is, it is less significant) than if the scores followed a normal distribution. </li></ul>
  58. 65. P-values <ul><li>Many programs report P = the probability that the alignment is no better than random. The relationship between Z and P depends on the distribution of the scores from the control population, which do NOT follow the normal distributions </li></ul><ul><ul><li>P<=10E -100 (exact match) </li></ul></ul><ul><ul><li>P in range 10E -100 10E -50 (sequences nearly identical eg. Alleles or SNPs </li></ul></ul><ul><ul><li>P in range 10E -50 10E -10 (closely related sequenes, homology certain) </li></ul></ul><ul><ul><li>P in range 10 -5 10E -1 (usually distant relatives) </li></ul></ul><ul><ul><li>P > 10 -1 (match probably insignificant) </li></ul></ul>
  59. 66. E <ul><li>For database searches, most programs report E-values. The E-value of an alignemt is the expected number of sequences that give the same Z-score or better if the database is probed with a random sequence. E is found by multiplying the value of P by the size of the database probed. Note that E but not P depends on the size of the database. Values of P are between 0 and 1. Values of E are between 0 and the number of sequences in the database searched: </li></ul><ul><ul><li>E<=0.02 sequences probably homologous </li></ul></ul><ul><ul><li>E between 0.02 and 1 homology cannot be ruled out </li></ul></ul><ul><ul><li>E>1 you would have to expect this good a match by just chance </li></ul></ul>
  60. 67. DataBase Searching <ul><li>Dynamic Programming </li></ul><ul><li>Reloaded </li></ul><ul><li>Database Searching </li></ul><ul><li>Fasta </li></ul><ul><li>Blast </li></ul><ul><li>Statistics </li></ul><ul><li>Practical Guide </li></ul><ul><li>Extentions </li></ul><ul><li>PSI-Blast </li></ul><ul><li>PHI-Blast Local Blast </li></ul><ul><li>Blast </li></ul>
  61. 68. <ul><li>BLAST is actually a family of programs: </li></ul><ul><li>BLASTN - Nucleotide query searching a nucleotide database. </li></ul><ul><li>BLASTP - Protein query searching a protein database. </li></ul><ul><li>BLASTX - Translated nucleotide query sequence (6 frames) searching a protein database. </li></ul><ul><li>TBLASTN - Protein query searching a translated nucleotide (6 frames) database. </li></ul><ul><li>TBLASTX - Translated nucleotide query (6 frames) searching a translated nucleotide (6 frames) database. </li></ul><ul><ul><li>Blast </li></ul></ul>
  62. 69. <ul><ul><li>Blast </li></ul></ul>
  63. 70. <ul><ul><li>Blast </li></ul></ul>
  64. 71. <ul><ul><li>Blast </li></ul></ul>
  65. 72. <ul><ul><li>Blast </li></ul></ul>
  66. 73. <ul><ul><li>Blast </li></ul></ul>
  67. 74. <ul><ul><li>Blast </li></ul></ul>
  68. 75. <ul><ul><li>Blast </li></ul></ul>
  69. 84. <ul><li>Be aware of what options you have selected when using BLAST, or FASTA implementations. </li></ul><ul><li>Treat BLAST searches as scientific experiments </li></ul><ul><li>So you should try your searches with the filters on and off to see whether it makes any difference to the output </li></ul><ul><ul><li>Tips </li></ul></ul>
  70. 85. Tips: Low-complexity and Gapped Blast Algorithm <ul><li>The common, Web-based ones often have default settings that will affect the outcome of your searches. By default all NCBI BLAST implementations filter out biased sequence composition from your query sequence (e.g. signal peptide and transmembrane sequences - beware!). </li></ul><ul><li>The SEG program has been implemented as part of the blast routine in order to mask low-complexity regions </li></ul><ul><li>Low-complexity regions are denoted by strings of Xs in the query sequence </li></ul>
  71. 86. <ul><li>The sequence databases contain a wealth of information. They also contain a lot of errors. Contaminants … </li></ul><ul><li>Annotation errors, frameshifts that may result in erroneous conceptual translations. </li></ul><ul><li>Hypothetical proteins ? </li></ul><ul><li>In the words of Fox Mulder, &quot;Trust no one.&quot; </li></ul><ul><ul><li>Tips </li></ul></ul>
  72. 87. <ul><li>Once you get a match to things in the databases, check whether the match is to the entire protein, or to a domain. Don't immediately assume that a match means that your protein carries out the same function (see above). Compare your protein and the match protein(s) along their entire lengths before making this assumption. </li></ul><ul><ul><li>Tips </li></ul></ul>
  73. 88. <ul><li>Domain matches can also cause problems by hiding other informative matches. For instance if your protein contains a common domain you'll get significant matches to every homologous sequence in the database. BLAST only reports back a limited number of matches, ordered by P value. </li></ul><ul><li>If this list consists only of matches to the same domain, cut this bit out of your query sequence and do the BLAST search again with the edited sequence (e.g. NHR). </li></ul><ul><ul><li>Tips </li></ul></ul>
  74. 89. <ul><li>Do controls wherever possible. In particular when you use a particular search software for the first time. </li></ul><ul><li>Suitable positive controls would be protein sequences known to have distant homologues in the databases to check how good the software is at detecting such matches. </li></ul><ul><li>Negative controls can be employed to make sure the compositional bias of the sequence isn't giving you false positives. Shuffle your query sequence and see what difference this makes to the matches that are returned. A real match should be lost upon shuffling of your sequence. </li></ul><ul><ul><li>Tips </li></ul></ul>
  75. 90. <ul><li>Perform Controls </li></ul><ul><ul><li>#!/usr/bin/perl -w </li></ul></ul><ul><ul><li>use strict; </li></ul></ul><ul><ul><li>my ($def, @seq) = <>; </li></ul></ul><ul><ul><li>print $def; </li></ul></ul><ul><ul><li>chomp @seq; </li></ul></ul><ul><ul><li>@seq = split(//, join(&quot;&quot;, @seq)); </li></ul></ul><ul><ul><li>my $count = 0; </li></ul></ul><ul><ul><li>while (@seq) { </li></ul></ul><ul><ul><li>my $index = rand(@seq); </li></ul></ul><ul><ul><li>my $base = splice(@seq, $index, 1); </li></ul></ul><ul><ul><li>print $base; </li></ul></ul><ul><ul><li>print &quot;n&quot; if ++$count % 60 == 0; </li></ul></ul><ul><ul><li>} </li></ul></ul><ul><ul><li>print &quot;n&quot; unless $count %60 == 0; </li></ul></ul><ul><ul><li>Tips </li></ul></ul>
  76. 91. <ul><li>Read the footer first </li></ul><ul><li>View results graphically </li></ul><ul><li>Parse Blasts with Bioperl </li></ul>Tips
  77. 92. <ul><li>BLAST's major advantage is its speed. </li></ul><ul><ul><li>2-3 minutes for BLAST versus several hours for a sensitive FastA search of the whole of GenBank. </li></ul></ul><ul><li>When both programs use their default setting, BLAST is usually more sensitive than FastA for detecting protein sequence similarity. </li></ul><ul><ul><li>Since it doesn't require a perfect sequence match in the first stage of the search. </li></ul></ul><ul><ul><li>FastA vs. Blast </li></ul></ul>
  78. 93. <ul><ul><li>Weakness of BLAST: </li></ul></ul><ul><ul><li>The long word size it uses in the initial stage of DNA sequence similarity searches was chosen for speed, and not sensitivity. </li></ul></ul><ul><ul><li>For a thorough DNA similarity search, FastA is the program of choice, especially when run with a lowered KTup value. </li></ul></ul><ul><ul><li>FastA is also better suited to the specialised task of detecting genomic DNA regions using a cDNA query sequence, because it allows the use of a gap extension penalty of 0. BLAST, which only creates ungapped alignments, will usually detect only the longest exon, or fail altogether. </li></ul></ul><ul><li>In general, a BLAST search using the default parameters should be the first step in a database similarity search strategy. In many cases, this is all that may be required to yield all the information needed, in a very short time. </li></ul><ul><ul><li>FastA vs. Blast </li></ul></ul>
  79. 94. DataBase Searching <ul><li>Dynamic Programming </li></ul><ul><li>Reloaded </li></ul><ul><li>Database Searching </li></ul><ul><li>Fasta </li></ul><ul><li>Blast </li></ul><ul><li>Statistics </li></ul><ul><li>Practical Guide </li></ul><ul><li>Extentions </li></ul><ul><li>PSI-Blast </li></ul><ul><li>PHI-Blast Local Blast </li></ul><ul><li>BLAT </li></ul>
  80. 95. <ul><li>1. Old (ungapped) BLAST </li></ul><ul><li>2. New BLAST (allows gaps) </li></ul><ul><li>3. Profile -> PSI Blast - Position Specific Iterated </li></ul><ul><ul><li>Strategy:Multiple alignment of the hits </li></ul></ul><ul><li>Calculates a position-specific score matrix </li></ul><ul><li>Searches with this matrix </li></ul><ul><ul><li>In many cases is much more sensitive to weak but biologically relevant sequence similarities </li></ul></ul><ul><ul><li>PSSM !!! </li></ul></ul><ul><ul><li>PSI-Blast </li></ul></ul>
  81. 96. <ul><li>Patterns of conservation from the alignment of related sequences can aid the recognition of distant similarities. </li></ul><ul><ul><li>These patterns have been variously called motifs, profiles, position-specific score matrices, and Hidden Markov Models. </li></ul></ul><ul><ul><li>For each position in the derived pattern, every amino acid is assigned a score. </li></ul></ul><ul><ul><li>(1) Highly conserved residue at a position: that residue is assigned a high positive score, and others are assigned high negative scores. </li></ul></ul><ul><ul><li>(2) Weakly conserved positions: all residues receive scores near zero. </li></ul></ul><ul><ul><li>(3) Position-specific scores can also be assigned to potential insertions and deletions. </li></ul></ul><ul><ul><li>PSI-Blast </li></ul></ul>
  82. 97. Pattern <ul><li>a set of alternative sequences, using “ regular expressions ” </li></ul><ul><li>Prosite ( </li></ul>
  83. 98. PSSM (Position Specific Scoring Matrice)
  84. 99. PSSM (Position Specific Scoring Matrice)
  85. 100. PSSM (Position Specific Scoring Matrice)
  86. 101. <ul><li>The power of profile methods can be further enhanced through iteration of the search procedure. </li></ul><ul><ul><li>After a profile is run against a database, new similar sequences can be detected. A new multiple alignment, which includes these sequences, can be constructed, a new profile abstracted, and a new database search performed. </li></ul></ul><ul><ul><li>The procedure can be iterated as often as desired or until convergence, when no new statistically significant sequences are detected. </li></ul></ul><ul><ul><li>PSI-Blast </li></ul></ul>
  87. 102. <ul><li>(1) PSI-BLAST takes as an input a single protein sequence and compares it to a protein database, using the gapped BLAST program. </li></ul><ul><li>(2) The program constructs a multiple alignment, and then a profile, from any significant local alignments found. </li></ul><ul><li>The original query sequence serves as a template for the multiple alignment and profile, whose lengths are identical to that of the query. Different numbers of sequences can be aligned in different template positions. </li></ul><ul><li>(3) The profile is compared to the protein database, again seeking local alignments using the BLAST algorithm. </li></ul><ul><li>(4) PSI-BLAST estimates the statistical significance of the local alignments found. </li></ul><ul><li>Because profile substitution scores are constructed to a fixed scale, and gap scores remain independent of position, the statistical theory and parameters for gapped BLAST alignments remain applicable to profile alignments. </li></ul><ul><li>(5) Finally, PSI-BLAST iterates, by returning to step (2), a specified number of times or until convergence. </li></ul><ul><ul><li>PSI-Blast </li></ul></ul>
  88. 103. From: PSI-BLAST PSSM PSSM
  89. 104. PSI-BLAST
  90. 105. PSI-BLAST
  91. 106. PSI-BLAST
  92. 107. PSI-BLAST
  93. 108. <ul><li>Avoid too close sequences: overfit! </li></ul><ul><li>Can include false homologous! Therefore check the matches carefully: include or exclude sequences based on biological knowledge. </li></ul><ul><li>The E-value reflects the significance of the match to the previous training set not to the original sequence! </li></ul><ul><li>Choose carefully your query sequence. </li></ul><ul><li>Try reverse experiment to certify. </li></ul>PSI-BLAST pitfalls
  94. 109. <ul><li>A single sequence is selected from a set of blocks and enriched by replacing the conserved regions delineated by the blocks by consensus residues derived from the blocks. </li></ul><ul><li>Embedding consensus residues improves performance </li></ul><ul><li>S. Henikoff and J.G. Henikoff; Protein Science (1997) 6:698-705. </li></ul><ul><ul><li>Reduce overfitting risk by Cobbler </li></ul></ul>
  95. 110. DataBase Searching <ul><li>Dynamic Programming </li></ul><ul><li>Reloaded </li></ul><ul><li>Database Searching </li></ul><ul><li>Fasta </li></ul><ul><li>Blast </li></ul><ul><li>Statistics </li></ul><ul><li>Practical Guide </li></ul><ul><li>Extentions </li></ul><ul><li>PSI-Blast </li></ul><ul><li>PHI-Blast </li></ul><ul><li>Local Blast </li></ul><ul><li>BLAT </li></ul>
  96. 111. PHI-Blast Local Blast (Pattern-Hit Initiated BLAST)
  97. 112. PHI-Blast Local Blast From:
  98. 113. PHI-Blast Local Blast
  99. 114. PHI-Blast Local Blast
  100. 115. PHI-Blast Local Blast
  101. 116. DataBase Searching <ul><li>Dynamic Programming </li></ul><ul><li>Reloaded </li></ul><ul><li>Database Searching </li></ul><ul><li>Fasta </li></ul><ul><li>Blast </li></ul><ul><li>Statistics </li></ul><ul><li>Practical Guide </li></ul><ul><li>Extentions </li></ul><ul><li>PSI-Blast </li></ul><ul><li>PHI-Blast </li></ul><ul><li>Local Blast </li></ul><ul><li>BLAT </li></ul>
  102. 117. Installing Blast Locally <ul><li>2 flavors: NCBI/WuBlast </li></ul><ul><li>Excutables: </li></ul><ul><ul><li> </li></ul></ul><ul><li>Database: </li></ul><ul><ul><li> </li></ul></ul><ul><li>Formatdb </li></ul><ul><ul><li>formatdb -i ecoli.nt -p F </li></ul></ul><ul><ul><li>formatdb -i ecoli.protein -p T </li></ul></ul><ul><li>For options: blastall - </li></ul><ul><ul><li>blastall -p blastp -i query -d database -o output </li></ul></ul>
  103. 118. DataBase Searching <ul><li>Dynamic Programming </li></ul><ul><li>Reloaded </li></ul><ul><li>Database Searching </li></ul><ul><li>Fasta </li></ul><ul><li>Blast </li></ul><ul><li>Statistics </li></ul><ul><li>Practical Guide </li></ul><ul><li>Extentions </li></ul><ul><li>PSI-Blast </li></ul><ul><li>PHI-Blast </li></ul><ul><li>Local Blast </li></ul><ul><li>BLAT </li></ul>
  104. 119. Main database: BLAT <ul><li>BLAT: BLAST-Like Alignment Tool </li></ul><ul><li>Aligns the input sequence to the Human Genome </li></ul><ul><li>Connected to several databases, like: </li></ul><ul><ul><li>mRNAs - GenScan </li></ul></ul><ul><ul><li>ESTs - TwinScan </li></ul></ul><ul><ul><li>RepeatMasker - UniGene </li></ul></ul><ul><ul><li>RefSeq - CpG Islands </li></ul></ul>
  105. 120. BLAT Human Genome Browser
  106. 121. BLAT method <ul><li>Align sequence with BLAT, get alignment info </li></ul><ul><li>Per BLAT hit, pick up additional info from connected databases: </li></ul><ul><ul><li>mRNAs </li></ul></ul><ul><ul><li>ESTs </li></ul></ul><ul><ul><li>RepeatMasker </li></ul></ul><ul><ul><li>CpG Islands </li></ul></ul><ul><ul><li>RefSeq Genes </li></ul></ul>
  107. 123. Weblems <ul><li>W5.1: Submit the amino acid sequence of papaya papein to a BLAST (gapped and ungapped) and to a PSI-BLAST search. What are the main difference in results? </li></ul><ul><li>W5.2: Is there a relationship between Klebsiella aerogenes urease, Pseudomonas diminuta phosphotriesterase and mouse adenosine deaminase ? Also use DALI, ClustalW and T-coffee. </li></ul><ul><li>W5.3: Yeast two-hybrid typically yields DNA sequences. How would you find the corresponding protein ? </li></ul><ul><li>W5.4: When and why would you use tblastn ? </li></ul><ul><li>W5.5: How would you search a database if you want to restrict the search space to those entries having a secretion signal consisting of 4 consecutive (N-terminal) basic residues ? </li></ul>