~ubuntu-branches/ubuntu/dapper/ncbi-tools6/dapper

« back to all changes in this revision

Viewing changes to algo/blast/core/blast_stat.h

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2006-01-12 18:50:27 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060112185027-88f9xtb35uekr1v7
Tags: 6.1.20051206-1
* New upstream release.
* Temporarily switch to pmake (added to Build-Depends) for upstream's
  makefiles, as GNU make 3.81.b4 gets mysteriously confused when trying
  to build from them (but, oddly, only when invoked from debian/rules).
* Add "new" blastall_old executable to the blast2 package.
* Reshuffle documents slightly, and make sure to register all top-level
  HTML documents with doc-base.
* Loosen libncbi6's dependency on ncbi-data to accommodate binary-only
  NMUs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*  $Id: blast_stat.h,v 1.67 2005/04/27 19:49:17 dondosha Exp $
 
1
/*  $Id: blast_stat.h,v 1.74 2005/09/27 14:43:16 madden Exp $
2
2
 * ===========================================================================
3
3
 *
4
4
 *                            PUBLIC DOMAIN NOTICE
160
160
   Uint1*   ambiguous_res; /**< Array of ambiguous res. (e.g, 'X', 'N')*/
161
161
   Int2     ambig_size, /**< size of array above. FIXME: not needed here? */
162
162
         ambig_occupy;  /**< How many occupied? */
 
163
   Boolean  round_down; /**< Score must be rounded down to nearest even score if odd. */
163
164
} BlastScoreBlk;
164
165
 
165
166
/** 
208
209
Int2
209
210
Blast_ScoreBlkKbpUngappedCalc(EBlastProgramType program, 
210
211
                              BlastScoreBlk* sbp, Uint1* query, 
211
 
                              BlastQueryInfo* query_info);
 
212
                              const BlastQueryInfo* query_info);
212
213
 
213
214
/** This function fills in the BlastScoreBlk structure.  
214
215
 * Tasks are:
253
254
        Int4 gap_extend, Int4 decline_align, const char* matrix_name, 
254
255
        Blast_Message** error_return);
255
256
 
 
257
/** Retrieves Karlin-Altschul parameters from precomputed tables, given the
 
258
 * substitution and gap scores. Gap cost values greater than any of those 
 
259
 * listed in the tables ("greater" meaning that both values are greater than or
 
260
 * equal, and at least one is strictly greater), are treated as infinite, and 
 
261
 * parameters values are copied from the ungapped Karlin block.
 
262
 * @param kbp Allocated Karlin block to fill [in] [out]
 
263
 * @param gap_open Gap openening (existence) cost [in]
 
264
 * @param gap_extend Gap extension cost [in]
 
265
 * @param reward Match reward score [in]
 
266
 * @param penalty Mismatch penalty score [in]
 
267
 * @param kbp_ungap Karlin block with ungapped Karlin-Altschul parameters [in]
 
268
 * @param round_down specifies that the score should be rounded down to nearest even
 
269
 *      score in some cases [in|out]
 
270
 * @param error_return Pointer to error message. [in] [out]
 
271
 */
 
272
Int2
 
273
Blast_KarlinBlkNuclGappedCalc(Blast_KarlinBlk* kbp, Int4 gap_open, 
 
274
                              Int4 gap_extend, Int4 reward, Int4 penalty,
 
275
                              Blast_KarlinBlk* kbp_ungap,
 
276
                              Boolean* round_down,
 
277
                              Blast_Message** error_return);
 
278
 
256
279
 
257
280
/** Calculates the Karlin-Altschul parameters assuming standard residue
258
281
 * compositions for the query and subject sequences. It populates the kbp_ideal
399
422
                           Int4 query_length, Int4 subject_length,
400
423
                           Int8 searchsp_eff, double weight_divisor );
401
424
 
 
425
/** Extract the recommended gap existence and extension values.
 
426
 * Only to be used with protein matrices. 
 
427
 * @param  matrixName name of the matrix [in]
 
428
 * @param gap_existence returns recommended existence cost [in|out]
 
429
 * @param gap_extension returns recommended extension cost [in|out]
 
430
 * @return zero on success 
 
431
 */
 
432
Int2 BLAST_GetProteinGapExistenceExtendParams(const char* matrixName,
 
433
                                       Int4* gap_existence,
 
434
                                       Int4* gap_extension);
 
435
 
 
436
/** Extract the recommended gap existence and extension values.
 
437
 * Only to be used with blastn searches.
 
438
 * @param reward match score [in]
 
439
 * @param penalty mismatch score [in]
 
440
 * @param gap_existence returns recommended existence cost [in|out]
 
441
 * @param gap_extension returns recommended extension cost [in|out]
 
442
 * @return zero on success 
 
443
 */
 
444
Int2 BLAST_GetNucleotideGapExistenceExtendParams(Int4 reward,
 
445
                                       Int4 penalty,
 
446
                                       Int4* gap_existence,
 
447
                                       Int4* gap_extension);
 
448
 
402
449
/** Extract the alpha and beta settings for this matrixName, and these
403
450
 *  gap open and gap extension costs
404
451
 * @param matrixName name of the matrix used [in]
407
454
 * @param gapped TRUE if a gapped search [in]
408
455
 * @param gap_open existence cost of a gap [in]
409
456
 * @param gap_extend extension cost of a gap [in]
 
457
 * @param kbp_ungapped Karlin block with ungapped values of the parameters [in]
410
458
*/
411
459
void BLAST_GetAlphaBeta (const char* matrixName, double *alpha,
412
 
                    double *beta, Boolean gapped, Int4 gap_open, Int4 gap_extend);
 
460
                         double *beta, Boolean gapped, Int4 gap_open, 
 
461
                         Int4 gap_extend, const Blast_KarlinBlk* kbp_ungapped);
413
462
 
 
463
/** Extract the alpha and beta settings for these substitution and gap scores. 
 
464
 * If substitution or gap costs are not found in the tables, assume an ungapped
 
465
 * search. Then alpha is computed using the formula Alpha = Lambda/H, and beta
 
466
 * is equal to 0 except for some special cases.
 
467
 * @param reward Match reward score [in]
 
468
 * @param penalty Mismatch penalty score [in]
 
469
 * @param gap_open Gap opening (existence) cost [in]
 
470
 * @param gap_extend Gap extension cost [in]
 
471
 * @param kbp Karlin block containing already computed Lambda, K and H 
 
472
 *            parameters.
 
473
 * @param gapped_calculation Is this a gapped search? [in]
 
474
 * @param alpha Alpha parameter for this scoring system [out]
 
475
 * @param beta Beta parameter for this scoring system [out]
 
476
 */
 
477
Int2 Blast_GetNuclAlphaBeta(Int4 reward, Int4 penalty, Int4 gap_open, 
 
478
                            Int4 gap_extend, Blast_KarlinBlk* kbp,
 
479
                            Boolean gapped_calculation,
 
480
                            double *alpha, double *beta);
414
481
 
415
482
/** Rescale the PSSM, using composition-based statistics, for use
416
483
 *  with RPS BLAST. This function produces a PSSM for a single RPS DB