50
49
eGapAlignIns1 = 4,/**< Frame shift insertion of one nucleotide */
51
50
eGapAlignIns2 = 5,/**< Frame shift insertion of two nucleotides */
52
51
eGapAlignIns = 6, /**< Insertion: a gap in subject */
53
eGapAlignDecline = 7 /**< Non-aligned region */
52
eGapAlignDecline = 7, /**< Non-aligned region */
53
eGapAlignInvalid = 8 /**< Invalid operation */
56
56
/** Edit script: linked list of correspondencies between two sequences */
60
60
struct GapEditScript* next; /**< Pointer to next link */
63
/** Editing block structure containing all information returned from a
64
* single gapped extension. */
65
typedef struct GapEditBlock {
66
Int4 start1, start2, /**< starts of alignments. */
67
length1, length2, /**< total lengths of the sequences. */
68
original_length1, original_length2; /**< Untranslated lengths of the
70
Int2 frame1, frame2; /**< frames of the sequences. */
71
Boolean translate1, translate2; /**< are either of these be translated. */
72
Boolean reverse; /**< reverse sequence 1 and 2 when producing SeqALign? */
73
Boolean is_ooframe; /**< Is this out_of_frame edit block? */
74
Boolean discontinuous; /**< Is this OK to produce discontinuous SeqAlign? */
75
GapEditScript* esp; /**< Editing script for the traceback. */
63
/** A version of GapEditScript used to store initial results
64
from the gapped alignment routines */
65
typedef struct GapPrelimEditScript {
66
EGapAlignOpType op_type; /**< Type of operation */
67
Int4 num; /**< Number of operations */
68
} GapPrelimEditScript;
70
/** Preliminary version of GapEditBlock, used directly by the low-
71
* level dynamic programming routines
73
typedef struct GapPrelimEditBlock {
74
GapPrelimEditScript *edit_ops; /**< array of edit operations */
75
Int4 num_ops_allocated; /**< size of allocated array */
76
Int4 num_ops; /**< number of edit ops presently in use */
77
EGapAlignOpType last_op; /**< most recent operation added */
78
80
/** Structure to keep memory for state structure. */
79
81
typedef struct GapStateArrayStruct {
83
85
struct GapStateArrayStruct* next; /**< Next link in the list. */
84
86
} GapStateArrayStruct;
86
/** Initialize the gap editing script structure. */
88
/** Initialize the edit script structure.
89
* @param old Pointer to existing edit script to which
90
* the new script will be appended
91
* @return Pointer to the new edit script
88
94
GapEditScriptNew (GapEditScript* old);
90
/** Free the gap editing script structure. */
91
GapEditScript* GapEditScriptDelete (GapEditScript* esp);
93
/** Initialize the gap editing block structure.
94
* @param start1 Offset to start alignment in first sequence. [in]
95
* @param start2 Offset to start alignment in second sequence. [in]
97
GapEditBlock* GapEditBlockNew (Int4 start1, Int4 start2);
99
/** Free the edit block structure. */
100
GapEditBlock* GapEditBlockDelete (GapEditBlock* edit_block);
102
/** Free the gap state structure. */
96
/** Free all links of an edit script structure.
97
* @param esp Pointer to first link in the edit script [in]
101
GapEditScriptDelete (GapEditScript* esp);
103
/** Frees a preliminary edit block structure
104
* @param edit_block The edit block to free [in]
105
* @return Always NULL
108
GapPrelimEditBlockFree(GapPrelimEditBlock *edit_block);
110
/** Allocates a preliminary edit block structure
111
* @return Pointer to the allocated preliminary edit block
114
GapPrelimEditBlockNew(void);
116
/** Add a new operation to a preliminary edit block, possibly combining
117
* it with the last operation if the two operations are identical
119
* @param edit_block The script to update [in/modified]
120
* @param op_type The operation type to add [in]
121
* @param num_ops The number of the specified type of operation to add [in]
124
GapPrelimEditBlockAdd(GapPrelimEditBlock *edit_block,
125
EGapAlignOpType op_type, Int4 num_ops);
127
/** Append one GapPrelimEditBlock to the end of the other.
128
* @param edit_block1 First traceback block [in]
129
* @param edit_block2 Second traceback block, to be appended at the end of
133
GapPrelimEditBlockAppend(GapPrelimEditBlock *edit_block1,
134
GapPrelimEditBlock *edit_block2);
137
/** Reset a preliminary edit block without freeing it
138
* @param edit_block The preliminary edit block to reset
141
GapPrelimEditBlockReset(GapPrelimEditBlock *edit_block);
143
/** Free the gap state structure.
144
* @param state_struct The state structure to free
145
* @return Always NULL
103
147
GapStateArrayStruct*
104
148
GapStateFree(GapStateArrayStruct* state_struct);