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.
SPsiBlastScoreMatrix * SPsiBlastScoreMatrixNew (size_t ncols) Allocates a new SPsiBlastScoreMatrix structure of dimensions ncols by BLASTAA_SIZE. 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 2This is the best value, only one per matrix.
Definition at line 55 of file blast_stat.h.
◆ BLAST_MATRIX_NOMINAL #define BLAST_MATRIX_NOMINAL 0Defines 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 1These value are preferred over others.
Definition at line 54 of file blast_stat.h.
◆ BLAST_SCORE_MAXmaximum allowed score (for one letter comparison).
Definition at line 122 of file blast_stat.h.
◆ BLAST_SCORE_MINminimum 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_GumbelBlkStructure to hold the Gumbel parameters (for FSC).
◆ Blast_KarlinBlkStructure to hold the Karlin-Altschul parameters.
◆ Blast_ResFreqStores the letter frequency of a sequence or database.
◆ Blast_ScoreFreqHolds score frequencies used in calculation of Karlin-Altschul parameters for an ungapped search.
◆ BlastScoreBlkStructure used for scoring calculations.
◆ erfc_tableTabulated 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_PATHcallback to resolve the path to blast score matrices
Definition at line 61 of file blast_stat.h.
◆ SBlastScoreMatrixScoring matrix used in BLAST.
◆ SCompressedAlphabetScoring matrix data used for compressed protein alphabets.
◆ SPsiBlastScoreMatrixScoring 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, 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.
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.
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.
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.
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 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.
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.
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.
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, Int4 * gap_existence, Int4 * gap_extension )Extract the recommended gap existence and extension values.
Only to be used with blastn searches.
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, Int4 * gap_existence, Int4 * gap_extension ) ◆ Blast_GetStdAlphabet() ◆ Blast_GumbelBlkCalc()Fills in gumbel parameters to estimate p-value using FSC.
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.
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.
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).
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.
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.
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.
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).
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.
Definition at line 4189 of file blast_stat.c.
References BLAST_Expm1().
Referenced by s_AdjustEvaluesForComposition().
◆ Blast_KarlinLambdaNR() double Blast_KarlinLambdaNR ( Blast_ScoreFreq * sfp, 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.
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.
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.
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.
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.
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.
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.
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).
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
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.
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.
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.
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.
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.
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.
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.
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.
Allocates and initializes 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.
The alphabet blastna is defined in blast_stat.h and the first four elements of blastna are identical to ncbi2na.
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
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.
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.
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.
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.
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