1 /* @include embest ************************************************************ 2 ** 3 ** NUCLEUS EST alignment functions 4 ** 5 ** @author Copyright (C) 1996 Richard Mott 6 ** @author Copyright (C) 1998 Peter Rice revised for EMBOSS 7 ** @version $Revision: 1.13 $ 8 ** @@ 9 ** 10 ** This library is free software; you can redistribute it and/or 11 ** modify it under the terms of the GNU Lesser General Public 12 ** License as published by the Free Software Foundation; either 13 ** version 2.1 of the License, or (at your option) any later version. 14 ** 15 ** This library is distributed in the hope that it will be useful, 16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 ** Lesser General Public License for more details. 19 ** 20 ** You should have received a copy of the GNU Lesser General Public 21 ** License along with this library; if not, write to the Free Software 22 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 23 ** MA 02110-1301, USA. 24 ** 25 ******************************************************************************/ 26 27 #ifndef EMBEST_H 28 #define EMBEST_H 29 30 /* ========================================================================= */ 31 /* ============================= include files ============================= */ 32 /* ========================================================================= */ 33 34 #include "ajdefine.h" 35 #include "ajseqdata.h" 36 37 AJ_BEGIN_DECLS 38 39 40 41 42 /* ========================================================================= */ 43 /* =============================== constants =============================== */ 44 /* ========================================================================= */ 45 46 47 48 49 /* Definition of the padding-character in CAF */ 50 51 #define padding_char '-' 52 53 54 55 56 /* ========================================================================= */ 57 /* ============================== public data ============================== */ 58 /* ========================================================================= */ 59 60 61 62 63 /* @data hash_list ************************************************************ 64 ** 65 ** NUCLEUS internal data structure for est2genome EMBOSS application 66 ** to maintain internal hash lists. 67 ** 68 ** @attr name [char*] Name 69 ** @attr offset [unsigned long] Offset 70 ** @attr text_offset [unsigned long] Text offset 71 ** @attr next [struct hash_list*] Next in list 72 ** @@ 73 ******************************************************************************/ 74 75 typedef struct hash_list 76 { 77 char *name; 78 unsigned long offset; 79 unsigned long text_offset; 80 struct hash_list *next; 81 } 82 HASH_LIST; 83 84 85 86 87 /* @enum directions *********************************************************** 88 ** 89 ** Path matrix cell type and direction 90 ** 91 ** @value INTRON Intron 92 ** @value DIAGONAL Diagonal in path 93 ** @value DELETE_EST Delete in EST sequence 94 ** @value DELETE_GENOME Delete in genome sequence 95 ** @value FORWARD_SPLICED_INTRON Forward spliced intron 96 ** @value REVERSE_SPLICED_INTRON Reverse spliced intron 97 ******************************************************************************/ 98 99 typedef enum { INTRON=0, DIAGONAL=1, DELETE_EST=2, DELETE_GENOME=3, 100 FORWARD_SPLICED_INTRON=-1, REVERSE_SPLICED_INTRON=-2 101 } directions; 102 103 104 105 106 /* @enum donor_acceptor ******************************************************* 107 ** 108 ** Donors and acceptors for slice site junctions 109 ** 110 ** @value NOT_A_SITE Not a splice site 111 ** @value DONOR Donor site 112 ** @value ACCEPTOR Acceptor site 113 ******************************************************************************/ 114 115 typedef enum { NOT_A_SITE=1, DONOR=2, ACCEPTOR=4 } donor_acceptor; 116 117 118 119 120 /* @data EmbPEstAlign ********************************************************* 121 ** 122 ** NUCLEUS data structure for EST alignments (originally for est2genome) 123 ** 124 ** @attr gstart [ajint] Genomic start 125 ** @attr estart [ajint] EST start 126 ** @attr gstop [ajint] Genomic stop 127 ** @attr estop [ajint] EST stop 128 ** @attr score [ajint] Score 129 ** @attr len [ajint] Length 130 ** @attr align_path [ajint*] Path 131 ** @@ 132 ******************************************************************************/ 133 134 typedef struct EmbSEstAlign 135 { 136 ajint gstart; 137 ajint estart; 138 ajint gstop; 139 ajint estop; 140 ajint score; 141 ajint len; 142 ajint *align_path; 143 } EmbOEstAlign; 144 #define EmbPEstAlign EmbOEstAlign* 145 146 147 148 149 enum base_types /* just defines a, c, g, t as 0-3, for indexing purposes. */ 150 { 151 base_a, base_c, base_g, base_t, base_n, base_i, base_o, nucleotides, anybase 152 }; 153 /* Definitions for nucleotides */ 154 155 156 157 #define MINUS_INFINITY -10000000 158 159 160 161 162 /* ========================================================================= */ 163 /* =========================== public functions ============================ */ 164 /* ========================================================================= */ 165 166 167 168 /* 169 ** Prototype definitions 170 */ 171 172 EmbPEstAlign embEstAlignNonRecursive ( const AjPSeq est, const AjPSeq genome, 173 ajint gap_penalty, ajint intron_penalty, 174 ajint splice_penalty, 175 const AjPSeq splice_sites, 176 ajint backtrack, ajint needleman, 177 ajint init_path ); 178 179 EmbPEstAlign embEstAlignLinearSpace ( const AjPSeq est, const AjPSeq genome, 180 ajint match, ajint mismatch, 181 ajint gap_penalty, ajint intron_penalty, 182 ajint splice_penalty, 183 const AjPSeq splice_sites, 184 float max_area ); 185 186 AjPSeq embEstFindSpliceSites( const AjPSeq genome, ajint direction ); 187 void embEstFreeAlign( EmbPEstAlign *ge ); 188 ajint embEstGetSeed (void); 189 void embEstMatInit (ajint match, ajint mismatch, ajint gap, 190 ajint neutral, char pad_char); 191 void embEstOutBlastStyle ( AjPFile ofile, 192 const AjPSeq genome, const AjPSeq est, 193 const EmbPEstAlign ge, ajint gap_penalty, 194 ajint intron_penalty, 195 ajint splice_penalty, 196 ajint gapped, ajint reverse ); 197 198 void embEstPrintAlign( AjPFile ofile, 199 const AjPSeq genome, const AjPSeq est, 200 const EmbPEstAlign ge, ajint width ); 201 void embEstSetDebug (void); 202 void embEstSetVerbose (void); 203 AjPSeq embEstShuffleSeq( AjPSeq seq, ajint in_place, ajint *seed ); 204 205 /* 206 ** End of prototype definitions 207 */ 208 209 AJ_END_DECLS 210 211 #endif /* !EMBEST_H */ 212