1 /* @include ensrepeat *********************************************************
2 **
3 ** Ensembl Repeat 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 11:25:55 $ 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 ENSREPEAT_H
30 #define ENSREPEAT_H
31 
32 /* ========================================================================= */
33 /* ============================= include files ============================= */
34 /* ========================================================================= */
35 
36 #include "ensfeature.h"
37 
38 AJ_BEGIN_DECLS
39 
40 
41 
42 
43 /* ========================================================================= */
44 /* =============================== constants =============================== */
45 /* ========================================================================= */
46 
47 /* @const EnsPRepeatconsensusadaptor ******************************************
48 **
49 ** Ensembl Repeat Consensus Adaptor.
50 ** Defined as an alias in EnsPBaseadaptor
51 ** #alias EnsPBaseadaptor
52 ** ##
53 ******************************************************************************/
54 
55 #define EnsPRepeatconsensusadaptor EnsPBaseadaptor
56 
57 
58 
59 
60 /* @const EnsPRepeatfeatureadaptor ********************************************
61 **
62 ** Ensembl Repeat Feature Adaptor.
63 ** Defined as an alias in EnsPFeatureadaptor
64 ** #alias EnsPFeatureadaptor
65 ** ##
66 ******************************************************************************/
67 
68 #define EnsPRepeatfeatureadaptor EnsPFeatureadaptor
69 
70 
71 
72 
73 /* ========================================================================= */
74 /* ============================== public data ============================== */
75 /* ========================================================================= */
76 
77 /* @data EnsPRepeatconsensus **************************************************
78 **
79 ** Ensembl Repeat Consensus.
80 **
81 ** @alias EnsSRepeatconsensus
82 ** @alias EnsORepeatconsensus
83 **
84 ** @attr Use [ajuint] Use counter
85 ** @cc Bio::EnsEMBL::Storable
86 ** @attr Identifier [ajuint] The SQL database-internal identifier
87 ** @attr Adaptor [EnsPRepeatconsensusadaptor] Ensembl Repeat Consensus Adaptor
88 ** @cc Bio::EnsEMBL::Repeatconsensus
89 ** @attr Name [AjPStr] Repeat Consensus name
90 ** @attr Class [AjPStr] Repeat Consensus class
91 ** @attr Type [AjPStr] Repeat Consensus type
92 ** @attr Consensus [AjPStr] Repeat Consensus sequence
93 ** @attr Length [ajuint] Repeat Consensus sequence length
94 ** @attr Padding [ajuint] Padding to alignment boundary
95 ** @@
96 ******************************************************************************/
97 
98 typedef struct EnsSRepeatconsensus
99 {
100     ajuint Use;
101     ajuint Identifier;
102     EnsPRepeatconsensusadaptor Adaptor;
103     AjPStr Name;
104     AjPStr Class;
105     AjPStr Type;
106     AjPStr Consensus;
107     ajuint Length;
108     ajuint Padding;
109 } EnsORepeatconsensus;
110 
111 #define EnsPRepeatconsensus EnsORepeatconsensus*
112 
113 
114 
115 
116 /* @data EnsPRepeatfeature ****************************************************
117 **
118 ** Ensembl Repeat Feature.
119 **
120 ** @alias EnsSRepeatfeature
121 ** @alias EnsORepeatfeature
122 **
123 ** @attr Use [ajuint] Use counter
124 ** @cc Bio::EnsEMBL::Storable
125 ** @attr Identifier [ajuint] The SQL database-internal identifier
126 ** @attr Adaptor [EnsPRepeatfeatureadaptor] Ensembl Repeat Feature Adaptor
127 ** @cc Bio::EnsEMBL::Repeatfeature
128 ** @attr Feature [EnsPFeature] Ensembl Feature
129 ** @attr Repeatconsensus [EnsPRepeatconsensus] Ensembl Repeat Consensus
130 ** @attr HitStart [ajint] The hit start on he consensus sequence
131 ** @attr HitEnd [ajint] The hit end on the consensus sequence
132 ** @attr Score [double] Score
133 ** @@
134 ******************************************************************************/
135 
136 typedef struct EnsSRepeatfeature
137 {
138     ajuint Use;
139     ajuint Identifier;
140     EnsPRepeatfeatureadaptor Adaptor;
141     EnsPFeature Feature;
142     EnsPRepeatconsensus Repeatconsensus;
143     ajint HitStart;
144     ajint HitEnd;
145     double Score;
146 } EnsORepeatfeature;
147 
148 #define EnsPRepeatfeature EnsORepeatfeature*
149 
150 
151 
152 
153 /* ========================================================================= */
154 /* =========================== public functions ============================ */
155 /* ========================================================================= */
156 
157 /*
158 ** Prototype definitions
159 */
160 
161 /* Ensembl Repeat Consensus */
162 
163 EnsPRepeatconsensus ensRepeatconsensusNewCpy(const EnsPRepeatconsensus rc);
164 
165 EnsPRepeatconsensus ensRepeatconsensusNewIni(EnsPRepeatconsensusadaptor rca,
166                                              ajuint identifier,
167                                              AjPStr name,
168                                              AjPStr class,
169                                              AjPStr type,
170                                              AjPStr consensus,
171                                              ajuint length);
172 
173 EnsPRepeatconsensus ensRepeatconsensusNewRef(EnsPRepeatconsensus rc);
174 
175 void ensRepeatconsensusDel(EnsPRepeatconsensus *Prc);
176 
177 EnsPRepeatconsensusadaptor ensRepeatconsensusGetAdaptor(
178     const EnsPRepeatconsensus rc);
179 
180 AjPStr ensRepeatconsensusGetClass(const EnsPRepeatconsensus rc);
181 
182 AjPStr ensRepeatconsensusGetConsensus(const EnsPRepeatconsensus rc);
183 
184 ajuint ensRepeatconsensusGetIdentifier(const EnsPRepeatconsensus rc);
185 
186 ajuint ensRepeatconsensusGetLength(const EnsPRepeatconsensus rc);
187 
188 AjPStr ensRepeatconsensusGetName(const EnsPRepeatconsensus rc);
189 
190 AjPStr ensRepeatconsensusGetType(const EnsPRepeatconsensus rc);
191 
192 AjBool ensRepeatconsensusSetAdaptor(EnsPRepeatconsensus rc,
193                                     EnsPRepeatconsensusadaptor rca);
194 
195 AjBool ensRepeatconsensusSetClass(EnsPRepeatconsensus rc,
196                                   AjPStr class);
197 
198 AjBool ensRepeatconsensusSetConsensus(EnsPRepeatconsensus rc,
199                                       AjPStr consensus);
200 
201 AjBool ensRepeatconsensusSetIdentifier(EnsPRepeatconsensus rc,
202                                        ajuint identifier);
203 
204 AjBool ensRepeatconsensusSetLength(EnsPRepeatconsensus rc,
205                                    ajuint length);
206 
207 AjBool ensRepeatconsensusSetName(EnsPRepeatconsensus rc,
208                                  AjPStr name);
209 
210 AjBool ensRepeatconsensusSetType(EnsPRepeatconsensus rc,
211                                  AjPStr type);
212 
213 size_t ensRepeatconsensusCalculateMemsize(const EnsPRepeatconsensus rc);
214 
215 AjBool ensRepeatconsensusTrace(const EnsPRepeatconsensus rc, ajuint level);
216 
217 /* Ensembl Repeat Consensus Adaptor */
218 
219 EnsPRepeatconsensusadaptor ensRegistryGetRepeatconsensusadaptor(
220     EnsPDatabaseadaptor dba);
221 
222 EnsPRepeatconsensusadaptor ensRepeatconsensusadaptorNew(
223     EnsPDatabaseadaptor dba);
224 
225 void ensRepeatconsensusadaptorDel(EnsPRepeatconsensusadaptor *Prca);
226 
227 EnsPBaseadaptor ensRepeatconsensusadaptorGetBaseadaptor(
228     EnsPRepeatconsensusadaptor rca);
229 
230 EnsPDatabaseadaptor ensRepeatconsensusadaptorGetDatabaseadaptor(
231     EnsPRepeatconsensusadaptor rca);
232 
233 AjBool ensRepeatconsensusadaptorFetchByIdentifier(
234     EnsPRepeatconsensusadaptor rca,
235     ajuint identifier,
236     EnsPRepeatconsensus *Prc);
237 
238 AjBool ensRepeatconsensusadaptorFetchByName(
239     EnsPRepeatconsensusadaptor rca,
240     const AjPStr name,
241     const AjPStr class,
242     EnsPRepeatconsensus *Prc);
243 
244 AjBool ensRepeatconsensusadaptorFetchAllbyClassconsensus(
245     EnsPRepeatconsensusadaptor rca,
246     const AjPStr class,
247     const AjPStr consensus,
248     AjPList rci);
249 
250 AjBool ensRepeatconsensusadaptorFetchAllbyIdentifiers(
251     EnsPRepeatconsensusadaptor rca,
252     AjPTable rcit);
253 
254 AjBool ensRepeatconsensusadaptorRetrieveAllTypes(
255     EnsPRepeatconsensusadaptor rca,
256     AjPList types);
257 
258 /* Ensembl Repeat Feature */
259 
260 EnsPRepeatfeature ensRepeatfeatureNewCpy(const EnsPRepeatfeature rf);
261 
262 EnsPRepeatfeature ensRepeatfeatureNewIni(EnsPRepeatfeatureadaptor rfa,
263                                          ajuint identifier,
264                                          EnsPFeature feature,
265                                          EnsPRepeatconsensus rc,
266                                          ajint hstart,
267                                          ajint hend,
268                                          double score);
269 
270 EnsPRepeatfeature ensRepeatfeatureNewRef(EnsPRepeatfeature rf);
271 
272 void ensRepeatfeatureDel(EnsPRepeatfeature *Prf);
273 
274 EnsPRepeatfeatureadaptor ensRepeatfeatureGetAdaptor(
275     const EnsPRepeatfeature rf);
276 
277 EnsPFeature ensRepeatfeatureGetFeature(
278     const EnsPRepeatfeature rf);
279 
280 ajint ensRepeatfeatureGetHitEnd(
281     const EnsPRepeatfeature rf);
282 
283 ajint ensRepeatfeatureGetHitStart(
284     const EnsPRepeatfeature rf);
285 
286 ajint ensRepeatfeatureGetHitStrand(
287     const EnsPRepeatfeature rf);
288 
289 ajuint ensRepeatfeatureGetIdentifier(
290     const EnsPRepeatfeature rf);
291 
292 EnsPRepeatconsensus ensRepeatfeatureGetRepeatconsensus(
293     const EnsPRepeatfeature rf);
294 
295 double ensRepeatfeatureGetScore(
296     const EnsPRepeatfeature rf);
297 
298 AjBool ensRepeatfeatureSetAdaptor(EnsPRepeatfeature rf,
299                                   EnsPRepeatfeatureadaptor rfa);
300 
301 AjBool ensRepeatfeatureSetFeature(EnsPRepeatfeature rf,
302                                   EnsPFeature feature);
303 
304 AjBool ensRepeatfeatureSetHitEnd(EnsPRepeatfeature rf,
305                                  ajuint hend);
306 
307 AjBool ensRepeatfeatureSetHitStart(EnsPRepeatfeature rf,
308                                    ajuint hstart);
309 
310 AjBool ensRepeatfeatureSetIdentifier(EnsPRepeatfeature rf,
311                                      ajuint identifier);
312 
313 AjBool ensRepeatfeatureSetRepeatconsensus(EnsPRepeatfeature rf,
314                                           EnsPRepeatconsensus rc);
315 
316 AjBool ensRepeatfeatureSetScore(EnsPRepeatfeature rf,
317                                 double score);
318 
319 AjBool ensRepeatfeatureTrace(const EnsPRepeatfeature rf, ajuint level);
320 
321 size_t ensRepeatfeatureCalculateMemsize(const EnsPRepeatfeature rf);
322 
323 /* AJAX List of Ensembl Repeat Feature objects */
324 
325 AjBool ensListRepeatfeatureSortEndAscending(AjPList rfs);
326 
327 AjBool ensListRepeatfeatureSortEndDescending(AjPList rfs);
328 
329 AjBool ensListRepeatfeatureSortIdentifierAscending(AjPList rfs);
330 
331 AjBool ensListRepeatfeatureSortStartAscending(AjPList rfs);
332 
333 AjBool ensListRepeatfeatureSortStartDescending(AjPList rfs);
334 
335 /* Ensembl Repeat Feature Adaptor */
336 
337 EnsPRepeatfeatureadaptor ensRegistryGetRepeatfeatureadaptor(
338     EnsPDatabaseadaptor dba);
339 
340 EnsPRepeatfeatureadaptor ensRepeatfeatureadaptorNew(
341     EnsPDatabaseadaptor dba);
342 
343 void ensRepeatfeatureadaptorDel(EnsPRepeatfeatureadaptor *Prfa);
344 
345 EnsPBaseadaptor ensRepeatfeatureadaptorGetBaseadaptor(
346     EnsPRepeatfeatureadaptor rfa);
347 
348 EnsPDatabaseadaptor ensRepeatfeatureadaptorGetDatabaseadaptor(
349     EnsPRepeatfeatureadaptor rfa);
350 
351 EnsPFeatureadaptor ensRepeatfeatureadaptorGetFeatureadaptor(
352     EnsPRepeatfeatureadaptor rfa);
353 
354 AjBool ensRepeatfeatureadaptorFetchAllbySlice(
355     EnsPRepeatfeatureadaptor rfa,
356     EnsPSlice slice,
357     const AjPStr anname,
358     const AjPStr rctype,
359     const AjPStr rcclass,
360     const AjPStr rcname,
361     AjPList rfs);
362 
363 /*
364 ** End of prototype definitions
365 */
366 
367 
368 
369 
370 AJ_END_DECLS
371 
372 #endif /* !ENSREPEAT_H */
373