~ubuntu-branches/ubuntu/feisty/ncbi-tools6/feisty

« back to all changes in this revision

Viewing changes to algo/blast/composition_adjustment/unified_pvalues.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2006-07-19 23:28:07 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20060719232807-et3cdmcjgmnyleyx
Tags: 6.1.20060507-3ubuntu1
Re-merge with Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  $Id: unified_pvalues.h,v 1.1 2006/05/03 14:06:10 gertz Exp $
 
2
 * ===========================================================================
 
3
 *
 
4
 *
 
5
 *                            PUBLIC DOMAIN NOTICE
 
6
 *               National Center for Biotechnology Information
 
7
 *
 
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.
 
14
 *
 
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
 
21
 *  purpose.
 
22
 *
 
23
 *  Please cite the author in any work or product based on this material.
 
24
 *
 
25
 * ==========================================================================*/
 
26
 
 
27
/**
 
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
 
32
 *
 
33
 * @author Yi-Kuo Yu, Alejandro Schaffer, Mike Gertz
 
34
 */
 
35
 
 
36
#ifndef __UNIFIED_PVALUES__
 
37
#define __UNIFIED_PVALUES__
 
38
 
 
39
#include <algo/blast/core/blast_export.h>
 
40
 
 
41
#ifdef __cplusplus
 
42
extern "C" {
 
43
#endif
 
44
 
 
45
/** the smallest value of lambda in the table of lambda's empirical
 
46
 * distribution function. */  
 
47
#define COMPO_MIN_LAMBDA       0.034
 
48
 
 
49
 
 
50
/**
 
51
 * Conditionally compute a compositional p-value.
 
52
 *
 
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.
 
58
 *
 
59
 * @return the p-value, or -1 if the p-value should not be used.
 
60
 */
 
61
NCBI_XBLAST_EXPORT
 
62
double Blast_CompositionPvalue(int length1,
 
63
                               int length2,
 
64
                               double lambda,
 
65
                               int function_index);
 
66
 
 
67
/**
 
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.
 
74
 *
 
75
 * @param p_comp  composition p-value
 
76
 * @param p_alignment alignment p-value
 
77
 */
 
78
NCBI_XBLAST_EXPORT
 
79
double Blast_Overall_P_Value(double p_comp,
 
80
                             double p_alignment);
 
81
 
 
82
#ifdef __cplusplus
 
83
}
 
84
#endif
 
85
 
 
86
#endif