NCBI C++ ToolKit
Functions
gapinfo.c File Reference

Initialization and freeing of structures containing traceback information. More...

#include <algo/blast/core/blast_def.h>
#include <algo/blast/core/gapinfo.h>
+ Include dependency graph for gapinfo.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Functions

GapStateArrayStructGapStateFree (GapStateArrayStruct *state_struct)
 Free the gap state structure. More...
 
GapEditScriptGapEditScriptNew (Int4 size)
 Initialize the edit script structure. More...
 
GapEditScriptGapEditScriptDelete (GapEditScript *old)
 Free edit script structure. More...
 
GapEditScriptGapEditScriptDup (const GapEditScript *old)
 Duplicates the edit script structure. More...
 
Int2 GapEditScriptPartialCopy (GapEditScript *new, int offset, const GapEditScript *old, int start, int stop)
 Copies the portion of the GapEditScript specified by start and stop to a new one the new one should already exist. More...
 
static Int2 s_GapPrelimEditBlockRealloc (GapPrelimEditBlock *edit_block, Int4 total_ops)
 Ensures that a preliminary edit script has enough memory allocated to hold a given number of edit operations. More...
 
static Int2 s_GapPrelimEditBlockAddNew (GapPrelimEditBlock *edit_block, EGapAlignOpType op_type, Int4 num_ops)
 Add an edit operation to an edit script. More...
 
void GapPrelimEditBlockAdd (GapPrelimEditBlock *edit_block, EGapAlignOpType op_type, Int4 num_ops)
 Add a new operation to a preliminary edit block, possibly combining it with the last operation if the two operations are identical. More...
 
GapPrelimEditBlockGapPrelimEditBlockNew (void)
 Allocates a preliminary edit block structure. More...
 
GapPrelimEditBlockGapPrelimEditBlockFree (GapPrelimEditBlock *edit_block)
 Frees a preliminary edit block structure. More...
 
void GapPrelimEditBlockReset (GapPrelimEditBlock *edit_block)
 Reset a preliminary edit block without freeing it. More...
 
void GapPrelimEditBlockAppend (GapPrelimEditBlock *edit_block1, GapPrelimEditBlock *edit_block2)
 Append one GapPrelimEditBlock to the end of the other. More...
 

Detailed Description

Initialization and freeing of structures containing traceback information.

Definition in file gapinfo.c.

Function Documentation

◆ GapEditScriptDelete()

GapEditScript* GapEditScriptDelete ( GapEditScript esp)

◆ GapEditScriptDup()

GapEditScript* GapEditScriptDup ( const GapEditScript old)

Duplicates the edit script structure.

Parameters
oldobject to be duplicated [in]
Returns
Pointer to the new edit script

Definition at line 89 of file gapinfo.c.

References GapEditScriptNew(), NULL, GapEditScript::num, GapEditScript::op_type, and GapEditScript::size.

Referenced by Blast_HSPClone(), BOOST_AUTO_TEST_CASE(), and s_BlastHSPCopy().

◆ GapEditScriptNew()

GapEditScript* GapEditScriptNew ( Int4  size)

Initialize the edit script structure.

Parameters
sizenumber of elements to allocate.
Returns
Pointer to the new edit script

Definition at line 56 of file gapinfo.c.

References calloc(), NULL, and ncbi::grid::netcache::search::fields::size.

Referenced by Blast_PrelimEditBlockToGapEditScript(), BOOST_AUTO_TEST_CASE(), GapEditScriptDup(), JumperPrelimEditBlockToGapEditScript(), s_BlastOOFTracebackToGapEditScript(), s_CreateHSPForWordHit(), s_GetTraceback(), s_SetupHSPForGappedReevaluateTest(), and s_UpdateReevaluatedHSP().

◆ GapEditScriptPartialCopy()

Int2 GapEditScriptPartialCopy ( GapEditScript new_esp,
int  offset,
const GapEditScript old_esp,
int  start,
int  stop 
)

Copies the portion of the GapEditScript specified by start and stop to a new one the new one should already exist.

Parameters
new_espedit script to copy to [in|out]
offsetstarting element in new one to copy to [in]
old_espedit script to copy from [in]
startfirst element to copy from (zero-offset) [in]
stoplast element to copy [in]
Returns
0 on success

Definition at line 105 of file gapinfo.c.

References NULL, GapEditScript::num, offset, GapEditScript::op_type, and ncbi::grid::netcache::search::fields::size.

Referenced by s_UpdateReevaluatedHSP().

◆ GapPrelimEditBlockAdd()

void GapPrelimEditBlockAdd ( GapPrelimEditBlock edit_block,
EGapAlignOpType  op_type,
Int4  num_ops 
)

Add a new operation to a preliminary edit block, possibly combining it with the last operation if the two operations are identical.

Parameters
edit_blockThe script to update [in/modified]
op_typeThe operation type to add [in]
num_opsThe number of the specified type of operation to add [in]

Definition at line 175 of file gapinfo.c.

References GapPrelimEditBlock::edit_ops, GapPrelimEditBlock::last_op, GapPrelimEditScript::num, GapPrelimEditBlock::num_ops, and s_GapPrelimEditBlockAddNew().

Referenced by ALIGN_EX(), BLAST_AffineGreedyAlign(), BLAST_GreedyAlign(), GapPrelimEditBlockAppend(), JumperExtendLeft(), JumperExtendRight(), s_Align(), s_BandedAlign(), s_BlastOOFTracebackToGapEditScript(), s_GetTraceback(), s_OutOfFrameAlignWithTraceback(), and s_PHIBlastAlignPatterns().

◆ GapPrelimEditBlockAppend()

void GapPrelimEditBlockAppend ( GapPrelimEditBlock edit_block1,
GapPrelimEditBlock edit_block2 
)

Append one GapPrelimEditBlock to the end of the other.

Parameters
edit_block1First traceback block [in]
edit_block2Second traceback block, to be appended at the end of the first.

Definition at line 222 of file gapinfo.c.

References GapPrelimEditBlock::edit_ops, GapPrelimEditBlockAdd(), GapPrelimEditScript::num, and GapPrelimEditScript::op_type.

Referenced by PHIGappedAlignmentWithTraceback().

◆ GapPrelimEditBlockFree()

GapPrelimEditBlock* GapPrelimEditBlockFree ( GapPrelimEditBlock edit_block)

Frees a preliminary edit block structure.

Parameters
edit_blockThe edit block to free [in]
Returns
Always NULL

Definition at line 202 of file gapinfo.c.

References GapPrelimEditBlock::edit_ops, NULL, and sfree.

Referenced by BLAST_GapAlignStructFree(), PHIGappedAlignmentWithTraceback(), and s_BlastOOFTracebackToGapEditScript().

◆ GapPrelimEditBlockNew()

GapPrelimEditBlock* GapPrelimEditBlockNew ( void  )

◆ GapPrelimEditBlockReset()

void GapPrelimEditBlockReset ( GapPrelimEditBlock edit_block)

Reset a preliminary edit block without freeing it.

Parameters
edit_blockThe preliminary edit block to reset

Definition at line 213 of file gapinfo.c.

References eGapAlignInvalid, GapPrelimEditBlock::last_op, and GapPrelimEditBlock::num_ops.

Referenced by BLAST_GappedAlignmentWithTraceback(), BLAST_GreedyGappedAlignment(), PHIGappedAlignmentWithTraceback(), s_GetTraceback(), and s_SWFindFinalEndsUsingXdrop().

◆ GapStateFree()

GapStateArrayStruct* GapStateFree ( GapStateArrayStruct state_struct)

Free the gap state structure.

Parameters
state_structThe state structure to free
Returns
Always NULL

Definition at line 39 of file gapinfo.c.

References GapStateArrayStruct::next, next(), NULL, sfree, and GapStateArrayStruct::state_array.

Referenced by BLAST_GapAlignStructFree().

◆ s_GapPrelimEditBlockAddNew()

static Int2 s_GapPrelimEditBlockAddNew ( GapPrelimEditBlock edit_block,
EGapAlignOpType  op_type,
Int4  num_ops 
)
static

Add an edit operation to an edit script.

Parameters
edit_blockThe edit script to update [in/modified]
op_typeThe edit operation to add [in]
num_opsThe number of operations of the specified type [in]
Returns
0 on success, nonzero otherwise

Definition at line 158 of file gapinfo.c.

References ASSERT, GapPrelimEditBlock::edit_ops, eGapAlignInvalid, GapPrelimEditBlock::last_op, GapPrelimEditScript::num, GapPrelimEditBlock::num_ops, GapPrelimEditScript::op_type, and s_GapPrelimEditBlockRealloc().

Referenced by GapPrelimEditBlockAdd().

◆ s_GapPrelimEditBlockRealloc()

static Int2 s_GapPrelimEditBlockRealloc ( GapPrelimEditBlock edit_block,
Int4  total_ops 
)
static

Ensures that a preliminary edit script has enough memory allocated to hold a given number of edit operations.

Parameters
edit_blockThe script to examine [in/modified]
total_opsNumber of operations the script must support [in]
Returns
0 if successful, nonzero otherwise

Definition at line 133 of file gapinfo.c.

References GapPrelimEditBlock::edit_ops, NULL, and GapPrelimEditBlock::num_ops_allocated.

Referenced by GapPrelimEditBlockNew(), and s_GapPrelimEditBlockAddNew().

Modified on Tue May 28 05:52:44 2024 by modify_doxy.py rev. 669887