NCBI C++ ToolKit
|
Initialization and freeing of structures containing traceback information. More...
Go to the source code of this file.
Go to the SVN repository for this file.
Functions | |
GapStateArrayStruct * | GapStateFree (GapStateArrayStruct *state_struct) |
Free the gap state structure. More... | |
GapEditScript * | GapEditScriptNew (Int4 size) |
Initialize the edit script structure. More... | |
GapEditScript * | GapEditScriptDelete (GapEditScript *old) |
Free edit script structure. More... | |
GapEditScript * | GapEditScriptDup (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... | |
GapPrelimEditBlock * | GapPrelimEditBlockNew (void) |
Allocates a preliminary edit block structure. More... | |
GapPrelimEditBlock * | GapPrelimEditBlockFree (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... | |
Initialization and freeing of structures containing traceback information.
Definition in file gapinfo.c.
GapEditScript* GapEditScriptDelete | ( | GapEditScript * | esp | ) |
Free edit script structure.
esp | Pointer to the edit script [in] |
Definition at line 75 of file gapinfo.c.
References GapEditScript::num, GapEditScript::op_type, and sfree.
Referenced by BLAST_GapAlignStructFree(), BLAST_GetGappedScore(), Blast_HSPFree(), Blast_TracebackFromHSPList(), BOOST_AUTO_TEST_CASE(), GapEditScriptCombine(), s_BlastOOFTracebackToGapEditScript(), s_CreateHSPForWordHit(), s_ExtendAlignmentCleanup(), s_FreeEditScript(), s_NewAlignmentUsingXdrop(), s_PHITracebackFromHSPList(), s_SetupHSPForGappedReevaluateTest(), and s_UpdateReevaluatedHSP().
GapEditScript* GapEditScriptDup | ( | const GapEditScript * | old | ) |
Duplicates the edit script structure.
old | object to be duplicated [in] |
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().
GapEditScript* GapEditScriptNew | ( | Int4 | size | ) |
Initialize the edit script structure.
size | number of elements to allocate. |
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().
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.
new_esp | edit script to copy to [in|out] |
offset | starting element in new one to copy to [in] |
old_esp | edit script to copy from [in] |
start | first element to copy from (zero-offset) [in] |
stop | last element to copy [in] |
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().
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.
edit_block | The script to update [in/modified] |
op_type | The operation type to add [in] |
num_ops | The 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().
void GapPrelimEditBlockAppend | ( | GapPrelimEditBlock * | edit_block1, |
GapPrelimEditBlock * | edit_block2 | ||
) |
Append one GapPrelimEditBlock to the end of the other.
edit_block1 | First traceback block [in] |
edit_block2 | Second 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().
GapPrelimEditBlock* GapPrelimEditBlockFree | ( | GapPrelimEditBlock * | edit_block | ) |
Frees a preliminary edit block structure.
edit_block | The edit block to free [in] |
Definition at line 202 of file gapinfo.c.
References GapPrelimEditBlock::edit_ops, NULL, and sfree.
Referenced by BLAST_GapAlignStructFree(), PHIGappedAlignmentWithTraceback(), and s_BlastOOFTracebackToGapEditScript().
GapPrelimEditBlock* GapPrelimEditBlockNew | ( | void | ) |
Allocates a preliminary edit block structure.
Definition at line 188 of file gapinfo.c.
References GapPrelimEditBlock::edit_ops, eGapAlignInvalid, GapPrelimEditBlock::last_op, malloc(), NULL, GapPrelimEditBlock::num_ops, GapPrelimEditBlock::num_ops_allocated, and s_GapPrelimEditBlockRealloc().
Referenced by BLAST_GapAlignStructNew(), PHIGappedAlignmentWithTraceback(), and s_BlastOOFTracebackToGapEditScript().
void GapPrelimEditBlockReset | ( | GapPrelimEditBlock * | edit_block | ) |
Reset a preliminary edit block without freeing it.
edit_block | The 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().
GapStateArrayStruct* GapStateFree | ( | GapStateArrayStruct * | state_struct | ) |
Free the gap state structure.
state_struct | The state structure to free |
Definition at line 39 of file gapinfo.c.
References GapStateArrayStruct::next, next(), NULL, sfree, and GapStateArrayStruct::state_array.
Referenced by BLAST_GapAlignStructFree().
|
static |
Add an edit operation to an edit script.
edit_block | The edit script to update [in/modified] |
op_type | The edit operation to add [in] |
num_ops | The number of operations of the specified type [in] |
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().
|
static |
Ensures that a preliminary edit script has enough memory allocated to hold a given number of edit operations.
edit_block | The script to examine [in/modified] |
total_ops | Number of operations the script must support [in] |
Definition at line 133 of file gapinfo.c.
References GapPrelimEditBlock::edit_ops, NULL, and GapPrelimEditBlock::num_ops_allocated.
Referenced by GapPrelimEditBlockNew(), and s_GapPrelimEditBlockAddNew().