1
/* $Id: unified_pvalues.h,v 1.1 2006/05/03 14:06:10 gertz Exp $
2
* ===========================================================================
6
* National Center for Biotechnology Information
8
* This software/database is a "United States Government Work" under the
9
* terms of the United States Copyright Act. It was written as part of
10
* the author's official duties as a United States Government employee and
11
* thus cannot be copyrighted. This software/database is freely available
12
* to the public for use. The National Library of Medicine and the U.S.
13
* Government have not placed any restriction on its use or reproduction.
15
* Although all reasonable efforts have been taken to ensure the accuracy
16
* and reliability of the software and data, the NLM and the U.S.
17
* Government do not and cannot warrant the performance or results that
18
* may be obtained by using this software or data. The NLM and the U.S.
19
* Government disclaim all warranties, express or implied, including
20
* warranties of performance, merchantability or fitness for any particular
23
* Please cite the author in any work or product based on this material.
25
* ==========================================================================*/
28
* @file unified_pvalues.h
29
* Headers for computing a "composition" p-value of a match, and for
30
* computing a unified p-value combining the customary alignment
31
* p-value and the new composition p-value
33
* @author Yi-Kuo Yu, Alejandro Schaffer, Mike Gertz
36
#ifndef __UNIFIED_PVALUES__
37
#define __UNIFIED_PVALUES__
39
#include <algo/blast/core/blast_export.h>
45
/** the smallest value of lambda in the table of lambda's empirical
46
* distribution function. */
47
#define COMPO_MIN_LAMBDA 0.034
51
* Conditionally compute a compositional p-value.
53
* @param length1 length of the first sequence
54
* @param length2 length of the second sequence
55
* @param lambda statistical parameter lambda estimated for this pair
56
* @param function_index index of test to decide whether to report
57
* a composition p_value.
59
* @return the p-value, or -1 if the p-value should not be used.
62
double Blast_CompositionPvalue(int length1,
68
* This function implements the method of Fisher, R. C. Elston (1991)
69
* Biometrical J. 33:339-345 and T. L. Bailey and M. Gribskov (1998)
70
* Bioinformatics 14:48-54. to combine to p-values into a unified
71
* p-value. The input p-values are p_comp and p_alignment. The value
72
* returned, call it p_return, is the area in the unit square under
73
* the curve y = p_comp*p_align.
75
* @param p_comp composition p-value
76
* @param p_alignment alignment p-value
79
double Blast_Overall_P_Value(double p_comp,