A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/blast__stat_8h.html below:

NCBI C++ ToolKit: include/algo/blast/core/blast_stat.h File Reference

Definitions and prototypes used by blast_stat.c to calculate BLAST statistics. More...

Go to the source code of this file.

Go to the SVN repository for this file.

SPsiBlastScoreMatrixSPsiBlastScoreMatrixNew (size_t ncols)   Allocates a new SPsiBlastScoreMatrix structure of dimensions ncols by BLASTAA_SIZE. More...
  SPsiBlastScoreMatrixSPsiBlastScoreMatrixFree (SPsiBlastScoreMatrix *matrix)   Deallocates a SPsiBlastScoreMatrix structure. More...
  SBlastScoreMatrixSBlastScoreMatrixFree (SBlastScoreMatrix *matrix)   Deallocates SBlastScoreMatrix structure. More...
  SBlastScoreMatrixSBlastScoreMatrixNew (size_t ncols, size_t nrows)   Allocates a new SBlastScoreMatrix structure of the specified dimensions. More...
  SCompressedAlphabetSCompressedAlphabetNew (BlastScoreBlk *sbp, Int4 compressed_alphabet_size, double scale_factor)   Allocate a new compressed alphabet and score matrix. More...
  SCompressedAlphabetSCompressedAlphabetFree (SCompressedAlphabet *alphabet)   Free a compressed alphabet and score matrix. More...
  int  BlastScoreBlkCheck (BlastScoreBlk *sbp)   Check that score blk is valid, returns zero if it is. More...
  BlastScoreBlkBlastScoreBlkNew (Uint1 alphabet, Int4 number_of_contexts)   Allocates and initializes BlastScoreBlk. More...
  BlastScoreBlkBlastScoreBlkFree (BlastScoreBlk *sbp)   Deallocates BlastScoreBlk as well as all associated structures. More...
  Int2  BLAST_ScoreSetAmbigRes (BlastScoreBlk *sbp, char ambiguous_res)   Set the ambiguous residue (e.g, 'N', 'X') in the BlastScoreBlk*. More...
  Int2  Blast_ScoreBlkKbpUngappedCalc (EBlastProgramType program, BlastScoreBlk *sbp, Uint1 *query, const BlastQueryInfo *query_info, Blast_Message **blast_message)   Calculate and fill the ungapped Karlin-Altschul parameters in the BlastScoreBlk structure (fields kbp_std, kbp_psi, and kbp of that structure). More...
  Int2  Blast_ScoreBlkMatrixFill (BlastScoreBlk *sbp, GET_MATRIX_PATH get_path)   This function fills in the BlastScoreBlk structure. More...
  Blast_KarlinBlkBlast_KarlinBlkNew (void)   Callocs a Blast_KarlinBlk. More...
  Int2  Blast_KarlinBlkCopy (Blast_KarlinBlk *kbp_to, Blast_KarlinBlk *kbp_from)   Copies contents of one Karlin block to another. More...
  Blast_KarlinBlkBlast_KarlinBlkFree (Blast_KarlinBlk *kbp)   Deallocates the KarlinBlk. More...
  Int2  Blast_KarlinBlkGappedCalc (Blast_KarlinBlk *kbp, Int4 gap_open, Int4 gap_extend, const char *matrix_name, Blast_Message **error_return)   Fills in lambda, H, and K values, as calculated by Stephen Altschul in Methods in Enzy. More...
  Int2  Blast_KarlinBlkNuclGappedCalc (Blast_KarlinBlk *kbp, Int4 gap_open, Int4 gap_extend, Int4 reward, Int4 penalty, Blast_KarlinBlk *kbp_ungap, Boolean *round_down, Blast_Message **error_return)   Retrieves Karlin-Altschul parameters from precomputed tables, given the substitution and gap scores. More...
  Int2  Blast_ScoreBlkKbpIdealCalc (BlastScoreBlk *sbp)   Calculates the Karlin-Altschul parameters assuming standard residue compositions for the query and subject sequences. More...
  Int2  Blast_KarlinBlkGappedLoadFromTables (Blast_KarlinBlk *kbp, Int4 gap_open, Int4 gap_extend, const char *matrix_name, Boolean standard_only)   Attempts to fill KarlinBlk for given gap opening, extensions etc. More...
  Int2  Blast_GumbelBlkCalc (Blast_GumbelBlk *gbp, Int4 gap_open, Int4 gap_extend, const char *matrix_name, Blast_Message **error_return)   Fills in gumbel parameters to estimate p-value using FSC. More...
  Int2  Blast_GumbelBlkLoadFromTables (Blast_GumbelBlk *gbp, Int4 gap_open, Int4 gap_extend, const char *matrix_name)   Attempts to fill GumbelBlk for given gap opening, extensions etc. More...
  char *  BLAST_PrintMatrixMessage (const char *matrix, Boolean standard_only)   Prints a messages about the allowed matrices, BlastKarlinBlkGappedFill should return 1 before this is called. More...
  char *  BLAST_PrintAllowedValues (const char *matrix, Int4 gap_open, Int4 gap_extend)   Prints a messages about the allowed open etc values for the given matrix, BlastKarlinBlkGappedFill should return 2 before this is called. More...
  double  Blast_KarlinLambdaNR (Blast_ScoreFreq *sfp, double initialLambdaGuess)   Calculates the parameter Lambda given an initial guess for its value. More...
  double  BLAST_KarlinStoE_simple (Int4 S, Blast_KarlinBlk *kbp, Int8 searchsp)   Calculates the Expect value based upon the search space and some Karlin-Altschul parameters. More...
  double  BLAST_SpougeStoE (Int4 S, Blast_KarlinBlk *kbp, Blast_GumbelBlk *gbp, Int4 qlen, Int4 slen)   Calculates the Expect value based upon the Spouge's FSC method. More...
  Int4  BLAST_SpougeEtoS (double E, Blast_KarlinBlk *kbp, Blast_GumbelBlk *gbp, Int4 qlen, Int4 slen)   Estimate the score for a specified expect value. More...
  double  BLAST_KarlinPtoE (double p)   Convert a P-value to an E-value. More...
  double  BLAST_KarlinEtoP (double x)   Convert an E-value to a P-value. More...
  double  BLAST_GapDecayDivisor (double decayrate, unsigned nsegs)   Compute a divisor used to weight the evalue of a collection of "nsegs" distinct alignments. More...
  Int2  BLAST_Cutoffs (Int4 *S, double *E, Blast_KarlinBlk *kbp, Int8 searchsp, Boolean dodecay, double gap_decay_rate)   Calculate the cutoff score from the expected number of HSPs or vice versa. More...
  double  BLAST_SmallGapSumE (Int4 start_points, Int2 num, double xsum, Int4 query_length, Int4 subject_length, Int8 searchsp_eff, double weight_divisor)   Calculates the e-value for alignments with "small" gaps (typically under fifty residues/basepairs) following ideas of Stephen Altschul's. More...
  double  BLAST_UnevenGapSumE (Int4 query_start_points, Int4 subject_start_points, Int2 num, double xsum, Int4 query_length, Int4 subject_length, Int8 searchsp_eff, double weight_divisor)   Calculates the e-value of a collection multiple distinct alignments with asymmetric gaps between the alignments. More...
  double  BLAST_LargeGapSumE (Int2 num, double xsum, Int4 query_length, Int4 subject_length, Int8 searchsp_eff, double weight_divisor)   Calculates the e-value if a collection of distinct alignments with arbitrarily large gaps between the alignments. More...
  Int2  BLAST_GetProteinGapExistenceExtendParams (const char *matrixName, Int4 *gap_existence, Int4 *gap_extension)   Extract the recommended gap existence and extension values. More...
  Int2  BLAST_GetNucleotideGapExistenceExtendParams (Int4 reward, Int4 penalty, Int4 *gap_existence, Int4 *gap_extension)   Extract the recommended gap existence and extension values. More...
  Boolean  BLAST_CheckRewardPenaltyScores (Int4 reward, Int4 penalty)   Check the validity of the reward and penalty scores. More...
  void  BLAST_GetAlphaBeta (const char *matrixName, double *alpha, double *beta, Boolean gapped, Int4 gap_open, Int4 gap_extend, const Blast_KarlinBlk *kbp_ungapped)   Extract the alpha and beta settings for this matrixName, and these gap open and gap extension costs. More...
  Int2  Blast_GetNuclAlphaBeta (Int4 reward, Int4 penalty, Int4 gap_open, Int4 gap_extend, Blast_KarlinBlk *kbp, Boolean gapped_calculation, double *alpha, double *beta)   Extract the alpha and beta settings for these substitution and gap scores. More...
  Int4 **  RPSRescalePssm (double scalingFactor, Int4 rps_query_length, const Uint1 *rps_query_seq, Int4 db_seq_length, Int4 **posMatrix, BlastScoreBlk *sbp)   Rescale the PSSM, using composition-based statistics, for use with RPS BLAST. More...
  Int4  BLAST_ComputeLengthAdjustment (double K, double logK, double alpha_d_lambda, double beta, Int4 query_length, Int8 db_length, Int4 db_num_seqs, Int4 *length_adjustment)   Computes the adjustment to the lengths of the query and database sequences that is used to compensate for edge effects when computing evalues. More...
  Blast_ResFreqBlast_ResFreqNew (const BlastScoreBlk *sbp)   Allocates a new Blast_ResFreq structure and fills in the prob element based upon the contents of sbp. More...
  Blast_ResFreqBlast_ResFreqFree (Blast_ResFreq *rfp)   Deallocates Blast_ResFreq and prob0 element. More...
  Int2  Blast_ResFreqStdComp (const BlastScoreBlk *sbp, Blast_ResFreq *rfp)   Calculates residues frequencies given a standard distribution. More...
  Blast_ScoreFreqBlast_ScoreFreqNew (Int4 score_min, Int4 score_max)   Creates a new structure to keep track of score frequencies for a scoring system. More...
  Blast_ScoreFreqBlast_ScoreFreqFree (Blast_ScoreFreq *sfp)   Deallocates the score frequencies structure. More...
  Int2  Blast_GetStdAlphabet (Uint1 alphabet_code, Uint1 *residues, Uint4 residue_size)   Fills a buffer with the 'standard' alphabet (given by STD_AMINO_ACID_FREQS[index].ch). More...
  Int2  Blast_KarlinBlkUngappedCalc (Blast_KarlinBlk *kbp, Blast_ScoreFreq *sfp)   Computes the parameters lambda, H K for use in calculating the statistical significance of high-scoring segments or subalignments (see comment on blast_stat.c for more details). More...
  void  Blast_FillResidueProbability (const Uint1 *sequence, Int4 length, double *resProb)   Given a sequence of 'length' amino acid residues, compute the probability of each residue and put that in the array resProb Excludes ambiguity characters. More...
  Int2  BlastScoreBlkNuclMatrixCreate (BlastScoreBlk *sbp)   Fill in the matrix for blastn using the penaly and rewards The query sequence alphabet is blastna, the subject sequence is ncbi2na. More...
  SNCBIPackedScoreMatrixBlastScoreBlkGetCompiledInMatrix (const char *name)   Returns a pointer to the static compiled in version of the matrix. More...
 

Definitions and prototypes used by blast_stat.c to calculate BLAST statistics.

Definition in file blast_stat.h.

◆ BLAST_MATRIX_BEST #define BLAST_MATRIX_BEST   2

This is the best value, only one per matrix.

Definition at line 55 of file blast_stat.h.

◆ BLAST_MATRIX_NOMINAL #define BLAST_MATRIX_NOMINAL   0

Defines for the matrix 'preferences' (as specified by S.

Altschul). Used in arrays such as blosum45_prefs in blast_stat.c acceptable values, not recommended.

Definition at line 53 of file blast_stat.h.

◆ BLAST_MATRIX_PREFERRED #define BLAST_MATRIX_PREFERRED   1

These value are preferred over others.

Definition at line 54 of file blast_stat.h.

◆ BLAST_SCORE_MAX

maximum allowed score (for one letter comparison).

Definition at line 122 of file blast_stat.h.

◆ BLAST_SCORE_MIN

minimum allowed score (for one letter comparison).

Definition at line 121 of file blast_stat.h.

◆ BLASTMAT_DIR #define BLASTMAT_DIR   "/usr/ncbi/blast/matrix"

Default location for blast databases.

Definition at line 58 of file blast_stat.h.

◆ Blast_GumbelBlk

Structure to hold the Gumbel parameters (for FSC).

◆ Blast_KarlinBlk

Structure to hold the Karlin-Altschul parameters.

◆ Blast_ResFreq

Stores the letter frequency of a sequence or database.

◆ Blast_ScoreFreq

Holds score frequencies used in calculation of Karlin-Altschul parameters for an ungapped search.

◆ BlastScoreBlk

Structure used for scoring calculations.

◆ erfc_table

Tabulated results for faster erfc(x) lookup.

erfc(x) = 1/2 + 1/sqrt(2*pi) * \int_0^x { exp(-y^2/2)} dy erfc(-\inf) = 0.0 erfc(+\inf) = 1.0 The erfc(x) is tabulated in p with step h, starting from a to b

◆ GET_MATRIX_PATH

callback to resolve the path to blast score matrices

Definition at line 61 of file blast_stat.h.

◆ SBlastScoreMatrix

Scoring matrix used in BLAST.

◆ SCompressedAlphabet

Scoring matrix data used for compressed protein alphabets.

◆ SPsiBlastScoreMatrix

Scoring matrix data used in PSI-BLAST.

◆ BLAST_CheckRewardPenaltyScores() ◆ BLAST_ComputeLengthAdjustment() Int4 BLAST_ComputeLengthAdjustment ( double  K, double  logK, double  alpha_d_lambda, double  beta, Int4  query_length, Int8  db_length, Int4  db_num_seqs, Int4length_adjustment  )

Computes the adjustment to the lengths of the query and database sequences that is used to compensate for edge effects when computing evalues.

The length adjustment is an integer-valued approximation to the fixed point of the function

f(ell) = beta + (alpha/lambda) * (log K + log((m - ell)*(n - N ell)))

where m is the query length n is the length of the database and N is the number of sequences in the database. The values beta, alpha, lambda and K are statistical, Karlin-Altschul parameters.

The value of the length adjustment computed by this routine, A, will always be an integer smaller than the fixed point of f(ell). Usually, it will be the largest such integer. However, the computed length adjustment, A, will also be so small that

K * (m - A) * (n - N * A) > MAX(m,n).

Moreover, an iterative method is used to compute A, and under unusual circumstances the iterative method may not converge.

Parameters
K the statistical parameter K [in] logK the natural logarithm of K [in] alpha_d_lambda the ratio of the statistical parameters alpha and lambda (for ungapped alignments, the value 1/H should be used) [in] beta the statistical parameter beta (for ungapped alignments, beta == 0) [in] query_length the length of the query sequence [in] db_length the length of the database [in] db_num_seqs the number of sequences in the database [in] length_adjustment the computed value of the length adjustment [out]
Returns
0 if length_adjustment is known to be the largest integer less than the fixed point of f(ell); 1 otherwise.

The length adjustment is an integer-valued approximation to the fixed point of the function

f(ell) = beta + (alpha/lambda) * (log K + log((m - ell)*(n - N ell)))

where m is the query length n is the length of the database and N is the number of sequences in the database. The values beta, alpha, lambda and K are statistical, Karlin-Altschul parameters.

The value of the length adjustment computed by this routine, A, will always be an integer smaller than the fixed point of f(ell). Usually, it will be the largest such integer. However, the computed length adjustment, A, will also be so small that

K * (m - A) * (n - N * A) > MAX(m,n).

Moreover, an iterative method is used to compute A, and under unusual circumstances the iterative method may not converge.

Parameters
K the statistical parameter K logK the natural logarithm of K alpha_d_lambda the ratio of the statistical parameters alpha and lambda (for ungapped alignments, the value 1/H should be used) beta the statistical parameter beta (for ungapped alignments, beta == 0) query_length the length of the query sequence db_length the length of the database db_num_seqs the number of sequences in the database length_adjustment the computed value of the length adjustment [out]
Returns
0 if length_adjustment is known to be the largest integer less than the fixed point of f(ell); 1 otherwise.

Definition at line 5041 of file blast_stat.c.

References a, FALSE, i, log, MAX, n, N, and TRUE.

Referenced by BLAST_CalcEffLengths().

◆ BLAST_Cutoffs()

Calculate the cutoff score from the expected number of HSPs or vice versa.

Parameters
S The calculated score [in] [out] E The calculated e-value [in] [out] kbp The Karlin-Altschul statistical parameters [in] searchsp The effective search space [in] dodecay Use gap decay feature? [in] gap_decay_rate Gap decay rate to use, if dodecay is set [in]

Definition at line 4090 of file blast_stat.c.

References BLAST_GapDecayDivisor(), BLAST_KarlinStoE_simple(), BlastKarlinEtoS_simple(), E, FALSE, Blast_KarlinBlk::H, Blast_KarlinBlk::K, Blast_KarlinBlk::Lambda, S, and TRUE.

Referenced by BlastHitSavingParametersUpdate(), BlastInitialWordParametersUpdate(), and BOOST_AUTO_TEST_CASE().

◆ Blast_FillResidueProbability() void Blast_FillResidueProbability ( const Uint1sequence, Int4  length, double *  resProb  )

Given a sequence of 'length' amino acid residues, compute the probability of each residue and put that in the array resProb Excludes ambiguity characters.

Parameters
sequence the sequence to be computed upon [in] length the length of the sequence [in] resProb the object to be filled in [in|out]

Definition at line 4577 of file blast_stat.c.

References AMINOACID_TO_NCBISTDAA, BLASTAA_SIZE, and i.

Referenced by RPSRescalePssm().

◆ BLAST_GapDecayDivisor() double BLAST_GapDecayDivisor ( double  decayrate, unsigned  nsegs  )

Compute a divisor used to weight the evalue of a collection of "nsegs" distinct alignments.

These divisors are used to compensate for the effect of choosing the best among multiple collections of alignments. See

Stephen F. Altschul. Evaluating the statitical significance of multiple distinct local alignments. In Suhai, editior, Theoretical and Computational Methods in Genome Research, pages 1-14. Plenum Press, New York, 1997.

The "decayrate" parameter of this routine is a value in the interval (0,1). Typical values of decayrate are .1 and .5.

Parameters
decayrate adjusts for (multiple) tests of number of HSP sum groups [in] nsegs the number of HSPs in the sum group [in]
Returns
divisor used to compensate for multiple tests

Definition at line 4079 of file blast_stat.c.

References BLAST_Powi().

Referenced by BLAST_Cutoffs(), Blast_HSPListGetEvalues(), s_BlastEvenGapLinkHSPs(), and s_SumHSPEvalue().

◆ BLAST_GetAlphaBeta() ◆ Blast_GetNuclAlphaBeta()

Extract the alpha and beta settings for these substitution and gap scores.

If substitution or gap costs are not found in the tables, assume an ungapped search. Then alpha is computed using the formula Alpha = Lambda/H, and beta is equal to 0 except for some special cases.

Parameters
reward Match reward score [in] penalty Mismatch penalty score [in] gap_open Gap opening (existence) cost [in] gap_extend Gap extension cost [in] kbp Karlin block containing already computed Lambda, K and H parameters. gapped_calculation Is this a gapped search? [in] alpha Alpha parameter for this scoring system [out] beta Beta parameter for this scoring system [out]

Definition at line 3965 of file blast_stat.c.

References ASSERT, FALSE, Blast_KarlinBlk::H, Blast_KarlinBlk::Lambda, NULL, s_GetNuclValuesArray(), s_GetUngappedBeta(), sfree, and TRUE.

Referenced by BLAST_CalcEffLengths(), and BOOST_AUTO_TEST_CASE().

◆ BLAST_GetNucleotideGapExistenceExtendParams() Int2 BLAST_GetNucleotideGapExistenceExtendParams ( Int4  reward, Int4  penalty, Int4gap_existence, Int4gap_extension  )

Extract the recommended gap existence and extension values.

Only to be used with blastn searches.

Parameters
reward match score [in] penalty mismatch score [in] gap_existence returns recommended existence cost [in|out] gap_extension returns recommended extension cost [in|out]
Returns
zero on success

Definition at line 3402 of file blast_stat.c.

References FALSE, NULL, s_GetNuclValuesArray(), sfree, and TRUE.

Referenced by BOOST_AUTO_TEST_CASE().

◆ BLAST_GetProteinGapExistenceExtendParams() Int2 BLAST_GetProteinGapExistenceExtendParams ( const char *  matrixName, Int4gap_existence, Int4gap_extension  ) ◆ Blast_GetStdAlphabet() ◆ Blast_GumbelBlkCalc()

Fills in gumbel parameters to estimate p-value using FSC.

Parameters
gbp object to be filled in [in|out] gap_open cost of gap existence [in] gap_extend cost to extend a gap one letter [in] matrix_name name of the matrix to be used [in] error_return filled in with error message if needed [out]
Returns
zero on success

Definition at line 3652 of file blast_stat.c.

References Blast_GumbelBlkLoadFromTables(), Blast_MessageWrite(), BlastKarlinReportAllowedValues(), BlastLoadMatrixValues(), BlastMatrixValuesDestruct(), buffer, eBlastSevError, FALSE, head, kBlastMessageNoContext, MatrixInfo::name, ListNode::next, and ListNode::ptr.

Referenced by Blast_ScoreBlkKbpGappedCalc(), and BOOST_AUTO_TEST_CASE().

◆ Blast_GumbelBlkLoadFromTables()

Attempts to fill GumbelBlk for given gap opening, extensions etc.

Parameters
gbp object to be filled in [in|out] gap_open gap existence cost [in] gap_extend gap extension cost [in] matrix_name name of the matrix used [in]
Returns
-1 if matrix_name is NULL; 1 if matrix not found 2 if matrix found, but open, extend etc. values not supported.

Definition at line 3696 of file blast_stat.c.

References Blast_GumbelBlk::a, Blast_GumbelBlk::a_un, Blast_GumbelBlk::Alpha, Blast_GumbelBlk::Alpha_un, Blast_GumbelBlk::b, Blast_GumbelBlk::Beta, BLAST_Nint(), BlastLoadMatrixValues(), BlastMatrixValuesDestruct(), Blast_GumbelBlk::C, FALSE, Blast_GumbelBlk::filled, Blast_GumbelBlk::G, head, Blast_GumbelBlk::Lambda, MatrixInfo::max_number_values, MatrixInfo::name, ListNode::next, NULL, ListNode::ptr, Blast_GumbelBlk::Sigma, strcasecmp, Blast_GumbelBlk::Tau, TRUE, and MatrixInfo::values.

Referenced by Blast_GumbelBlkCalc().

◆ Blast_KarlinBlkCopy()

Copies contents of one Karlin block to another.

Both must be allocated before this function is called.

Parameters
kbp_to Karlin block to copy values to [in] [out] kbp_from Karlin block to copy values from [in]
Returns
0 on success; -1 if either argument is NULL on input.

Definition at line 2871 of file blast_stat.c.

References Blast_KarlinBlk::H, Blast_KarlinBlk::K, Blast_KarlinBlk::Lambda, Blast_KarlinBlk::logK, and Blast_KarlinBlk::paramC.

Referenced by Blast_KarlinBlkNuclGappedCalc(), Blast_ScoreBlkKbpGappedCalc(), Blast_ScoreBlkKbpUngappedCalc(), BOOST_AUTO_TEST_CASE(), CBlastAncillaryData::do_copy(), s_BlastScoreBlk_Copy(), s_InitializeKarlinBlk(), s_JumperScoreBlkFill(), s_RecordInitialSearch(), s_RestoreSearch(), and s_RPSComputeTraceback().

◆ Blast_KarlinBlkFree() ◆ Blast_KarlinBlkGappedCalc()

Fills in lambda, H, and K values, as calculated by Stephen Altschul in Methods in Enzy.

(vol 266, page 474).

Parameters
kbp object to be filled in [in|out] gap_open cost of gap existence [in] gap_extend cost to extend a gap one letter [in] matrix_name name of the matrix to be used [in] error_return filled in with error message if needed [out]
Returns
zero on success

Definition at line 3527 of file blast_stat.c.

References Blast_KarlinBlkGappedLoadFromTables(), Blast_MessageWrite(), BlastKarlinReportAllowedValues(), BlastLoadMatrixValues(), BlastMatrixValuesDestruct(), buffer, eBlastSevError, FALSE, head, kBlastMessageNoContext, MatrixInfo::name, ListNode::next, and ListNode::ptr.

Referenced by Blast_ScoreBlkKbpGappedCalc(), BOOST_AUTO_TEST_CASE(), and CScoreBuilder::x_Initialize().

◆ Blast_KarlinBlkGappedLoadFromTables()

Attempts to fill KarlinBlk for given gap opening, extensions etc.

Parameters
kbp object to be filled in [in|out] gap_open gap existence cost [in] gap_extend gap extension cost [in] matrix_name name of the matrix used [in] standard_only If true, include only the standard blosum and pam matrices [in]
Returns
-1 if matrix_name is NULL; 1 if matrix not found 2 if matrix found, but open, extend etc. values not supported.

Definition at line 3577 of file blast_stat.c.

References BLAST_Nint(), BlastLoadMatrixValues(), BlastMatrixValuesDestruct(), FALSE, Blast_KarlinBlk::H, head, Blast_KarlinBlk::K, Blast_KarlinBlk::Lambda, log, Blast_KarlinBlk::logK, MatrixInfo::max_number_values, MatrixInfo::name, ListNode::next, NULL, ListNode::ptr, strcasecmp, TRUE, and MatrixInfo::values.

Referenced by Blast_KarlinBlkGappedCalc(), BlastScoringOptionsValidate(), and CMultiAligner::x_ComputeTree().

◆ Blast_KarlinBlkNew()

Callocs a Blast_KarlinBlk.

Returns
pointer to the Blast_KarlinBlk

Definition at line 2861 of file blast_stat.c.

References calloc().

Referenced by Blast_ScoreBlkKbpGappedCalc(), Blast_ScoreBlkKbpIdealCalc(), Blast_ScoreBlkKbpUngappedCalc(), BOOST_AUTO_TEST_CASE(), CBlastAncillaryData::CBlastAncillaryData(), CBlastAncillaryData::do_copy(), MakeSomeInvalidKBP(), MakeSomeValidKBP(), s_BlastScoreBlk_Copy(), s_FillScoreBlkWithBadKbp(), s_InitializeKarlinBlk(), s_JumperScoreBlkFill(), s_PHIScoreBlkFill(), s_RecordInitialSearch(), s_RPSComputeTraceback(), SPsiBlastScoreMatrixNew(), and CScoreBuilder::x_Initialize().

◆ Blast_KarlinBlkNuclGappedCalc()

Retrieves Karlin-Altschul parameters from precomputed tables, given the substitution and gap scores.

Gap cost values greater than any of those listed in the tables ("greater" meaning that both values are greater than or equal, and at least one is strictly greater), are treated as infinite, and parameters values are copied from the ungapped Karlin block.

Parameters
kbp Allocated Karlin block to fill [in] [out] gap_open Gap openening (existence) cost [in] gap_extend Gap extension cost [in] reward Match reward score [in] penalty Mismatch penalty score [in] kbp_ungap Karlin block with ungapped Karlin-Altschul parameters [in] round_down specifies that the score should be rounded down to nearest even score in some cases [in|out] error_return Pointer to error message. [in] [out]

Definition at line 3846 of file blast_stat.c.

References ASSERT, Blast_KarlinBlkCopy(), Blast_MessageWrite(), buffer, eBlastSevError, Blast_KarlinBlk::H, i, Blast_KarlinBlk::K, kBlastMessageNoContext, Blast_KarlinBlk::Lambda, len, log, Blast_KarlinBlk::logK, NULL, s_GetNuclValuesArray(), and sfree.

Referenced by Blast_ScoreBlkKbpGappedCalc(), BOOST_AUTO_TEST_CASE(), s_JumperScoreBlkFill(), and CScoreBuilder::x_Initialize().

◆ Blast_KarlinBlkUngappedCalc()

Computes the parameters lambda, H K for use in calculating the statistical significance of high-scoring segments or subalignments (see comment on blast_stat.c for more details).

Parameters
kbp object containing Lambda, H, and K as well as scoring information [in|out] sfp array of probabilities for all scores [in]
Returns
zero on success, 1 on error.

Definition at line 2699 of file blast_stat.c.

References BLAST_KARLIN_LAMBDA0_DEFAULT, Blast_KarlinLambdaNR(), BlastKarlinLHtoK(), BlastKarlinLtoH(), Blast_KarlinBlk::H, Blast_KarlinBlk::K, Blast_KarlinBlk::Lambda, log, Blast_KarlinBlk::logK, and NULL.

Referenced by _PSIUpdateLambdaK(), Blast_ScoreBlkKbpIdealCalc(), Blast_ScoreBlkKbpUngappedCalc(), and BOOST_AUTO_TEST_CASE().

◆ BLAST_KarlinEtoP() double BLAST_KarlinEtoP ( double  x )

Convert an E-value to a P-value.

E-values and P-values may either represent statistics of a database search or represent statistics on the two sequences being compared. If given a database E-value, this routine will return a database P-value; if given a pairwise E-value, it will return a pairwise P-value.

In the context of a database search, the available E-value is typically a database E-value, whereas the desired P-value is a pairwise P-value. When this is the case, the E-value should be divided by the effective length of the database and multiplied by the effective length of the subject, before BLAST_KarlinEtoP is called.

Parameters
x the expect value to be converted [in]
Returns
the corresponding p-value.

Definition at line 4189 of file blast_stat.c.

References BLAST_Expm1().

Referenced by s_AdjustEvaluesForComposition().

◆ Blast_KarlinLambdaNR() double Blast_KarlinLambdaNR ( Blast_ScoreFreqsfp, double  initialLambdaGuess  )

Calculates the parameter Lambda given an initial guess for its value.

Definition at line 2567 of file blast_stat.c.

References BLAST_Gcd(), BLAST_KARLIN_LAMBDA_ACCURACY_DEFAULT, BLAST_KARLIN_LAMBDA_ITER_DEFAULT, BlastScoreChk(), i, NlmKarlinLambdaNR(), Blast_ScoreFreq::obs_max, Blast_ScoreFreq::obs_min, Blast_ScoreFreq::score_avg, and Blast_ScoreFreq::sprob.

Referenced by Blast_KarlinBlkUngappedCalc(), impalaScaleMatrix(), RPSRescalePssm(), and s_CalcLambda().

◆ BLAST_KarlinPtoE() double BLAST_KarlinPtoE ( double  p )

Convert a P-value to an E-value.

P-values and E-values may either represent statistics of a database search or represent statistics on the two sequences being compared. If given a database P-value, this routine will return a database E-value; if given a pairwise P-value, it will return a pairwise E-value.

In the context of a database search, the available P-value is often a pairwise P-value, whereas the desired E-value is a database E-value. When this it the case, the value returned by this routine should be multiplied by the effective length of the database and divided by the effective length of the subject.

Parameters
p the P-value to be converted [in]
Returns
the corresponding expect value.

Definition at line 4175 of file blast_stat.c.

References BLAST_Log1p(), INT4_MAX, and INT4_MIN.

Referenced by BLAST_LargeGapSumE(), BLAST_SmallGapSumE(), BLAST_UnevenGapSumE(), and s_AdjustEvaluesForComposition().

◆ BLAST_KarlinStoE_simple() ◆ BLAST_LargeGapSumE() double BLAST_LargeGapSumE ( Int2  num, double  xsum, Int4  query_length, Int4  subject_length, Int8  searchsp_eff, double  weight_divisor  )

Calculates the e-value if a collection of distinct alignments with arbitrarily large gaps between the alignments.

Parameters
num number of distinct alignments in the collection [in] xsum the sum of the scores of these alignments each individually normalized using an appropriate value of Lambda and logK [in] query_length effective length of query sequence [in] subject_length effective length of subject sequence [in] searchsp_eff effective size of the search space [in] weight_divisor a divisor used to weight the e-value when multiple collections of alignments are being considered by the calling routine [in]
Returns
sum expect value.

Definition at line 4532 of file blast_stat.c.

References BLAST_KarlinPtoE(), BLAST_LnFactorial(), INT4_MAX, log, and s_BlastSumP().

Referenced by s_BlastEvenGapLinkHSPs().

◆ BLAST_PrintAllowedValues() char* BLAST_PrintAllowedValues ( const char *  matrix, Int4  gap_open, Int4  gap_extend  )

Prints a messages about the allowed open etc values for the given matrix, BlastKarlinBlkGappedFill should return 2 before this is called.

Parameters
matrix name of the matrix [in] gap_open gap existence cost [in] gap_extend cost to extend a gap by one [in]
Returns
message

Definition at line 3792 of file blast_stat.c.

References BLAST_Nint(), BlastLoadMatrixValues(), BlastMatrixValuesDestruct(), BUF_SZ_2048, buffer, calloc(), FALSE, head, INT2_MAX, MatrixInfo::max_number_values, MatrixInfo::name, ListNode::next, NULL, ListNode::ptr, strcasecmp, TRUE, and MatrixInfo::values.

Referenced by BlastScoringOptionsValidate().

◆ BLAST_PrintMatrixMessage() char* BLAST_PrintMatrixMessage ( const char *  matrix, Boolean  standard_only  )

Prints a messages about the allowed matrices, BlastKarlinBlkGappedFill should return 1 before this is called.

Parameters
matrix the matrix to print a message about [in] standard_only,If true, include only the standad blosum and pam matrices [in]
Returns
the message

Definition at line 3760 of file blast_stat.c.

References BlastLoadMatrixValues(), BlastMatrixValuesDestruct(), BUF_SZ_1024, buffer, calloc(), head, MatrixInfo::name, ListNode::next, and ListNode::ptr.

Referenced by BlastScoringOptionsValidate().

◆ Blast_ResFreqFree() ◆ Blast_ResFreqNew()

Allocates a new Blast_ResFreq structure and fills in the prob element based upon the contents of sbp.

Parameters
sbp The BlastScoreBlk* used to init prob [in]

Definition at line 1708 of file blast_stat.c.

References BlastScoreBlk::alphabet_code, Blast_ResFreq::alphabet_code, BlastScoreBlk::alphabet_size, BlastScoreBlk::alphabet_start, Blast_ResFreqFree(), calloc(), NULL, Blast_ResFreq::prob, and Blast_ResFreq::prob0.

Referenced by BLAST_GetStandardAaProbabilities(), Blast_ScoreBlkKbpIdealCalc(), Blast_ScoreBlkKbpUngappedCalc(), BOOST_AUTO_TEST_CASE(), s_GetCompressedProbs(), SPHIPatternSearchBlkNew(), and CMultiAligner::x_AssignDefaultResFreqs().

◆ Blast_ResFreqStdComp()

Calculates residues frequencies given a standard distribution.

Parameters
Returns
zero on success

Definition at line 1887 of file blast_stat.c.

References BlastScoreBlk::alphabet_code, Blast_GetStdAlphabet(), Blast_ResFreqNormalize(), calloc(), DIM, nt_prob, BLAST_LetterProb::p, Blast_ResFreq::prob, BlastScoreBlk::protein_alphabet, sfree, STD_AMINO_ACID_FREQS, and TRUE.

Referenced by BLAST_GetStandardAaProbabilities(), Blast_ScoreBlkKbpIdealCalc(), Blast_ScoreBlkKbpUngappedCalc(), BOOST_AUTO_TEST_CASE(), s_GetCompressedProbs(), SPHIPatternSearchBlkNew(), and CMultiAligner::x_AssignDefaultResFreqs().

◆ Blast_ScoreBlkKbpIdealCalc()

Calculates the Karlin-Altschul parameters assuming standard residue compositions for the query and subject sequences.

It populates the kbp_ideal field of its sbp argument. This is used if the query is translated and the calculated (real) Karlin parameters are bad, as they're calculated for non-coding regions.

Parameters
sbp ScoreBlk used to calculate "ideal" values. [in|out]
Returns
0 on success, 1 on failure

Definition at line 2832 of file blast_stat.c.

References Blast_KarlinBlkNew(), Blast_KarlinBlkUngappedCalc(), Blast_ResFreqFree(), Blast_ResFreqNew(), Blast_ResFreqStdComp(), Blast_ScoreFreqFree(), Blast_ScoreFreqNew(), BlastScoreFreqCalc(), BlastScoreBlk::hiscore, BlastScoreBlk::kbp_ideal, BlastScoreBlk::loscore, and NULL.

Referenced by Blast_ScoreBlkKbpUngappedCalc(), BOOST_AUTO_TEST_CASE(), s_JumperScoreBlkFill(), s_PHIScoreBlkFill(), and CScoreBuilder::x_Initialize().

◆ Blast_ScoreBlkKbpUngappedCalc()

Calculate and fill the ungapped Karlin-Altschul parameters in the BlastScoreBlk structure (fields kbp_std, kbp_psi, and kbp of that structure).

Parameters
program BLAST program type, needed to decide whether to substitute ideal values. [in] sbp Scoring block to work with [in] [out] query Buffer containing (concatenated) query sequence [in] query_info Information about offsets of concatenated queries [in] blast_message returns queries that could not be processed [out]
Returns
0 if ungapped Karlin-Altschul parameters could be calculated for all of the query sequence's contexts; 1 if any of the contexts failed (but all others will be populated).

Definition at line 2737 of file blast_stat.c.

References ASSERT, Blast_KarlinBlkCopy(), Blast_KarlinBlkFree(), Blast_KarlinBlkNew(), Blast_KarlinBlkUngappedCalc(), Blast_MessageWrite(), Blast_QueryIsPssm(), Blast_QueryIsTranslated(), Blast_ResFreqFree(), Blast_ResFreqNew(), Blast_ResFreqStdComp(), Blast_ResFreqString(), Blast_ScoreBlkKbpIdealCalc(), Blast_ScoreFreqFree(), Blast_ScoreFreqNew(), BlastScoreFreqCalc(), buffer, context, BlastQueryInfo::contexts, eBlastSevWarning, eBlastTypeBlastx, eBlastTypeRpsTblastn, eBlastTypeTblastx, FALSE, BlastQueryInfo::first_context, BlastScoreBlk::hiscore, BlastContextInfo::is_valid, is_valid(), kBlastErrMsg_CantCalculateUngappedKAParams, kBlastMessageNoContext, BlastScoreBlk::kbp, BlastScoreBlk::kbp_ideal, BlastScoreBlk::kbp_psi, BlastScoreBlk::kbp_std, Blast_KarlinBlk::Lambda, BlastScoreBlk::loscore, query, BlastContextInfo::query_length, BlastContextInfo::query_offset, BlastScoreBlk::sfp, and TRUE.

Referenced by BlastSetup_ScoreBlkInit(), LinkHspTestFixture::setupScoreBlk(), and CBlastExtendTestFixture::setupStructures().

◆ Blast_ScoreBlkMatrixFill()

This function fills in the BlastScoreBlk structure.

Tasks are: -read in the matrix -set maxscore

Parameters
sbp Scoring block [in] [out] get_path pointer to function that will return path to matrix. Only called if built-in matrix not found [in]

Definition at line 1599 of file blast_stat.c.

References BlastScoreBlk::alphabet_code, BLASTNA_SEQ_CODE, BlastScoreBlkMaxScoreSet(), BlastScoreBlkNucleotideMatrixRead(), BlastScoreBlkNuclMatrixCreate(), BlastScoreBlkProteinMatrixLoad(), BlastScoreBlkProteinMatrixRead(), FALSE, fp, malloc(), BlastScoreBlk::name, NULL, BlastScoreBlk::read_in_matrix, sfree, and TRUE.

Referenced by Blast_ScoreBlkMatrixInit(), and s_PHIScoreBlkFill().

◆ Blast_ScoreFreqFree() ◆ Blast_ScoreFreqNew()

Creates a new structure to keep track of score frequencies for a scoring system.

Parameters
score_min Minimum score [in] score_max Maximum score [in]
Returns
allocated and initialized pointer to Blast_ScoreFreq

Definition at line 2113 of file blast_stat.c.

References Blast_ScoreFreqFree(), BlastScoreChk(), calloc(), NULL, Blast_ScoreFreq::obs_max, Blast_ScoreFreq::obs_min, Blast_ScoreFreq::score_avg, Blast_ScoreFreq::score_max, Blast_ScoreFreq::score_min, Blast_ScoreFreq::sprob, and Blast_ScoreFreq::sprob0.

Referenced by _PSIComputeScoreProbabilities(), Blast_ScoreBlkKbpIdealCalc(), Blast_ScoreBlkKbpUngappedCalc(), s_BlastScoreBlk_Copy(), and s_PHIScoreBlkFill().

◆ BLAST_ScoreSetAmbigRes()

Set the ambiguous residue (e.g, 'N', 'X') in the BlastScoreBlk*.

Convert from ncbieaa to sbp->alphabet_code (i.e., ncbistdaa) first.

Parameters
sbp the object to be modified [in|out] ambiguous_res the residue to be set on the BlastScoreBlk
Returns
zero on success, others on error

Definition at line 1012 of file blast_stat.c.

References BlastScoreBlk::alphabet_code, BlastScoreBlk::ambig_occupy, BlastScoreBlk::ambig_size, BlastScoreBlk::ambiguous_res, AMINOACID_TO_NCBISTDAA, BLASTAA_SEQ_CODE, BLASTNA_SEQ_CODE, calloc(), IUPACNA_TO_BLASTNA, IUPACNA_TO_NCBI4NA, NCBI4NA_SEQ_CODE, NULL, sfree, and toupper().

Referenced by Blast_ScoreBlkMatrixInit().

◆ BLAST_SmallGapSumE() double BLAST_SmallGapSumE ( Int4  start_points, Int2  num, double  xsum, Int4  query_length, Int4  subject_length, Int8  searchsp_eff, double  weight_divisor  )

Calculates the e-value for alignments with "small" gaps (typically under fifty residues/basepairs) following ideas of Stephen Altschul's.

Parameters
start_points the number of starting points permitted between adjacent alignments; max_overlap + max_gap + 1 [in] num the number of distinct alignments in this collection [in] xsum the sum of the scores of these alignments each individually normalized using an appropriate value of Lambda and logK [in] query_length effective len of the query seq [in] subject_length effective len of the subject seq [in] searchsp_eff effective size of the search space [in] weight_divisor a divisor used to weight the e-value when multiple collections of alignments are being considered by the calling routine [in]
Returns
the expect value

Definition at line 4418 of file blast_stat.c.

References BLAST_KarlinPtoE(), BLAST_LnFactorial(), INT4_MAX, log, and s_BlastSumP().

Referenced by s_BlastEvenGapLinkHSPs().

◆ BLAST_SpougeEtoS() ◆ BLAST_SpougeStoE()

Calculates the Expect value based upon the Spouge's FSC method.

Parameters
S the score of the alignment. [in] gbp the Gumbel parameters. [in] qlen the query length. [in] slen the subject length. [in]
Returns
the expect value

Definition at line 5176 of file blast_stat.c.

References Blast_GumbelBlk::a, Blast_GumbelBlk::Alpha, ASSERT, Blast_GumbelBlk::b, Blast_GumbelBlk::Beta, Blast_GumbelBlk::db_length, ErfC(), Blast_KarlinBlk::K, Blast_KarlinBlk::Lambda, Blast_GumbelBlk::Lambda, MAX, Blast_GumbelBlk::Sigma, and Blast_GumbelBlk::Tau.

Referenced by Blast_HSPListGetEvalues(), BLAST_SpougeEtoS(), and BOOST_AUTO_TEST_CASE().

◆ BLAST_UnevenGapSumE() double BLAST_UnevenGapSumE ( Int4  query_start_points, Int4  subject_start_points, Int2  num, double  xsum, Int4  query_length, Int4  subject_length, Int8  searchsp_eff, double  weight_divisor  )

Calculates the e-value of a collection multiple distinct alignments with asymmetric gaps between the alignments.

The gaps in one (protein) sequence are typically small (like in BLAST_SmallGapSumE) gap an the gaps in the other (translated DNA) sequence are possibly large (up to 4000 bp.) This routine is used for linking HSPs representing exons in the DNA sequence that are separated by introns.

Parameters
query_start_points the number of starting points in the query sequence permitted between adjacent alignments; max_overlap + max_gap + 1. [in] subject_start_points the number of starting points in the subject sequence permitted between adjacent alignments [in] num number of distinct alignments in one collection [in] xsum the sum of the scores of these alignments each individually normalized using an appropriate value of Lambda and logK [in] query_length effective length of query [in] subject_length effective length of subject [in] searchsp_eff effective size of the search space [in] weight_divisor a divisor used to weight the e-value when multiple collections of alignments are being considered by the calling routine [in]
Returns
sum expect value.

The gaps in one (protein) sequence are typically small (like in BLAST_SmallGapSumE) gap an the gaps in the other (translated DNA) sequence are possibly large (up to 4000 bp.) This routine is used for linking HSPs representing exons in the DNA sequence that are separated by introns.

Parameters
query_start_points the number of starting points in the query sequence permitted between adjacent alignments [in] subject_start_points the number of starting points in the subject sequence permitted between adjacent alignments [in] num The number of distinct alignments in this collection [in] xsum The sum of the scores of these alignments, each normalized using an appropriate value of Lambda and logK [in] query_length The effective len of the query seq [in] subject_length The effective len of the database seq [in] searchsp_eff effective size of the search space [in] weight_divisor A divisor used to weight the e-value when multiple collections of alignments are being considered by the calling routine [in]
Returns
Resulting e-value of a combined set.

Definition at line 4491 of file blast_stat.c.

References BLAST_KarlinPtoE(), BLAST_LnFactorial(), INT4_MAX, log, and s_BlastSumP().

Referenced by s_SumHSPEvalue().

◆ BlastScoreBlkCheck() ◆ BlastScoreBlkFree()

Deallocates BlastScoreBlk as well as all associated structures.

Parameters
Returns
NULL pointer.

Definition at line 965 of file blast_stat.c.

References BlastScoreBlk::ambiguous_res, Blast_KarlinBlkFree(), Blast_ScoreFreqFree(), BlastScoreBlk::comments, BlastScoreBlk::gbp, BlastScoreBlk::kbp, BlastScoreBlk::kbp_gap, BlastScoreBlk::kbp_gap_psi, BlastScoreBlk::kbp_gap_std, BlastScoreBlk::kbp_ideal, BlastScoreBlk::kbp_psi, BlastScoreBlk::kbp_std, ListNodeFreeData(), BlastScoreBlk::matrix, BlastScoreBlk::name, NULL, BlastScoreBlk::number_of_contexts, BlastScoreBlk::psi_matrix, s_BlastGumbelBlkFree(), SBlastScoreMatrixFree(), BlastScoreBlk::sfp, sfree, and SPsiBlastScoreMatrixFree().

Referenced by BlastScoreBlkNew(), BlastSetupPreliminarySearchEx(), BOOST_AUTO_TEST_CASE(), CEffectiveSearchSpaceCalculator::CEffectiveSearchSpaceCalculator(), CSetupFactory::CreateScoreBlock(), LinkHspTestFixture::freeStructures(), CRedoAlignmentTestFixture::runRedoAlignmentCoreUnitTest(), s_BlastScoreBlk_Copy(), s_BlastScoreBlk_Free(), TestFixture::TearDownLookupTable(), CMultiAligner::x_AssignDefaultResFreqs(), CMultiAligner::x_FindPatternHits(), CBlastTracebackSearch::x_Init(), CPssmEngine::x_InitializeScoreBlock(), AalookupTestFixture::~AalookupTestFixture(), AascanTestFixture::~AascanTestFixture(), CBlastExtendTestFixture::~CBlastExtendTestFixture(), CompressedAalookupTestFixture::~CompressedAalookupTestFixture(), CompressedAascanTestFixture::~CompressedAascanTestFixture(), CScoreBuilder::~CScoreBuilder(), CTracebackTestFixture::~CTracebackTestFixture(), and NuclWordFinderTextFixture::~NuclWordFinderTextFixture().

◆ BlastScoreBlkGetCompiledInMatrix()

Returns a pointer to the static compiled in version of the matrix.

If name is NULL or the matrix is not compiled in NULL is returned.

Parameters
Returns
pointer to matrix or NULL if not supported.
◆ BlastScoreBlkNew()

Allocates and initializes BlastScoreBlk.

Parameters
alphabet either BLASTAA_SEQ_CODE or BLASTNA_SEQ_CODE [in] number_of_contexts how many strands or sequences [in]
Returns
BlastScoreBlk*

Definition at line 884 of file blast_stat.c.

References BlastScoreBlk::alphabet_code, BlastScoreBlk::alphabet_size, BLASTAA_SEQ_CODE, BLASTAA_SIZE, BLASTNA_SEQ_CODE, BLASTNA_SIZE, BlastScoreBlkFree(), calloc(), FALSE, BlastScoreBlk::gbp, BlastScoreBlk::kbp_gap_psi, BlastScoreBlk::kbp_gap_std, BlastScoreBlk::kbp_psi, BlastScoreBlk::kbp_std, BlastScoreBlk::matrix, NULL, BlastScoreBlk::number_of_contexts, BlastScoreBlk::protein_alphabet, s_BlastGumbelBlkNew(), SBlastScoreMatrixNew(), BlastScoreBlk::scale_factor, BlastScoreBlk::sfp, and TRUE.

Referenced by AascanTestFixture::AascanTestFixture(), BlastSetup_ScoreBlkInit(), BOOST_AUTO_TEST_CASE(), CompressedAascanTestFixture::CompressedAascanTestFixture(), CompressedAalookupTestFixture::FillLookupTable(), AalookupTestFixture::FillLookupTable(), s_BlastScoreBlk_Copy(), s_FillScoreBlkWithBadKbp(), NuclWordFinderTextFixture::setupScoreBlk(), LinkHspTestFixture::setupScoreBlk(), CBlastExtendTestFixture::setupStructures(), CMultiAligner::x_AssignDefaultResFreqs(), CMultiAligner::x_FindPatternHits(), and CScoreBuilder::x_Initialize().

◆ BlastScoreBlkNuclMatrixCreate()

Fill in the matrix for blastn using the penaly and rewards The query sequence alphabet is blastna, the subject sequence is ncbi2na.

The alphabet blastna is defined in blast_stat.h and the first four elements of blastna are identical to ncbi2na. if sbp->matrix==NULL, it is allocated.

Parameters
sbp the BlastScoreBlk on which reward, penalty, and matrix will be set [in|out]
Returns
zero on success.

The alphabet blastna is defined in blast_stat.h and the first four elements of blastna are identical to ncbi2na.

Parameters
sbp the BlastScoreBlk on which reward, penalty, and matrix will be set [in|out]
Returns
zero on success.

Definition at line 1060 of file blast_stat.c.

References BlastScoreBlk::alphabet_size, ASSERT, BLAST_Nint(), BLASTNA_SIZE, BLASTNA_TO_NCBI4NA, SBlastScoreMatrix::data, INT4_MIN, BlastScoreBlk::matrix, SBlastScoreMatrix::ncols, SBlastScoreMatrix::nrows, BlastScoreBlk::penalty, and BlastScoreBlk::reward.

Referenced by Blast_ScoreBlkMatrixFill().

◆ RPSRescalePssm()

Rescale the PSSM, using composition-based statistics, for use with RPS BLAST.

This function produces a PSSM for a single RPS DB sequence (of size db_seq_length) and incorporates information from the RPS blast query. Each individual database sequence must call this function to retrieve its own PSSM. The matrix is returned (and must be freed elsewhere). posMatrix is the portion of the complete concatenated PSSM that is specific to this DB sequence

Parameters
scalingFactor used to rescale Lambda [in] rps_query_length length of query sequence [in] rps_query_seq the query sequence [in] db_seq_length Length of the database sequence [in] posMatrix matrix (actual) values to be used [in] sbp Structure with score matrix parameters [in][out]
Returns
rescaled pssm

Definition at line 4693 of file blast_stat.c.

References _PSIAllocateMatrix(), AMINOACID_TO_NCBISTDAA, ASSERT, Blast_FillResidueProbability(), Blast_KarlinLambdaNR(), BLAST_Nint(), BLAST_SCORE_MIN, BLAST_SCORE_RANGE_MAX, BLASTAA_SIZE, malloc(), BlastScoreBlk::name, SBlastScoreMatrix::nrows, NULL, BlastScoreBlk::psi_matrix, SPsiBlastScoreMatrix::pssm, RPSFillScores(), RPSfindUngappedLambda(), and sfree.

Referenced by s_RPSComputeTraceback().

◆ SBlastScoreMatrixFree() ◆ SBlastScoreMatrixNew()

Allocates a new SBlastScoreMatrix structure of the specified dimensions.

Parameters
ncols number of columns [in] nrows number of rows [in]
Returns
NULL in case of memory allocation failure, else new SBlastScoreMatrix structure

Definition at line 760 of file blast_stat.c.

References _PSIAllocateMatrix(), calloc(), SBlastScoreMatrix::data, SBlastScoreMatrix::freqs, int, SBlastScoreMatrix::lambda, SBlastScoreMatrix::ncols, SBlastScoreMatrix::nrows, NULL, and SBlastScoreMatrixFree().

Referenced by BlastScoreBlkNew(), s_BuildCompressedScoreMatrix(), and SPsiBlastScoreMatrixNew().

◆ SCompressedAlphabetFree() ◆ SCompressedAlphabetNew()

Allocate a new compressed alphabet and score matrix.

Parameters
sbp Current score matrix information [in] compressed_alphabet_size Desired size of compressed alphabet (current choices are limited to 10 or 15) [in] scale_factor Score matrix entries are scaled by this value [in]
Returns
the new alphabet, or NULL on failure

Definition at line 4955 of file blast_stat.c.

References ASSERT, BLASTAA_SIZE, calloc(), SCompressedAlphabet::compress_table, SCompressedAlphabet::compressed_alphabet_size, malloc(), s_alphabet10, s_alphabet15, s_BuildCompressedScoreMatrix(), s_BuildCompressedTranslation(), and SCompressedAlphabetFree().

Referenced by BlastCompressedAaLookupTableNew().

◆ SPsiBlastScoreMatrixFree()

Deallocates a SPsiBlastScoreMatrix structure.

Parameters
matrix structure to deallocate [in]
Returns
NULL

Definition at line 786 of file blast_stat.c.

References _PSIDeallocateMatrix(), Blast_KarlinBlkFree(), SPsiBlastScoreMatrix::freq_ratios, int, SPsiBlastScoreMatrix::kbp, SBlastScoreMatrix::ncols, NULL, SPsiBlastScoreMatrix::pssm, SBlastScoreMatrixFree(), and sfree.

Referenced by BlastScoreBlkFree(), and SPsiBlastScoreMatrixNew().

◆ SPsiBlastScoreMatrixNew()

Allocates a new SPsiBlastScoreMatrix structure of dimensions ncols by BLASTAA_SIZE.

Parameters
ncols number of columns (i.e.: query length) [in]
Returns
NULL in case of memory allocation failure, else new SPsiBlastScoreMatrix structure

Definition at line 805 of file blast_stat.c.

References _PSIAllocateMatrix(), Blast_KarlinBlkNew(), BLASTAA_SIZE, calloc(), SPsiBlastScoreMatrix::freq_ratios, SPsiBlastScoreMatrix::kbp, NULL, SPsiBlastScoreMatrix::pssm, SBlastScoreMatrixNew(), and SPsiBlastScoreMatrixFree().

Referenced by PsiBlastSetupScoreBlock(), s_BlastScoreBlk_Copy(), and CRedoAlignmentTestFixture::setupPositionBasedBlastScoreBlk().


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4