Presentation is loading. Please wait.

Presentation is loading. Please wait.

52930 Protein informatics Liisa Holm.

Similar presentations


Presentation on theme: "52930 Protein informatics Liisa Holm."— Presentation transcript:

1 52930 Protein informatics Liisa Holm

2 Organization Lectures Textbook Web site
Wednesdays 6 September to 14 October Exam Friday 16 October Essay type question Numerical problems Textbook DW Mount: Bioinformatics. Sequence and genome analysis. 2nd edition. Chapters 3-7,10-11 Web site

3 Aims & scope Expose biology students to background of methods
Related practical course Practical course in protein informatics (Proteiinianalyysin harjoitustyöt) Hands-on practice in using web servers that implement methods Neither course required for the other

4 Topics Pairwise alignment
Probability and statistical analysis of sequence alignments Multiple sequence alignment Database searching Phylogenetic prediction Protein classification and structure prediction Genome annotation

5 Pairwise alignment

6 Why align sequences? Common ancestor
Infer common evolutionary origin from similarity Then can infer function and structure Similarity can be due to Gene duplication + speciation Horizontal gene transfer Gene fusion Convergence (similarity without homology) Sequence A Sequence B x steps y steps Ancestral sequence

7 Similar sequences are likely homologous
Dissimilar sequences are less likely to be homologous

8 4-letter word example This is not the usual substitution model
WORD (d=0, p=1/N^4) WORE (d=1, p=4/N^3) GORE (d=2, p=6/N^2) GONE (d=3, p=4/N) GENE (d=4, p=1)

9 Optimal alignment Assuming independence between scores for each position, the optimal alignment can be determined using dynamic programming Setup: scoring matrix, gap penalties

10 Dynamic programming 3 4 1 2 Maximal path sum BEGIN  END ?
2 4 BEGIN END D Maximal path sum BEGIN  END ? Enumerate every path brute force Use induction: only one optimal path up to any node in graph.

11 Example: all paths leading to B
C 3 3 3 8 3 4 1 BEGIN 7 END 1 2 1 D

12 Global alignment Needleman-Wunsch algorithm
Maximal trace from beginning to end Global alignment score may be negative

13 Local alignment Aligned region truncated to segment giving the largest positive contribution

14 Scoring alignments Substitution matrices Significance Gap penalties
Aligning two sequences, would you expect the same level of similarity by chance alone?

15 Conversion between odds score, log odds and bit scores
Odds score = ratio of likelihoods of two events or outcomes. E.g. observed frequency of aligned A and B in related sequences divided by the frequency with which A and B align by chance f(A and B) / [ f(A) * f(B)] Odds scores are often converted to logarithms to create log odds scores. Log odds scores are additive. Bit score = log odds score converted to a logarithm to the base 2

16 Bit-scores The score needed to distinguish an MSP from chance is approximately the number of bits needed to specify where the MSP starts in each of the two sequences being compared MSP = maximally scoring pair Ungapped alignment case Log2 N bits are needed to distinguish among N possibilities Two proteins of 250 residues: 16 bits Database of 4M residues: 30 bits [160 M: 34 bits]

17 Dayhoff model Markov chain: mutations independent of previous mutations Data: 71 groups of closely related sequnces (>85 % similarity), yielding 1572 substitution events Mutability of amino acid types (per 100 accepted point mutations)

18 PAM1 and PAM250 for Phe -> X
Ala 0.0002 0.04 Leu 0.0013 0.13 Arg 0.0001 0.01 Lys 0.0000 0.02 Asn Met Asp Phe 0.9946 0.32 Cys Pro Gln Ser 0.0003 0.03 Glu Thr Gly Trp His Tyr 0.0021 0.15 Ile 0.0007 0.05 Val These are mutation probabilities!

19 Log odds form of PAM250 Unit is 10 * logarithm to the base 10 of ratio
S(A,B) = ½ * (10 * log10(p(A->B)/f(A)) + 10 * log10 (p(B->A)/f(B)) Range -8 … +17 Local alignment scores are maximal, when PAM distance corresponds to the similarity of the target sequences

20 BLOSUM matrices The BLOSUM matrix assigns a probability score for each residue pair in an alignment based on: the frequency with which that pairing is known to occur within conserved blocks of related proteins. BLOSUM matrices are constructed from observations which lead to observed probabilities

21 BLOSUM substitution matrices
BLOSUM matrices are used in ‘log-odds’ form based on actually observed substitutions. This is because: Ease of use: ‘Scores’ can be just added (the raw probabilities would have to be multiplied) Ease of interpretation: S=0 : substitution is just as likely to occur as random S<0 : substitution is more likely to occur randomly than observed S>0 : substitution is less likely to occur randomly than observed Unit is half-bits (odds ratio to logarithm base 2, multiplied by 2) Observed v. expected. But I’m going to describe what the numbers mean, and how they relate to one another. For example, we intuitively know that 6 is better than 5. But how much better? shows traceback

22 Information content • Using a standard measure for overall amino acid frequencies gives the information content of a random protein sequence as 4.19 bits/residue. • Thus, for an average size protein domain (150 residues), the message length is ~630 bits and the probability that 2 random sequences would specify the same message is (10-190). > Database searching for protein similarities is doable, even for fairly short sequences • BUT, for a transcription binding site of 8-10 bp, the odds of 2 random sequences arriving at the same message is 10-5. > Database searching for regulatory elements does not work well as databases get larger

23 Relative entropy H of target and background distributions
Scale score matrix s to bits qij H = S qij sij = S qij log pi pj q = target frequencies of amino acids p = background frequencies H measures the average information available per position to distinguish the alignment from chance

24 qij Score = S fij sij ~ S fij ln pi pj Optimal scoring matrix: target distribution q = frequencies in alignment f

25 Affine gap penalties Gap opening penalty (g) Gap extension penalty (r)
W(x) = g + rx X is the length of the gap Well working gap penalties: BLSOUM62 (-11,-1)

26 Statistical Significance
• A good way to determine if an alignment score has statistical meaning is to compare it with the score generated from the alignment of two random sequences • A model of ‘random’ sequences is needed. The simplest model chooses the amino acid residues in a sequence independently, with background probabilities (Karlin & Altschul (1990) Proc. Natl. Acad. Sci. USA, 87 (1990) )

27 Alignment score Optimal alignment scores follow extreme value distribution Exact theory for ungapped local alignments There is at least one positive score sij Average score is negative Results hold empirically for gapped alignments

28 Probability and statistics

29 The need for statistics
Statistics is very important for bioinformatics. It is very easy to have a computer analyze the data and give you back a result. Problem is to decide whether the answer the computer gives you is any good at all. Questions: How statistically significant is the answer? What is the probability that this answer could have been obtained by random? What does this depend on? Statistics underly many tools which we use for protein analysis, including: alignment tools, eg: BLAST protein classification eg, PFAM (HMM), Other questions: Is a certain pattern of amino acids or nucleotides important information that tells you something about a sequence, or is it nothing more than a fluctuation in the random background noise? These are the underlying questions you need to ask whenever you do a database search or other type of bioinformatics analysis.

30 Basics N n Sample Population

31 Basics N Descriptive statistics n Sample Population Probability

32 Substitution matrices
Score of amino acid a with amino acid b Pab is the observed frequency that residues a and b are correlated because of homology shows traceback Lambda is a scaling factor equal to 0.347, set so that the scores can be rounded off to sensible integers fafb is the expected frequency of seeing residues a and b paired together, which is just the product of the frequency of residue a multiplied by the frequency of residue b Source: Where did the BLOSUM62 alignment score matrix come from? Eddy S., Nat. Biotech. 22 Aug 2004

33 Substitution matrices
Lambda is a scaling factor equal to 0.347, set so that the scores can be rounded off to sensible integers Pab is the observed frequency that residues a and b are correlated because of homology shows traceback fafb is the expected frequency of seeing residues a and b paired together, which is just the product of the frequency of residue a multiplied by the frequency of residue b

34

35 ii) Compare S=5 and S=10. Ratio is based on exponential function
i) S=0 : O/E ratio=1 ii) Compare S=5 and S=10. Ratio is based on exponential function iii) S=-10: O/E ratio = ≈ 1/32. iv) Ratio of scores S1, S2 in terms of probabilities of observed/random = i) ii) iii) ie the correspondence of two aas in an alignment that accurately represents homology (evolutionary descent) is one tenth as frequent as the chance alignment of these amino acids. iv) eg: The ratio of probabilities for scores : 10, 5 would be about 5.6

36 ii) Compare S=5 and S=10. Ratio is based on exponential function
i) S=0 : O/E ratio=1 ii) Compare S=5 and S=10. Ratio is based on exponential function iii) S=-10: O/E ratio = ≈ 1/32. iv) Ratio of scores S1, S2 in terms of probabilities of observed/random = 32.1 i) ii) iii) ie the correspondence of two aas in an alignment that accurately represents homology (evolutionary descent) is one tenth as frequent as the chance alignment of these amino acids. iv) eg: The ratio of probabilities for scores : 10, 5 would be about 5.6 5.7

37 ii) Compare S=5 and S=10. Ratio is based on exponential function
i) S=0 : O/E ratio=1 ii) Compare S=5 and S=10. Ratio is based on exponential function iii) S=-10: O/E ratio = ≈ 1/32. iv) Ratio of scores S1, S2 in terms of probabilities of observed/random = 32.1 i) ii) iii) ie the correspondence of two aas in an alignment that accurately represents homology (evolutionary descent) is one tenth as frequent as the chance alignment of these amino acids. iv) eg: The ratio of probabilities for scores : 10, 5 would be about 5.6 5.7

38 ii) Compare S=5 and S=10. Ratio is based on exponential function
i) S=0 : O/E ratio=1 ii) Compare S=5 and S=10. Ratio is based on exponential function iii) S=-10: O/E ratio = ≈ 1/32. iv) Ratio of scores S1, S2 in terms of probabilities of observed/random = 32.1 i) ii) iii) ie the correspondence of two aas in an alignment that accurately represents homology (evolutionary descent) is one tenth as frequent as the chance alignment of these amino acids. iv) eg: The ratio of probabilities for scores : 10, 5 would be about 5.6 5.7

39 Example: BLAST Motivations
Exact algorithms are exhaustive but computationally expensive. Exact algorithms are impractical for comparing a query sequence to millions of other sequences in a database (database scanning), and so, database scanning requires heuristic alignment algorithm (at the cost of optimality).

40 Interpret BLAST results - Description
ID (GI #, refseq #, DB-specific ID #) Click to access the record in GenBank Gene/sequence Definition Expect value – lower, better. It tells the possibility that this is a random hit Bit score – higher, better. Click to access the pairwise alignment Links

41 Problems with BLAST Why do results change?
How can you compare results from different BLAST tools which may report different types of values? How are results (eg evalue) affected by query There are _many_ values reported in the output – what do they mean?

42 Example: Importance of Blast statistics
But, first a review.

43 Review What is a distribution?
A plot showing the frequency of a given variable or observation.

44 Review What is a distribution?
A plot showing the frequency of a given variable or observation.

45 Features of a Normal Distribution
Symmetric Distribution Has an average or mean value at the centre Has a characteristic width called the standard deviation (S.D. = σ) Most common type of distribution known m = mean

46 Standard Deviations (Z-score)
Z value is the number of standard deviations you are away…. Disadvantages of Z-scores: Absolute value is lost Same score in different sample => different z-score

47 Mean, Median & Mode Mode Median Mean

48 Mean, Median, Mode In a Normal Distribution the mean, mode and median are all equal In skewed distributions they are unequal Mean - average value, affected by extreme values in the distribution Median - the “middlemost” value, usually half way between the mode and the mean Mode - most common value

49 Different Distributions
Unimodal Bimodal

50 Other Distributions Gumbel distribution
Binomial Distribution the discrete probability distribution of the number of successes in a sequence of n independent yes/no experiments, each of which yields success with probability p. Poisson Distribution expresses the probability of a number of events occurring in a fixed period of time if these events occur with a known average rate and independently of the time since the last event. Extreme Value Distribution Gumbel distribution used to model the distribution of the maximum (or the minimum) of a number of samples of various distributions.

51 Binomial Distribution
P(x) = (p + q)n 1 1 1

52 Poisson Distribution P(x) x
Proportion of samples m = 10 =0.1 = 1 = 2 = 3 P(x) Poisson distribution is like a normal distribution at high values of mu x

53 Gumbel distribution

54 Review What is a distribution? What is a null hypothesis?
A plot showing the frequency of a given variable or observation. What is a null hypothesis? A statistician’s way of characterizing “chance.” Generally, a mathematical model of randomness with respect to a particular set of observations. The purpose of most statistical tests is to determine whether the observed data can be explained by the null hypothesis.

55 Review What is a distribution? What is a null hypothesis?
A plot showing the frequency of a given variable or observation. What is a null hypothesis? A statistician’s way of characterizing “chance.” Generally, a mathematical model of randomness with respect to a particular set of observations. The purpose of most statistical tests is to determine whether the observed data can be explained by the null hypothesis.

56 Review Examples of null hypotheses:
Sequence comparison using shuffled sequences. A normal distribution of log ratios from a microarray experiment. LOD scores from genetic linkage analysis when the relevant loci are randomly sprinkled throughout the genome.

57 Empirical score distribution
The picture shows a distribution of scores from a real database search using BLAST. This distribution contains scores from non-homologous and homologous pairs. High scores from homology.

58 Empirical null score distribution
This distribution is similar to the previous one, but generated using a randomized sequence database.

59 Review What is a p-value?
The probability of observing an effect as strong or stronger than you observed, given the null hypothesis. I.e., “How likely is this effect to occur by chance?” Pr(x > S|null)

60 Review What is the name of the distribution created by sequence similarity scores, and what does it look like? Extreme value distribution, or Gumbel distribution. It looks similar to a normal distribution, but it has a larger tail on the right. Arises from sampling the extreme end of a normal distribution A distribution which is “skewed” due to its selective sampling Skew can be either right or left In the limit of sufficiently large sequence lengths m and n, the statistics of HSP scores are characterized by two parameters, K and lambda. Most simply, the expected number of HSPs with score at least S is given by the formula Equation gives Evalue. We call this the E-value for the score S. This formula makes eminently intuitive sense. Doubling the length of either sequence should double the number of HSPs attaining a given score. Also, for an HSP to attain the score 2x it must attain the score x twice in a row, so one expects E to decrease exponentially with score. The parameters K and lambda can be thought of simply as natural scales for the search space size and the scoring system respectively.

61 Review What is the name of the distribution created by sequence similarity scores, and what does it look like? Extreme value distribution, or Gumbel distribution. It looks similar to a normal distribution, but it has a larger tail on the right. Arises from sampling the extreme end of a normal distribution A distribution which is “skewed” due to its selective sampling Skew can be either right or left In the limit of sufficiently large sequence lengths m and n, the statistics of HSP scores are characterized by two parameters, K and lambda. Most simply, the expected number of HSPs with score at least S is given by the formula Equation gives Evalue. We call this the E-value for the score S. This formula makes eminently intuitive sense. Doubling the length of either sequence should double the number of HSPs attaining a given score. Also, for an HSP to attain the score 2x it must attain the score x twice in a row, so one expects E to decrease exponentially with score. The parameters K and lambda can be thought of simply as natural scales for the search space size and the scoring system respectively.

62 Statistics BLAST (and also local i.e. Smith-Waterman and BLAT scores) between random, unrelated sequences follow the Gumbel Extreme Value Distribution (EVD) Pr(s>S) = 1-exp(-Kmn e-lS) This is the probability of randomly encountering a score greater than S. S alignment score m,n query sequence lengths, and length of database resp. K, l parameters depending on scoring scheme and sequence composition Bit score : S’ = lS – log(K) log(2) We're interested in high scores S. Note that the bigger S gets, the smaller e-vS gets, and the smaller that gets, the closer exp(-Kmne-vS) gets to 1, and the closer the lower bound for P(s>S) gets to zero. That is, big S yield small P. Notice that the function 1 - exp(-Kmne-vS) is not the distribution itself, but the area under its right-tail. Recall that areas are associated with probabilities. In addition, if Kmne-vS is close to zero (ie as S gets bigger), then exp(-Kmne-vS) is well approximated by 1 - Kmne-vS. In that case the lower bound above can be well approximated by Kmne-vS. This value is called the expect. According to Setabul and Meidanis in their book "Introduction to Computational Molecular Biology", it is interpreted as the expected number of distinct segment pairs between two random sequences with score above S Nice website:

63 BLAST output revisited
S’ S E n m  K From: Expasy BLAST

64 Review EVD for random blast
Upper tail behaviour: Pr( s > S ) ~ Kmn e-lS This is the EXPECT value = Evalue This is the EXPECT value that you see on the NCBI web site.

65 How to Calculate E-values
Think of the databank as one very long random sequence, length G Alignments with s>S occur randomly across the genome, with a Poisson distribution Pr (highest-scoring alignment s>S) ~ KmGe-lS Pr( no alignment s>S ) ~ 1 - KmGe-lS Expected number m of alignments with s>S given by 1-e-m ~ 1 - KmGe-lS (Poisson property) m ~ -log(KmG) + lS Threshold S ~ [log(KmG) + m ]/l

66 P-value in Sequence Matching
P(s > S) = .01 P-value of .01 occurs at score threshold S (392 below) where score s from random comparison is greater than this threshold 1% of the time Likewise for P=.001 and so on.

67 What Distribution Really Looks Like
N Dependence True Positives

68 A most important caveat...
• For database searches, the ONLY criteria available to judge the likelihood of a structural or evolutionary relationship between 2 sequences is an estimate of statistical significance • For a medium-sized protein using default parameters (Blosum62, E = 10), the cut-off for statistical significance is P = • Statistical significance and biological significance are NOT necessarily the same

69 P-value P<=10-100 exact match 10-100 < P < 10-50
sequences very nearly identical, e.g., alleles or SNPs 10-50 < P < 10-10 closely related sequences, homology certain 10-5 < P < 10-1 usually distant relatives P > 0.1 match probably insignificant

70 Significance Depends on Database Size
The Significance of Similarity Scores Decreases with Database Growth The score between any pair of sequence pair is constant The number of database entries grows exponentially The number of non-homologous entries >> homologous entries Greater sensitivity is required to detect homologies Greater s Score of 100 might rank as best in database of 1000 but only in top-100 in database of expectation value DB-1 DB-2

71 Summary Want to be able to compare scores in sequences of different compositions or different scoring schemes Score: S = sum(match) – sum(gap costs) Notice that the bit score is a function of the database. Though this is better, this means that as the size of the database grows, the bit score for the same alignment can drop! This also means that the E-value will change.

72 Summary Want to be able to compare scores in sequences of different compositions or different scoring schemes Score: S = sum(match) – sum(gap costs) Bit score S’ = lS – log(K) log(2) Notice that the bit score is a function of the database. Though this is better, this means that as the size of the database grows, the bit score for the same alignment can drop! This also means that the E-value will change.

73 Summary Score and bit score grow linearly with the length of the alignment Want to be able to compare scores in sequences of different compositions or different scoring schemes Score: S = sum(match) – sum(gap costs) Bit score S’ = lS – log(K) log(2) Notice that the bit score is a function of the database. Though this is better, this means that as the size of the database grows, the bit score for the same alignment can drop! This also means that the E-value will change.

74 Summary Score and bit score grow linearly with the length of the alignment Want to be able to compare scores in sequences of different compositions or different scoring schemes Score: S = sum(match) – sum(gap costs) Bit score S’ = lS – log(K) log(2) E-value of bit score E = mn2-S’

75 Summary Score and bit score grow linearly with the length of the alignment E-Value shrinks really fast as bit score grows Want to be able to compare scores in sequences of different compositions or different scoring schemes Score: S = sum(match) – sum(gap costs) Bit score S’ = lS – log(K) log(2) E-value of bit score E = mn2-S’

76 Summary Score and bit score grow linearly with the length of the alignment E-Value shrinks really fast as bit score grows Want to be able to compare scores in sequences of different compositions or different scoring schemes Score: S = sum(match) – sum(gap costs) Bit score S’ = lS – log(K) log(2) E-value of bit score E = mn2-S’ E-Value grows linearly with the product of target and query sizes.

77 Summary Score and bit score grow linearly with the length of the alignment E-Value shrinks really fast as bit score grows Want to be able to compare scores in sequences of different compositions or different scoring schemes Score: S = sum(match) – sum(gap costs) Bit score S’ = lS – log(K) log(2) E-value of bit score E = mn2-S’ 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

78 Conclusion You should now be able to compare BLAST results from different databases, converting values if they are reported differently (which happens frequently) You should now know why BLAST results might change from one day to the next, even on the same server You should understand also the dependence of query length on E-value. Statistical rankings are reported for (almost) every database search tool. When making comparisons between databases, between sequences it is useful to know how the statistics are derived to know if comparisons are meaningful.

79 Exercises

80 Exercise 1: Calculation of Log Odds and Odds Scores by the BLOSUM Method
In one column of an alignment of a set of related, similar sequences, amino acid D changes to amino acid E at a frequency of 0.10, and the number of times this change is expected based on the number of occurrences of D and E in the column is 0.05. What is the odds score of finding a D-to-E substitution in an alignment? What is the log odds score for the D-to-E substitution in bits? (Note: log to base 2 = natural log / ) What would be the entry in the BLOSUM amino acid scoring matrix for this substitution? Compare your result to the actual entry in the BLOSUM62 matrix (D to E in BLOSUM62 : +2). In the same column, D does not change at all at a frequency of 0.80, and the expected frequency of D not changing is Calculate the corresponding log odds score and the BLOSUM62 entry for D not changing (D to D in BLOSUM62: +6).

81 Exercise 2: USING THE DYNAMIC PROGRAMMING METHOD TO CALCULATE THE LOCAL ALIGNMENT OF TWO SHORT SEQUENCES BY HAND The BLASTP algorithm performs a local alignment between a query sequence and a matching database sequence using the dynamic programming algorithm with the BLOSUM62 scoring matrix, a gap opening penalty of –11, and a gap extension penalty of –1 (i.e., a gap of length 1 has a penalty of –11, one of length 2, –12, etc.). Align the sequences MDPW and MEDPW using the Smith–Waterman algorithm described in the dynamic programming notes by following the global alignment example given in the notes, but using the Smith–Waterman algorithm. Make a matrix for keeping track of best scores and a second matrix to keep track of the moves that give the best scores. (Hint: The alignment of M's, P's, and W's all give high scores, so the problem boils down to how to align D with ED and is actually quite a trivial problem.) Use the BLOSUM62 matrix and BLASTP gap penalties of –11,–1. What is the optimal alignment and score between these two sequences?

82 Exercise 3 What is the odds score and log odds score of the following alignment? Blosum (D,D)=+6, (D,E)=+2      DEDEDEDE   DDDDDDDD Using the approximation S ~ log2(nm) and assuming that the above alignment was found by aligning two sequences of length 250, is the alignment significant at the 0.05 level? (That is, could an alignment of two random sequences of the same length achieve such a score with a probability of 0.05?) If the gap penalty was very high, e.g., gap opening of 8 and gap extension of 8, so that no gaps were produced, and the BLOSUM62 scoring matrix was used, calculate the significance of the alignment using the equation P(S>x) ~ 1-exp(-Kmn exp(- λ x)). Use K=0.060 and λ=0.270; note that this λ assumes that the alignment score is in half-bits so that the alignment score must be in these units also.


Download ppt "52930 Protein informatics Liisa Holm."

Similar presentations


Ads by Google