~ubuntu-branches/ubuntu/gutsy/ncbi-tools6/gutsy

« back to all changes in this revision

Viewing changes to algo/blast/core/gapinfo.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2005-09-27 15:38:20 UTC
  • mfrom: (1.1.3 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050927153820-1t1sta0qirjpxaar
Tags: 6.1.20050429-1ubuntu1
GL/GLU Transition

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: gapinfo.h,v 1.13 2004/07/02 19:23:38 dondosha Exp $
 
1
/* $Id: gapinfo.h,v 1.20 2005/04/27 19:49:49 dondosha Exp $
2
2
 * ===========================================================================
3
3
 *
4
4
 *                            PUBLIC DOMAIN NOTICE
28
28
 */
29
29
 
30
30
/** @file gapinfo.h
31
 
 * Structures definitions from gapxdrop.h in ncbitools 
32
 
 * @todo FIXME: doxygen comments
 
31
 * Definitions of structures used for saving traceback information.
33
32
 */
34
33
 
35
34
#ifndef __GAPINFO__
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 */
54
54
} EGapAlignOpType;
55
55
 
56
56
/** Edit script: linked list of correspondencies between two sequences */
60
60
   struct GapEditScript* next; /**< Pointer to next link */
61
61
} GapEditScript;
62
62
 
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 
69
 
                                             sequences. */
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. */
76
 
} GapEditBlock;
 
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;
 
69
 
 
70
/** Preliminary version of GapEditBlock, used directly by the low-
 
71
 * level dynamic programming routines 
 
72
 */
 
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
} GapPrelimEditBlock;
77
79
 
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;
85
87
 
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
 
92
 */
87
93
GapEditScript* 
88
94
GapEditScriptNew (GapEditScript* old);
89
95
 
90
 
/** Free the gap editing script structure. */
91
 
GapEditScript* GapEditScriptDelete (GapEditScript* esp);
92
 
 
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]
96
 
 */
97
 
GapEditBlock* GapEditBlockNew (Int4 start1, Int4 start2);
98
 
 
99
 
/** Free the edit block structure. */
100
 
GapEditBlock* GapEditBlockDelete (GapEditBlock* edit_block);
101
 
 
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]
 
98
 *  @return Always NULL
 
99
 */
 
100
GapEditScript* 
 
101
GapEditScriptDelete (GapEditScript* esp);
 
102
 
 
103
/** Frees a preliminary edit block structure 
 
104
 *  @param edit_block The edit block to free [in]
 
105
 *  @return Always NULL
 
106
 */
 
107
GapPrelimEditBlock *
 
108
GapPrelimEditBlockFree(GapPrelimEditBlock *edit_block);
 
109
 
 
110
/** Allocates a preliminary edit block structure 
 
111
 *  @return Pointer to the allocated preliminary edit block
 
112
 */
 
113
GapPrelimEditBlock *
 
114
GapPrelimEditBlockNew(void);
 
115
 
 
116
/** Add a new operation to a preliminary edit block, possibly combining
 
117
 *  it with the last operation if the two operations are identical
 
118
 *
 
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]
 
122
 */
 
123
void
 
124
GapPrelimEditBlockAdd(GapPrelimEditBlock *edit_block, 
 
125
                 EGapAlignOpType op_type, Int4 num_ops);
 
126
 
 
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
 
130
 *                    the first.
 
131
 */
 
132
void
 
133
GapPrelimEditBlockAppend(GapPrelimEditBlock *edit_block1,
 
134
                         GapPrelimEditBlock *edit_block2);
 
135
 
 
136
 
 
137
/** Reset a preliminary edit block without freeing it 
 
138
 * @param edit_block The preliminary edit block to reset
 
139
 */
 
140
void
 
141
GapPrelimEditBlockReset(GapPrelimEditBlock *edit_block);
 
142
 
 
143
/** Free the gap state structure. 
 
144
 * @param state_struct The state structure to free
 
145
 * @return Always NULL
 
146
 */
103
147
GapStateArrayStruct* 
104
148
GapStateFree(GapStateArrayStruct* state_struct);
105
149