NCBI C++ ToolKit
|
Private interface for blast_gapalign.c. More...
#include <algo/blast/core/ncbi_std.h>
#include <algo/blast/core/gapinfo.h>
#include <algo/blast/core/blast_gapalign.h>
#include <algo/blast/core/blast_stat.h>
#include <algo/blast/core/blast_parameters.h>
Go to the source code of this file.
Go to the SVN repository for this file.
Classes | |
struct | BlastInitHSPNode |
A node in a path through blast unagpped alignments. More... | |
struct | ChainingStruct |
Workspace used for chaining. More... | |
Macros | |
#define | HSP_MAX_WINDOW 11 |
Window size used to scan HSP for highest score region, where gapped extension starts. More... | |
#define | MB_HSP_CLOSE(q1, s1, q2, s2, c) (ABS(((q1)-(s1)) - ((q2)-(s2))) < c) |
Are the two HSPs within a given number of diagonals from each other? More... | |
Typedefs | |
typedef struct BlastInitHSPNode | BlastInitHSPNode |
A node in a path through blast unagpped alignments. More... | |
typedef struct ChainingStruct | ChainingStruct |
Workspace used for chaining. More... | |
Functions | |
Int4 | ALIGN_EX (const Uint1 *A, const Uint1 *B, Int4 M, Int4 N, Int4 *a_offset, Int4 *b_offset, GapPrelimEditBlock *edit_block, BlastGapAlignStruct *gap_align, const BlastScoringParameters *scoringParams, Int4 query_offset, Boolean reversed, Boolean reverse_sequence, Boolean *hit_fence) |
Low level function to perform dynamic programming gapped extension with traceback. More... | |
Int4 | Blast_SemiGappedAlign (const Uint1 *A, const Uint1 *B, Int4 M, Int4 N, Int4 *a_offset, Int4 *b_offset, Boolean score_only, GapPrelimEditBlock *edit_block, BlastGapAlignStruct *gap_align, const BlastScoringParameters *score_params, Int4 query_offset, Boolean reversed, Boolean reverse_sequence, Boolean *fence_hit) |
Low level function to perform gapped extension in one direction with or without traceback. More... | |
GapEditScript * | Blast_PrelimEditBlockToGapEditScript (GapPrelimEditBlock *rev_prelim_tback, GapPrelimEditBlock *fwd_prelim_tback) |
Convert the initial list of traceback actions from a non-OOF gapped alignment into a blast edit script. More... | |
void | RPSPsiMatrixAttach (BlastScoreBlk *sbp, Int4 **rps_pssm, Int4 alphabet_size) |
Modify a BlastScoreBlk structure so that it can be used in RPS-BLAST. More... | |
void | RPSPsiMatrixDetach (BlastScoreBlk *sbp) |
Remove the artificially built SPsiBlastScoreMatrix structure allocated by RPSPsiMatrixAttach. More... | |
ChainingStruct * | ChainingStructNew (void) |
ChainingStruct * | ChainingStructFree (ChainingStruct *ch) |
Private interface for blast_gapalign.c.
Definition in file blast_gapalign_priv.h.
#define HSP_MAX_WINDOW 11 |
Window size used to scan HSP for highest score region, where gapped extension starts.
Definition at line 120 of file blast_gapalign_priv.h.
#define MB_HSP_CLOSE | ( | q1, | |
s1, | |||
q2, | |||
s2, | |||
c | |||
) | (ABS(((q1)-(s1)) - ((q2)-(s2))) < c) |
Are the two HSPs within a given number of diagonals from each other?
Definition at line 123 of file blast_gapalign_priv.h.
typedef struct BlastInitHSPNode BlastInitHSPNode |
A node in a path through blast unagpped alignments.
typedef struct ChainingStruct ChainingStruct |
Workspace used for chaining.
Int4 ALIGN_EX | ( | const Uint1 * | A, |
const Uint1 * | B, | ||
Int4 | M, | ||
Int4 | N, | ||
Int4 * | a_offset, | ||
Int4 * | b_offset, | ||
GapPrelimEditBlock * | edit_block, | ||
BlastGapAlignStruct * | gap_align, | ||
const BlastScoringParameters * | scoringParams, | ||
Int4 | query_offset, | ||
Boolean | reversed, | ||
Boolean | reverse_sequence, | ||
Boolean * | hit_fence | ||
) |
Low level function to perform dynamic programming gapped extension with traceback.
A | The query sequence [in] |
B | The subject sequence [in] |
M | Maximal extension length in query [in] |
N | Maximal extension length in subject [in] |
a_offset | Resulting starting offset in query [out] |
b_offset | Resulting starting offset in subject [out] |
edit_block | Structure to hold traceback generated [out] |
gap_align | Structure holding various information and allocated memory for the gapped alignment [in] |
scoringParams | Parameters related to scoring [in] |
query_offset | The starting offset in query [in] |
reversed | Has the sequence been reversed? Used for psi-blast [in] |
reverse_sequence | Do reverse the sequence [in] |
hit_fence | If NULL, set to TRUE if the extension encountered sequence letters that indicate finding a region of B that is uninitialized [out] |
Definition at line 374 of file blast_gapalign.c.
References A, B, BlastGapDP::best, BlastGapDP::best_gap, SBlastScoreMatrix::data, done, BlastGapAlignStruct::dp_mem, BlastGapAlignStruct::dp_mem_alloc, FENCE_SENTRY, BlastScoringParameters::gap_extend, BlastScoringParameters::gap_open, BlastGapAlignStruct::gap_x_dropoff, GapPrelimEditBlockAdd(), i, M, malloc(), BlastScoreBlk::matrix, MAX, MININT, N, NULL, BlastGapAlignStruct::positionBased, BlastScoreBlk::psi_matrix, SPsiBlastScoreMatrix::pssm, s_GapGetState(), s_GapPurgeState(), BlastGapAlignStruct::sbp, SCRIPT_EXTEND_GAP_A, SCRIPT_EXTEND_GAP_B, SCRIPT_GAP_IN_A, SCRIPT_GAP_IN_B, SCRIPT_OP_MASK, SCRIPT_SUB, sfree, GapStateArrayStruct::state_array, BlastGapAlignStruct::state_struct, and GapStateArrayStruct::used.
Referenced by BLAST_GappedAlignmentWithTraceback(), Blast_SemiGappedAlign(), and s_SWFindFinalEndsUsingXdrop().
GapEditScript* Blast_PrelimEditBlockToGapEditScript | ( | GapPrelimEditBlock * | rev_prelim_tback, |
GapPrelimEditBlock * | fwd_prelim_tback | ||
) |
Convert the initial list of traceback actions from a non-OOF gapped alignment into a blast edit script.
Note that this routine assumes the input edit blocks have not been reversed or rearranged by calling code
rev_prelim_tback | Traceback from extension to the left [in] |
fwd_prelim_tback | Traceback from extension to the right [in] |
Definition at line 2481 of file blast_gapalign.c.
References GapPrelimEditBlock::edit_ops, FALSE, GapEditScriptNew(), i, NULL, GapEditScript::num, GapPrelimEditScript::num, GapPrelimEditBlock::num_ops, GapEditScript::op_type, GapPrelimEditScript::op_type, ncbi::grid::netcache::search::fields::size, and TRUE.
Referenced by BLAST_GappedAlignmentWithTraceback(), BLAST_GreedyGappedAlignment(), PHIGappedAlignmentWithTraceback(), s_BlastOOFTracebackToGapEditScript(), and s_NewAlignmentUsingXdrop().
Int4 Blast_SemiGappedAlign | ( | const Uint1 * | A, |
const Uint1 * | B, | ||
Int4 | M, | ||
Int4 | N, | ||
Int4 * | a_offset, | ||
Int4 * | b_offset, | ||
Boolean | score_only, | ||
GapPrelimEditBlock * | edit_block, | ||
BlastGapAlignStruct * | gap_align, | ||
const BlastScoringParameters * | score_params, | ||
Int4 | query_offset, | ||
Boolean | reversed, | ||
Boolean | reverse_sequence, | ||
Boolean * | fence_hit | ||
) |
Low level function to perform gapped extension in one direction with or without traceback.
A | The query sequence [in] |
B | The subject sequence [in] |
M | Maximal extension length in query [in] |
N | Maximal extension length in subject [in] |
a_offset | Resulting starting offset in query [out] |
b_offset | Resulting starting offset in subject [out] |
score_only | Only find the score, without saving traceback [in] |
edit_block | Structure to hold generated traceback [out] |
gap_align | Structure holding various information and allocated memory for the gapped alignment [in] |
score_params | Parameters related to scoring [in] |
query_offset | The starting offset in query [in] |
reversed | Has the sequence been reversed? Used for psi-blast [in] |
reverse_sequence | Do reverse the sequence [in] |
fence_hit | If NULL, set to TRUE if the extension encountered sequence letters that indicate finding a region of B that is uninitialized [out] |
Definition at line 736 of file blast_gapalign.c.
References A, ALIGN_EX(), B, BlastGapDP::best, BlastGapDP::best_gap, SBlastScoreMatrix::data, BlastGapAlignStruct::dp_mem, BlastGapAlignStruct::dp_mem_alloc, BlastScoringParameters::gap_extend, BlastScoringParameters::gap_open, BlastGapAlignStruct::gap_x_dropoff, i, M, malloc(), BlastScoreBlk::matrix, MAX, MININT, N, NULL, BlastGapAlignStruct::positionBased, BlastScoreBlk::psi_matrix, SPsiBlastScoreMatrix::pssm, BlastGapAlignStruct::sbp, and sfree.
Referenced by PHIGappedAlignmentWithTraceback(), s_BlastProtGappedAlignment(), and s_PHIGappedAlignment().
ChainingStruct* ChainingStructFree | ( | ChainingStruct * | ch | ) |
Definition at line 3442 of file blast_gapalign.c.
References free(), ChainingStruct::nodes, and NULL.
Referenced by BLAST_GapAlignStructFree(), and ChainingStructNew().
ChainingStruct* ChainingStructNew | ( | void | ) |
Definition at line 3455 of file blast_gapalign.c.
References calloc(), ChainingStructFree(), malloc(), ChainingStruct::nodes, NULL, and ChainingStruct::num_allocated.
Referenced by BLAST_GapAlignStructNew().
void RPSPsiMatrixAttach | ( | BlastScoreBlk * | sbp, |
Int4 ** | rps_pssm, | ||
Int4 | alphabet_size | ||
) |
Modify a BlastScoreBlk structure so that it can be used in RPS-BLAST.
This involves allocating a SPsiBlastScoreMatrix structure so that the PSSMs memory mapped from the RPS-BLAST database files can be assigned to that structure.
sbp | BlastScoreBlk structure to modify [in|out] |
rps_pssm | PSSMs in RPS-BLAST database to use [in] |
alphabet_size | Elements in one pssm row [in] |
Definition at line 895 of file blast_traceback.c.
References ASSERT, calloc(), SBlastScoreMatrix::data, SBlastScoreMatrix::nrows, BlastScoreBlk::psi_matrix, and SPsiBlastScoreMatrix::pssm.
Referenced by s_RPSGapAlignDataPrepare(), and s_RPSPreliminarySearchEngine().
void RPSPsiMatrixDetach | ( | BlastScoreBlk * | sbp | ) |
Remove the artificially built SPsiBlastScoreMatrix structure allocated by RPSPsiMatrixAttach.
sbp | BlastScoreBlk structure to modify [in|out] |
Definition at line 916 of file blast_traceback.c.
References ASSERT, SBlastScoreMatrix::data, SPsiBlastScoreMatrix::freq_ratios, NULL, BlastScoreBlk::psi_matrix, SPsiBlastScoreMatrix::pssm, and sfree.
Referenced by s_RPSComputeTraceback(), and s_RPSPreliminarySearchEngine().