NCBI C++ ToolKit
Classes | Macros | Typedefs | Functions
blast_gapalign_priv.h File Reference

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>
+ Include dependency graph for blast_gapalign_priv.h:
+ This graph shows which files directly or indirectly include this file:

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...
 
GapEditScriptBlast_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...
 
ChainingStructChainingStructNew (void)
 
ChainingStructChainingStructFree (ChainingStruct *ch)
 

Detailed Description

Private interface for blast_gapalign.c.

Definition in file blast_gapalign_priv.h.

Macro Definition Documentation

◆ HSP_MAX_WINDOW

#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.

◆ MB_HSP_CLOSE

#define MB_HSP_CLOSE (   q1,
  s1,
  q2,
  s2,
 
)    (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 Documentation

◆ BlastInitHSPNode

A node in a path through blast unagpped alignments.

◆ ChainingStruct

Workspace used for chaining.

Function Documentation

◆ ALIGN_EX()

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.

Parameters
AThe query sequence [in]
BThe subject sequence [in]
MMaximal extension length in query [in]
NMaximal extension length in subject [in]
a_offsetResulting starting offset in query [out]
b_offsetResulting starting offset in subject [out]
edit_blockStructure to hold traceback generated [out]
gap_alignStructure holding various information and allocated memory for the gapped alignment [in]
scoringParamsParameters related to scoring [in]
query_offsetThe starting offset in query [in]
reversedHas the sequence been reversed? Used for psi-blast [in]
reverse_sequenceDo reverse the sequence [in]
hit_fenceIf NULL, set to TRUE if the extension encountered sequence letters that indicate finding a region of B that is uninitialized [out]
Returns
The best alignment score found.

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().

◆ Blast_PrelimEditBlockToGapEditScript()

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

Parameters
rev_prelim_tbackTraceback from extension to the left [in]
fwd_prelim_tbackTraceback from extension to the right [in]
Returns
Pointer to the resulting edit script, or NULL if there are no traceback actions specified

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().

◆ Blast_SemiGappedAlign()

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.

Parameters
AThe query sequence [in]
BThe subject sequence [in]
MMaximal extension length in query [in]
NMaximal extension length in subject [in]
a_offsetResulting starting offset in query [out]
b_offsetResulting starting offset in subject [out]
score_onlyOnly find the score, without saving traceback [in]
edit_blockStructure to hold generated traceback [out]
gap_alignStructure holding various information and allocated memory for the gapped alignment [in]
score_paramsParameters related to scoring [in]
query_offsetThe starting offset in query [in]
reversedHas the sequence been reversed? Used for psi-blast [in]
reverse_sequenceDo reverse the sequence [in]
fence_hitIf NULL, set to TRUE if the extension encountered sequence letters that indicate finding a region of B that is uninitialized [out]
Returns
The best alignment score found.

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().

◆ ChainingStructFree()

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().

◆ ChainingStructNew()

ChainingStruct* ChainingStructNew ( void  )

◆ RPSPsiMatrixAttach()

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.

Parameters
sbpBlastScoreBlk structure to modify [in|out]
rps_pssmPSSMs in RPS-BLAST database to use [in]
alphabet_sizeElements 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().

◆ RPSPsiMatrixDetach()

void RPSPsiMatrixDetach ( BlastScoreBlk sbp)

Remove the artificially built SPsiBlastScoreMatrix structure allocated by RPSPsiMatrixAttach.

Parameters
sbpBlastScoreBlk 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().

Modified on Wed Sep 04 15:02:28 2024 by modify_doxy.py rev. 669887