NCBI C++ ToolKit
Classes | Typedefs | Enumerations | Functions
gapinfo.h File Reference

Definitions of structures used for saving traceback information. More...

#include <algo/blast/core/ncbi_std.h>
+ Include dependency graph for gapinfo.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  GapEditScript
 Edit script: linked list of correspondencies between two sequences. More...
 
struct  GapPrelimEditScript
 A version of GapEditScript used to store initial results from the gapped alignment routines. More...
 
struct  GapPrelimEditBlock
 Preliminary version of GapEditBlock, used directly by the low- level dynamic programming routines. More...
 
struct  GapStateArrayStruct
 Structure to keep memory for state structure. More...
 

Typedefs

typedef enum EGapAlignOpType EGapAlignOpType
 Operation types within the edit script. More...
 
typedef struct GapEditScript GapEditScript
 Edit script: linked list of correspondencies between two sequences. More...
 
typedef struct GapPrelimEditScript GapPrelimEditScript
 A version of GapEditScript used to store initial results from the gapped alignment routines. More...
 
typedef struct GapPrelimEditBlock GapPrelimEditBlock
 Preliminary version of GapEditBlock, used directly by the low- level dynamic programming routines. More...
 
typedef struct GapStateArrayStruct GapStateArrayStruct
 Structure to keep memory for state structure. More...
 

Enumerations

enum  EGapAlignOpType {
  eGapAlignDel = 0 , eGapAlignDel2 = 1 , eGapAlignDel1 = 2 , eGapAlignSub = 3 ,
  eGapAlignIns1 = 4 , eGapAlignIns2 = 5 , eGapAlignIns = 6 , eGapAlignDecline = 7 ,
  eGapAlignInvalid = 8
}
 Operation types within the edit script. More...
 

Functions

GapEditScriptGapEditScriptNew (Int4 size)
 Initialize the edit script structure. More...
 
GapEditScriptGapEditScriptDelete (GapEditScript *esp)
 Free edit script structure. More...
 
GapEditScriptGapEditScriptDup (const GapEditScript *old)
 Duplicates the edit script structure. More...
 
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. More...
 
GapPrelimEditBlockGapPrelimEditBlockFree (GapPrelimEditBlock *edit_block)
 Frees a preliminary edit block structure. More...
 
GapPrelimEditBlockGapPrelimEditBlockNew (void)
 Allocates a preliminary edit block structure. 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...
 
void GapPrelimEditBlockAppend (GapPrelimEditBlock *edit_block1, GapPrelimEditBlock *edit_block2)
 Append one GapPrelimEditBlock to the end of the other. More...
 
void GapPrelimEditBlockReset (GapPrelimEditBlock *edit_block)
 Reset a preliminary edit block without freeing it. More...
 
GapStateArrayStructGapStateFree (GapStateArrayStruct *state_struct)
 Free the gap state structure. More...
 

Detailed Description

Definitions of structures used for saving traceback information.

Definition in file gapinfo.h.

Typedef Documentation

◆ EGapAlignOpType

Operation types within the edit script.

◆ GapEditScript

typedef struct GapEditScript GapEditScript

Edit script: linked list of correspondencies between two sequences.

◆ GapPrelimEditBlock

Preliminary version of GapEditBlock, used directly by the low- level dynamic programming routines.

◆ GapPrelimEditScript

A version of GapEditScript used to store initial results from the gapped alignment routines.

◆ GapStateArrayStruct

Structure to keep memory for state structure.

Enumeration Type Documentation

◆ EGapAlignOpType

Operation types within the edit script.

Enumerator
eGapAlignDel 

Deletion: a gap in query.

eGapAlignDel2 

Frame shift deletion of two nucleotides.

eGapAlignDel1 

Frame shift deletion of one nucleotide.

eGapAlignSub 

Substitution.

eGapAlignIns1 

Frame shift insertion of one nucleotide.

eGapAlignIns2 

Frame shift insertion of two nucleotides.

eGapAlignIns 

Insertion: a gap in subject.

eGapAlignDecline 

Non-aligned region.

eGapAlignInvalid 

Invalid operation.

Definition at line 44 of file gapinfo.h.

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

Modified on Sat Jun 22 10:45:51 2024 by modify_doxy.py rev. 669887