1 /* @include ensassemblyexception **********************************************
2 **
3 ** Ensembl Assembly Exception functions
4 **
5 ** @author Copyright (C) 1999 Ensembl Developers
6 ** @author Copyright (C) 2006 Michael K. Schuster
7 ** @version $Revision: 1.25 $
8 ** @modified 2009 by Alan Bleasby for incorporation into EMBOSS core
9 ** @modified $Date: 2012/08/05 10:26:10 $ by $Author: mks $
10 ** @@
11 **
12 ** This library is free software; you can redistribute it and/or
13 ** modify it under the terms of the GNU Lesser General Public
14 ** License as published by the Free Software Foundation; either
15 ** version 2.1 of the License, or (at your option) any later version.
16 **
17 ** This library is distributed in the hope that it will be useful,
18 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20 ** Lesser General Public License for more details.
21 **
22 ** You should have received a copy of the GNU Lesser General Public
23 ** License along with this library; if not, write to the Free Software
24 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
25 ** MA  02110-1301,  USA.
26 **
27 ******************************************************************************/
28 
29 #ifndef ENSASSEMBLYEXCEPTION_H
30 #define ENSASSEMBLYEXCEPTION_H
31 
32 /* ========================================================================= */
33 /* ============================= include files ============================= */
34 /* ========================================================================= */
35 
36 #include "ensdatabaseadaptor.h"
37 
38 AJ_BEGIN_DECLS
39 
40 
41 
42 
43 /* ========================================================================= */
44 /* =============================== constants =============================== */
45 /* ========================================================================= */
46 
47 /* @enum EnsEAssemblyexceptionType ********************************************
48 **
49 ** Ensembl Assembly Exception Type enumeration
50 **
51 ** @value ensEAssemblyexceptionTypeNULL Null
52 ** @value ensEAssemblyexceptionTypeHAP Haplotype Region
53 ** @value ensEAssemblyexceptionTypePAR Pseudo-Autosomal Region
54 ** @value ensEAssemblyexceptionTypePatchFix Sequence Patch Region
55 ** @value ensEAssemblyexceptionTypePatchNovel Novel Patch Region
56 ** @value ensEAssemblyexceptionTypeHAPRef Haplotype Reference Region
57 ** @value ensEAssemblyexceptionTypePatchFixRef Sequence Patch Reference Region
58 ** @value ensEAssemblyexceptionTypePatchNovelRef Novel Patch Reference Region
59 ** @@
60 ******************************************************************************/
61 
62 typedef enum EnsOAssemblyexceptionType
63 {
64     ensEAssemblyexceptionTypeNULL,
65     ensEAssemblyexceptionTypeHAP,
66     ensEAssemblyexceptionTypePAR,
67     ensEAssemblyexceptionTypePatchFix,
68     ensEAssemblyexceptionTypePatchNovel,
69     ensEAssemblyexceptionTypeHAPRef,
70     ensEAssemblyexceptionTypePatchFixRef,
71     ensEAssemblyexceptionTypePatchNovelRef
72 } EnsEAssemblyexceptionType;
73 
74 
75 
76 
77 /* ========================================================================= */
78 /* ============================== public data ============================== */
79 /* ========================================================================= */
80 
81 /* @data EnsPAssemblyexceptionadaptor *****************************************
82 **
83 ** Ensembl Assembly Exception Adaptor.
84 **
85 ** @alias EnsSAssemblyexceptionadaptor
86 ** @alias EnsOAssemblyexceptionadaptor
87 **
88 ** @attr Adaptor [EnsPDatabaseadaptor] Ensembl Database Adaptor
89 ** @attr CacheByReferenceSeqregion [AjPTable]
90 ** AJAX Table of AJAX unsigned integer (Ensembl Sequence Region identifier) key
91 ** and Ensembl Assembly Exception value data
92 ** @@
93 ******************************************************************************/
94 
95 typedef struct EnsSAssemblyexceptionadaptor
96 {
97     EnsPDatabaseadaptor Adaptor;
98     AjPTable CacheByReferenceSeqregion;
99 } EnsOAssemblyexceptionadaptor;
100 
101 #define EnsPAssemblyexceptionadaptor EnsOAssemblyexceptionadaptor*
102 
103 
104 
105 
106 /* @data EnsPAssemblyexception ************************************************
107 **
108 ** Ensembl Assembly Exception.
109 **
110 ** An Ensembl Assembly Exception object encapsulates information about
111 ** exceptions in the reference assembly path. Currently, the Ensembl system
112 ** models two types of assembly exceptions.
113 **
114 ** Haplotype (HAPs) assemblies represent alternative assembly paths of regions
115 ** of increased genetic variablility.
116 ** Pseudo-autosomal regions (PARs) are paired stretches at either tip of
117 ** (mammalian) sex chromosomes where frequent chrossing over events occur.
118 ** Due to the frequent exchange of genetic material those sequences represent
119 ** exact copies of each other.
120 **
121 ** @alias EnsSAssemblyexception
122 ** @alias EnsOAssemblyexception
123 **
124 ** @attr Use [ajuint] Use counter
125 ** @cc Bio::EnsEMBL::Storable
126 ** @attr Identifier [ajuint] SQL database-internal identifier
127 ** @attr Adaptor [EnsPAssemblyexceptionadaptor] Ensembl Assembly
128 **                                              Exception Adaptor
129 ** @cc Bio::EnsEMBL::AssemblyException
130 ** @attr ReferenceSeqregion [ajuint] Ensembl Sequence Region identifier
131 ** @attr ReferenceStart [ajuint] Ensembl Sequence Region start
132 ** @attr ReferenceEnd [ajuint] Ensembl Sequence Region end
133 ** @attr ExceptionSeqregion [ajuint] Ensembl Sequence Region identifier
134 ** @attr ExceptionStart [ajuint] Ensembl Sequence Region start
135 ** @attr ExceptionEnd [ajuint] Ensembl Sequence Region end
136 ** @attr Orientation [ajint] Orientation
137 ** @attr Type [EnsEAssemblyexceptionType] Type
138 ** @@
139 ******************************************************************************/
140 
141 typedef struct EnsSAssemblyexception
142 {
143     ajuint Use;
144     ajuint Identifier;
145     EnsPAssemblyexceptionadaptor Adaptor;
146     ajuint ReferenceSeqregion;
147     ajuint ReferenceStart;
148     ajuint ReferenceEnd;
149     ajuint ExceptionSeqregion;
150     ajuint ExceptionStart;
151     ajuint ExceptionEnd;
152     ajint Orientation;
153     EnsEAssemblyexceptionType Type;
154 } EnsOAssemblyexception;
155 
156 #define EnsPAssemblyexception EnsOAssemblyexception*
157 
158 
159 
160 
161 /* ========================================================================= */
162 /* =========================== public functions ============================ */
163 /* ========================================================================= */
164 
165 /*
166 ** Prototype definitions
167 */
168 
169 /* Ensembl Assembly Exception */
170 
171 EnsPAssemblyexception ensAssemblyexceptionNewCpy(
172     const EnsPAssemblyexception ae);
173 
174 EnsPAssemblyexception ensAssemblyexceptionNewIni(
175     EnsPAssemblyexceptionadaptor aea,
176     ajuint identifier,
177     ajuint srid,
178     ajuint srstart,
179     ajuint srend,
180     ajuint erid,
181     ajuint erstart,
182     ajuint erend,
183     ajint ori,
184     EnsEAssemblyexceptionType aet);
185 
186 EnsPAssemblyexception ensAssemblyexceptionNewRef(
187     EnsPAssemblyexception ae);
188 
189 void ensAssemblyexceptionDel(
190     EnsPAssemblyexception *Pae);
191 
192 EnsPAssemblyexceptionadaptor ensAssemblyexceptionGetAdaptor(
193     const EnsPAssemblyexception ae);
194 
195 ajuint ensAssemblyexceptionGetExceptionEnd(
196     const EnsPAssemblyexception ae);
197 
198 ajuint ensAssemblyexceptionGetExceptionSeqregion(
199     const EnsPAssemblyexception ae);
200 
201 ajuint ensAssemblyexceptionGetExceptionStart(
202     const EnsPAssemblyexception ae);
203 
204 ajuint ensAssemblyexceptionGetIdentifier(
205     const EnsPAssemblyexception ae);
206 
207 ajint ensAssemblyexceptionGetOrientation(
208     const EnsPAssemblyexception ae);
209 
210 ajuint ensAssemblyexceptionGetReferenceEnd(
211     const EnsPAssemblyexception ae);
212 
213 ajuint ensAssemblyexceptionGetReferenceSeqregion(
214     const EnsPAssemblyexception ae);
215 
216 ajuint ensAssemblyexceptionGetReferenceStart(
217     const EnsPAssemblyexception ae);
218 
219 EnsEAssemblyexceptionType ensAssemblyexceptionGetType(
220     const EnsPAssemblyexception ae);
221 
222 AjBool ensAssemblyexceptionSetAdaptor(
223     EnsPAssemblyexception ae,
224     EnsPAssemblyexceptionadaptor aea);
225 
226 AjBool ensAssemblyexceptionSetExceptionEnd(
227     EnsPAssemblyexception ae,
228     ajuint erend);
229 
230 AjBool ensAssemblyexceptionSetExceptionSeqregion(
231     EnsPAssemblyexception ae,
232     ajuint erid);
233 
234 AjBool ensAssemblyexceptionSetExceptionStart(
235     EnsPAssemblyexception ae,
236     ajuint erstart);
237 
238 AjBool ensAssemblyexceptionSetIdentifier(
239     EnsPAssemblyexception ae,
240     ajuint identifier);
241 
242 AjBool ensAssemblyexceptionSetOrientation(
243     EnsPAssemblyexception ae,
244     ajint orientation);
245 
246 AjBool ensAssemblyexceptionSetReferenceEnd(
247     EnsPAssemblyexception ae,
248     ajuint srend);
249 
250 AjBool ensAssemblyexceptionSetReferenceSeqregion(
251     EnsPAssemblyexception ae,
252     ajuint srid);
253 
254 AjBool ensAssemblyexceptionSetReferenceStart(
255     EnsPAssemblyexception ae,
256     ajuint srstart);
257 
258 AjBool ensAssemblyexceptionSetType(
259     EnsPAssemblyexception ae,
260     EnsEAssemblyexceptionType type);
261 
262 AjBool ensAssemblyexceptionTrace(
263     const EnsPAssemblyexception ae,
264     ajuint level);
265 
266 ajuint ensAssemblyexceptionCalculateExceptionLength(
267     const EnsPAssemblyexception ae);
268 
269 size_t ensAssemblyexceptionCalculateMemsize(
270     const EnsPAssemblyexception ae);
271 
272 ajuint ensAssemblyexceptionCalculateReferenceLength(
273     const EnsPAssemblyexception ae);
274 
275 EnsEAssemblyexceptionType ensAssemblyexceptionTypeFromStr(
276     const AjPStr type);
277 
278 const char *ensAssemblyexceptionTypeToChar(
279     const EnsEAssemblyexceptionType aet);
280 
281 /* AJAX List of Ensembl Assembly Excepion objects */
282 
283 AjBool ensListAssemblyexceptionSortReferenceEndAscending(AjPList aes);
284 
285 AjBool ensListAssemblyexceptionSortReferenceEndDescending(AjPList aes);
286 
287 /* Ensembl Assembly Exception Adaptor */
288 
289 EnsPAssemblyexceptionadaptor ensRegistryGetAssemblyexceptionadaptor(
290     EnsPDatabaseadaptor dba);
291 
292 EnsPAssemblyexceptionadaptor ensAssemblyexceptionadaptorNew(
293     EnsPDatabaseadaptor dba);
294 
295 EnsPDatabaseadaptor ensAssemblyexceptionadaptorGetDatabaseadaptor(
296     EnsPAssemblyexceptionadaptor aea);
297 
298 void ensAssemblyexceptionadaptorDel(
299     EnsPAssemblyexceptionadaptor *Paea);
300 
301 AjBool ensAssemblyexceptionadaptorFetchAll(
302     const EnsPAssemblyexceptionadaptor aea,
303     AjPList aes);
304 
305 AjBool ensAssemblyexceptionadaptorFetchAllbyReferenceSeqregion(
306     const EnsPAssemblyexceptionadaptor aea,
307     ajuint srid,
308     AjPList aes);
309 
310 /*
311 ** End of prototype definitions
312 */
313 
314 
315 
316 
317 AJ_END_DECLS
318 
319 #endif /* !ENSASSEMBLYEXCEPTION_H */
320