Presentation on theme: "Multiple testing correction"— Presentation transcript:
1 Multiple testing correction Prof. William Stafford NobleDepartment of Genome Sciences Department of Computer Science and EngineeringUniversity of Washington
2 Outline One-minute response Revision Multiple testing correction MotivationBonferroni adjustment and the E-valueFalse discovery ratePython
3 One-minute responses The class was too fast. I did not understand making the multiple alignment from pairwise alignments. Can we do more examples in class tomorrow?Python approach worked well.Python is hard for me to understand.We need extra Python tutorials.I did not understand some of the Python operations.Everything was clear, especially the Python code.Python part was not productive at all; I did not gain anything. Can we go back to the way we used to do the problems?
4 Summary Building a PSSM involves 5 steps: Count observations Compute pseudocountsSum counts and pseudocountsNormalizeCompute log-odds
5 1. Count observations A 2 C 0 D 0 E 1 F 1 G 1 H 0 I 0 K 1 L 0 M 0 P 0 Q 1R 1S 0T 0V 0W 0Y 0ObservedcountsObservedresiduesEQRGKAF
6 2. Compute pseudocounts The user specifies a pseudocount weight β. K 0.056L 0.096M 0.024P 0.053Q 0.042R 0.054S 0.072T 0.063V 0.073W 0.016Y 0.034A 0.170C 0.038D 0.108E 0.130F 0.080G 0.144H 0.046I 0.116K 0.112L 0.192M 0.048P 0.106Q 0.084R 0.108S 0.144T 0.126V 0.146W 0.032Y 0.068The user specifies a pseudocount weight β.β controls how much you trust the data versus your prior knowledge.In this case, let β = 2.Backgroundfrequencies 2Pseudocounts
17 Multiple testingSay that you perform a statistical test with a 0.05 threshold, but you repeat the test on twenty different observations.Assume that all of the observations are explainable by the null hypothesis.What is the chance that at least one of the observations will receive a p-value less than 0.05?
18 Multiple testingSay that you perform a statistical test with a 0.05 threshold, but you repeat the test on twenty different observations. Assuming that all of the observations are explainable by the null hypothesis, what is the chance that at least one of the observations will receive a p-value less than 0.05?Pr(making a mistake) = 0.05Pr(not making a mistake) = 0.95Pr(not making any mistake) = = 0.358Pr(making at least one mistake) = = 0.642There is a 64.2% chance of making at least one mistake.
19 Bonferroni correction Assume that individual tests are independent.Divide the desired p-value threshold by the number of tests performed.For the previous example, 0.05 / 20 =Pr(making a mistake) =Pr(not making a mistake) =Pr(not making any mistake) = =Pr(making at least one mistake) = =
20 Sample problem #1You have used a local alignment algorithm to search a query sequence against a database containing 10,000 protein sequences.You estimate that the p-value of your top-scoring alignment is 2.1 × 10-5.Is this alignment significance at a 95% confidence threshold?No, because 0.05 / = 5 × 10-6.
21 Sample problem #2Say that you search the non-redundant protein database at NCBI, containing roughly one million sequences.You want to use a conservative confidence threshold ofWhat p-value threshold should you use?A Bonferroni correction would suggest using a p-value threshold of / 1,000,000 = = 10-9.
22 E-valuesThe p-value is the probability of observing a given score, assuming the data is generated according to the null hypothesis.The E-value is the expected number of times that the given score would appear in a random database of the given size.One simple way to compute the E-value is to multiply the p-value times the size of the database.Thus, for a p-value of and a database of 1,000,000 sequences, the corresponding E-value is × 1,000,000 = 1,000.BLAST actually calculates E-values in a more complex way.
26 False discovery rate: Motivation Scenario #1: You have used PSI-BLAST to identify a new protein homology, and you plan to publish a paper describing this result.Scenario #2: You have used PSI-BLAST to discover many potential homologs of a single query protein, and you plan to carry out a wet lab experiment to validate your findings. The experiment can be done in parallel on 96 proteins.
27 Types of errorsFalse positive: the algorithm indicates that the sequences are homologs, but actually they are not.False negative: the sequences are homologs, but the algorithm indicates that they are not.Both types of errors are defined relative to some confidence threshold.Typically, researchers are more concerned about false positives.
28 False discovery rate 5 FP 13 TP 33 TN 5 FN The false discovery rate (FDR) is the percentage of target sequences above the threshold that are false positives.In the context of sequence database searching, the false discovery rate is the percentage of sequences above the threshold that are not homologous to the query.33 TN5 FNHomolog of the query sequenceNon-homolog of the query sequenceFDR = FP / (FP + TP) = 5/18 = 27.8%
29 Bonferroni vs. FDRBonferroni controls the family-wise error rate; i.e., the probability of at least one false positive among the sequences that score better than the threshold.FDR controls the percentage of false positives among the target sequences that score better than the threshold.
30 Controlling the FDR Order the unadjusted p-values p1 p2 … pm. To control FDR at level α,Reject the null hypothesis for j = 1, …, j*.(Benjamini & Hochberg, 1995)
31 FDR exampleRank (jα)/m p-value…Choose the largest threshold j so that (jα)/m is less than the corresponding p-value.Approximately 5% of the examples above the line are expected to be false positives.
32 Benjamini-Hochberg test Test of 100 uniformly distributed p-values (p-values from non-significant results)P-values as blue dotsSignificance threshold for FDR = 0.2 as red lineAn idealized experiment in which 100 cases, none of which are significant, are tested with the Benjamini-Hochberg procedure, controlling the false discovery rate at 20%. The blue dots are the ranked p-values from the 100 cases, and the red line is the significance threshold established by the Benjamini-Hochberg procedure. None of the cases can be declared significant.
33 Benjamini-Hochberg test Test of 10 low p-values (significant results) mixed with 90 p-values from non-significant resultsP-values as blue dotsSignificance threshold for FDR = 0.2 as red lineEleven cases declared significantDeclare significantAn idealized experiment in which 10 cases with significantly low p-values are mixed with 90 cases that are not significant. All cases can be declared significant up to the highest-ranked case that falls below the significance threshold.
34 SummarySelecting a significance threshold requires evaluating the cost of making a mistake.Bonferroni correction divides the desired p-value threshold by the number of statistical tests performed.The E-value is the expected number of times that the given score would appear in a random database of the given size.The false discovery rate is the percentage of false positives among the target sequences that score better than the threshold.Use Bonferroni correction when you want to avoid making a single mistake; control the false discovery rate when you can tolerate a certain percentage of mistakes.
35 Sample problem #1 Given: Return: ./compute-fdr.py 0.05 pvalues.txt a confidence threshold, anda list of p-valuesReturn:a set of p-values with the specified false discovery rate./compute-fdr.py 0.05 pvalues.txt
36 Sample problem #2Modify your program so that it will work with an arbitrarily large collection of p-values.You may assume that the p-values are given in sorted order.Read the file twice: once to find out how many p-values there are, and a second time to do the actual calculation.