1 #ifdef _cplusplus
2 extern "C" {
3 #endif
4 #include "cdnadb.h"
5
6
7 /* Function: show_Hscore_cDNADB(hs,ofp)
8 *
9 * Descrip: shows the Hscore by the cDNADB information
10 *
11 *
12 *
13 * Arg: hs [UNKN ] High Score structure [Hscore *]
14 * Arg: ofp [UNKN ] output file [FILE *]
15 *
16 */
17 # line 75 "cdnadb.dy"
show_Hscore_cDNADB(Hscore * hs,FILE * ofp)18 void show_Hscore_cDNADB(Hscore * hs,FILE * ofp)
19 {
20 int i;
21
22 for(i=0;i<hs->len;i++)
23 fprintf(ofp,"Query [%20s] Target [%20s] %d\n",hs->ds[i]->query->name,hs->ds[i]->target->name,hs->ds[i]->score);
24 }
25
26 /* Function: get_cDNA_from_cDNADB(cdnadb,de)
27 *
28 * Descrip: Gets cDNA sequence out from
29 * the cDNADB using the information stored in
30 * dataentry
31 *
32 *
33 * Arg: cdnadb [READ ] cDNA database [cDNADB *]
34 * Arg: de [READ ] DataEntry information [DataEntry *]
35 *
36 * Return [UNKN ] Undocumented return value [cDNA *]
37 *
38 */
39 # line 92 "cdnadb.dy"
get_cDNA_from_cDNADB(cDNADB * cdnadb,DataEntry * de)40 cDNA * get_cDNA_from_cDNADB(cDNADB * cdnadb,DataEntry * de)
41 {
42 Sequence * seq;
43 Sequence * temp;
44
45 if( cdnadb == NULL ) {
46 warn("Cannot get entry from a null database");
47 return NULL;
48 }
49
50 if( de == NULL ) {
51 warn("Cannot get entry with a null dataentry");
52 return NULL;
53 }
54
55
56 if( cdnadb->is_single_seq == TRUE ) {
57 if( de->is_reversed == TRUE )
58 return cDNA_from_Sequence(hard_link_Sequence(cdnadb->rev->seq));
59 else
60 return cDNA_from_Sequence(hard_link_Sequence(cdnadb->forw->seq));
61 }
62
63 /* we need to get out the Sequence from seqdb */
64
65 seq = get_Sequence_from_SequenceDB(cdnadb->sdb,de);
66 if( seq == NULL ) {
67 warn("Cannot get entry for %s from cDNA db",de->name);
68 return NULL;
69 }
70
71 if( seq->type != SEQUENCE_DNA) {
72 warn("Sequence from %s data entry doesn't look like DNA. Forcing it to",de->name);
73 }
74
75 force_to_dna_Sequence(seq,1.0,NULL);
76
77 if( de->is_reversed == TRUE ) {
78 temp = reverse_complement_Sequence(seq);
79 free_Sequence(seq);
80 seq = temp;
81 }
82
83 return cDNA_from_Sequence(seq);
84 }
85
86
87
88 /* Function: dataentry_add_cDNADB(de,cs,cdnadb)
89 *
90 * Descrip: adds information to dataentry from cDNADB
91 *
92 * will eventually add file offset and format information,
93 * but this is handled by the SequenceDB mainly.
94 *
95 *
96 * Arg: de [UNKN ] Undocumented argument [DataEntry *]
97 * Arg: cs [UNKN ] Undocumented argument [ComplexSequence *]
98 * Arg: cdnadb [UNKN ] Undocumented argument [cDNADB *]
99 *
100 * Return [UNKN ] Undocumented return value [boolean]
101 *
102 */
103 # line 146 "cdnadb.dy"
dataentry_add_cDNADB(DataEntry * de,ComplexSequence * cs,cDNADB * cdnadb)104 boolean dataentry_add_cDNADB(DataEntry * de,ComplexSequence * cs,cDNADB * cdnadb)
105 {
106 if( cs == NULL || cs->seq == NULL ) {
107 warn("Adding a dataentry with a NULL complex sequence or null internal sequence. Nope!");
108 return FALSE;
109 }
110
111 if( cdnadb->is_single_seq == FALSE)
112 add_SequenceDB_info_DataEntry(cdnadb->sdb,de);
113 de->name = stringalloc(cs->seq->name);
114 de->is_reversed = is_reversed_Sequence(cs->seq);
115 return TRUE;
116 }
117
118
119 /* Function: init_cDNADB(cdnadb,return_status)
120 *
121 * Descrip: top level function which opens the cDNA database
122 *
123 *
124 * Arg: cdnadb [UNKN ] protein database [cDNADB *]
125 * Arg: return_status [WRITE] the status of the open from database.h [int *]
126 *
127 * Return [UNKN ] Undocumented return value [ComplexSequence *]
128 *
129 */
130 # line 167 "cdnadb.dy"
init_cDNADB(cDNADB * cdnadb,int * return_status)131 ComplexSequence * init_cDNADB(cDNADB * cdnadb,int * return_status)
132 {
133 ComplexSequence * cs;
134 Sequence * seq;
135
136 if( cdnadb->is_single_seq == TRUE) {
137 *return_status = DB_RETURN_OK;
138 cdnadb->done_forward = TRUE;
139 return hard_link_ComplexSequence(cdnadb->forw);
140
141 }
142
143 /* is a seq db */
144
145 seq = init_SequenceDB(cdnadb->sdb,return_status);
146
147 if( seq == NULL || *return_status == DB_RETURN_ERROR || *return_status == DB_RETURN_END ) {
148 return NULL; /** error already reported **/
149 }
150
151 if( force_to_dna_Sequence(seq,cdnadb->error_tol,NULL) == FALSE ) {
152 warn("first sequence below error level, have to fail at the moment. Ooops...");
153 free_Sequence(seq);
154 *return_status = DB_RETURN_ERROR;
155 return NULL;
156 }
157
158 cdnadb->current = seq;
159 cdnadb->done_forward = TRUE;
160 cs = new_ComplexSequence(seq,cdnadb->cses);
161 if( cs == NULL ) {
162 warn("Cannot make initial ComplexSequence. Unable to error catch this. Failing!");
163 *return_status = DB_RETURN_ERROR;
164 return NULL;
165 }
166
167
168
169 return cs;
170 }
171
172 /* Function: reload_cDNADB(last,cdnadb,return_status)
173 *
174 * Descrip: function which reloads the database
175 *
176 *
177 * Arg: last [UNKN ] previous complex sequence, will be freed [ComplexSequence *]
178 * Arg: cdnadb [UNKN ] Undocumented argument [cDNADB *]
179 * Arg: return_status [WRITE] return_status of the load [int *]
180 *
181 * Return [OWNER] a new ComplexSequence object [ComplexSequence *]
182 *
183 */
184 # line 215 "cdnadb.dy"
reload_cDNADB(ComplexSequence * last,cDNADB * cdnadb,int * return_status)185 ComplexSequence * reload_cDNADB(ComplexSequence * last,cDNADB * cdnadb,int * return_status)
186 {
187 ComplexSequence * cs;
188 Sequence * seq,*temp;
189
190
191 /** free Complex Sequence **/
192
193 if ( last != NULL ) {
194 free_ComplexSequence(last);
195 }
196
197 if( cdnadb->forward_only == TRUE) {
198 temp = reload_SequenceDB(NULL,cdnadb->sdb,return_status);
199 if ( *return_status != DB_RETURN_OK ) {
200 return NULL;
201 }
202 cs = new_ComplexSequence(temp,cdnadb->cses);
203 return cs;
204 }
205
206 if( cdnadb->is_single_seq == TRUE ) {
207 if( cdnadb->done_forward == TRUE ) {
208 *return_status = DB_RETURN_OK;
209 cdnadb->done_forward = FALSE;
210 return hard_link_ComplexSequence(cdnadb->rev);
211 } else {
212 *return_status = DB_RETURN_END;
213 return NULL;
214 }
215 }
216
217
218 /** standard database **/
219
220
221 if( cdnadb->done_forward == TRUE ) {
222 if( cdnadb->current == NULL ) {
223 warn("A bad internal cDNA db error - unable to find current sequence in db reload");
224 *return_status = DB_RETURN_ERROR;
225 return NULL;
226 }
227
228 temp = reverse_complement_Sequence(cdnadb->current);
229
230
231 if( temp == NULL ) {
232 warn("A bad internal cDNA db error - unable to reverse complements current");
233 *return_status = DB_RETURN_ERROR;
234 return NULL;
235 }
236
237 cs = new_ComplexSequence(temp,cdnadb->cses);
238
239 if( cs == NULL ) {
240 warn("A bad internal cDNA db error - unable to make complex sequence in db reload");
241 *return_status = DB_RETURN_ERROR;
242 return NULL;
243 }
244
245 free_Sequence(temp);
246 cdnadb->done_forward = FALSE;
247 return cs;
248 }
249
250
251 /* otherwise we have to get a new sequence */
252
253 seq = reload_SequenceDB(NULL,cdnadb->sdb,return_status);
254
255 if( seq == NULL || *return_status == DB_RETURN_ERROR || *return_status == DB_RETURN_END ) {
256 return NULL; /** error already reported **/
257 }
258
259 uppercase_Sequence(seq);
260
261 if( force_to_dna_Sequence(seq,cdnadb->error_tol,NULL) == FALSE ) {
262 if( cdnadb->error_handling == CDNADB_READ_THROUGH ) {
263 warn("Unable to map %s sequence to a cDNA sequence, but ignoring that for the moment...",seq->name);
264 free_Sequence(seq);
265 return reload_cDNADB(NULL,cdnadb,return_status);
266 } else {
267 warn("Unable to map %s sequence to a cDNA sequence. Failing",seq->name);
268 *return_status = DB_RETURN_ERROR;
269 return NULL;
270 }
271 }
272
273
274 cs = new_ComplexSequence(seq,cdnadb->cses);
275 if( cs == NULL ) {
276 if( cdnadb->error_handling == CDNADB_READ_THROUGH ) {
277 warn("Unable to map %s sequence to a cDNA sequence, but ignoring that for the moment...",seq->name);
278 free_Sequence(seq);
279 return reload_cDNADB(NULL,cdnadb,return_status);
280 } else {
281 warn("Unable to map %s sequence to a cDNA sequence. Failing",seq->name);
282 *return_status = DB_RETURN_ERROR;
283 return NULL;
284 }
285 }
286
287 cdnadb->current = free_Sequence(cdnadb->current);
288 cdnadb->current = seq;
289 cdnadb->done_forward= TRUE;
290
291 return cs;
292 }
293
294
295
296 /* Function: close_cDNADB(cs,cdnadb)
297 *
298 * Descrip: top level function which closes the cDNA database
299 *
300 *
301 * Arg: cs [UNKN ] last complex sequence [ComplexSequence *]
302 * Arg: cdnadb [UNKN ] protein database [cDNADB *]
303 *
304 * Return [UNKN ] Undocumented return value [boolean]
305 *
306 */
307 # line 332 "cdnadb.dy"
close_cDNADB(ComplexSequence * cs,cDNADB * cdnadb)308 boolean close_cDNADB(ComplexSequence * cs,cDNADB * cdnadb)
309 {
310 if( cdnadb->is_single_seq == TRUE ) {
311 return TRUE;
312 }
313
314 if( cs != NULL)
315 free_ComplexSequence(cs);
316
317 if( cdnadb->current != NULL)
318 cdnadb->current = free_Sequence(cdnadb->current);
319
320 return close_SequenceDB(NULL,cdnadb->sdb);
321 }
322
323 /* Function: new_cDNADB_from_single_seq(seq)
324 *
325 * Descrip: To make a new cDNA database
326 * from a single cDNA Sequence with a eval system
327 *
328 *
329 * Arg: seq [UNKN ] sequence which as placed into cDNADB structure. [cDNA *]
330 *
331 * Return [UNKN ] Undocumented return value [cDNADB *]
332 *
333 */
334 # line 353 "cdnadb.dy"
new_cDNADB_from_single_seq(cDNA * seq)335 cDNADB * new_cDNADB_from_single_seq(cDNA * seq)
336 {
337 ComplexSequence * cs,*cs_rev;
338 Sequence * temp;
339 ComplexSequenceEvalSet * cses;
340
341 cses = default_cDNA_ComplexSequenceEvalSet();
342
343 cs = new_ComplexSequence(seq->baseseq,cses);
344 temp = reverse_complement_Sequence(seq->baseseq);
345 cs_rev = new_ComplexSequence(temp,cses);
346 free_Sequence(temp);
347 free_ComplexSequenceEvalSet(cses);
348
349 return new_cDNADB_from_forrev_cseq(cs,cs_rev);
350 }
351
352
353 /* Function: new_cDNADB_from_forrev_cseq(cs,cs_rev)
354 *
355 * Descrip: To make a new cDNA database
356 * from a single ComplexSequence
357 *
358 *
359 * Arg: cs [OWNER] complex sequence which is held. [ComplexSequence *]
360 * Arg: cs_rev [OWNER] complex sequence which is held. [ComplexSequence *]
361 *
362 * Return [UNKN ] Undocumented return value [cDNADB *]
363 *
364 */
365 # line 379 "cdnadb.dy"
new_cDNADB_from_forrev_cseq(ComplexSequence * cs,ComplexSequence * cs_rev)366 cDNADB * new_cDNADB_from_forrev_cseq(ComplexSequence * cs,ComplexSequence * cs_rev)
367 {
368 cDNADB * out;
369
370
371 out = cDNADB_alloc();
372 out->is_single_seq = TRUE;
373 out->forw = cs;
374 out->rev = cs_rev;
375
376 return out;
377 }
378
379
380
381 /* Function: new_cDNADB(seqdb)
382 *
383 * Descrip: To make a new cDNA database
384 *
385 *
386 * Arg: seqdb [READ ] sequence database [SequenceDB *]
387 *
388 * Return [UNKN ] Undocumented return value [cDNADB *]
389 *
390 */
391 # line 399 "cdnadb.dy"
new_cDNADB(SequenceDB * seqdb)392 cDNADB * new_cDNADB(SequenceDB * seqdb)
393 {
394 cDNADB * out;
395 ComplexSequenceEvalSet * cses;
396
397
398 if( seqdb == NULL ) {
399 warn("No sequencedb - can't make a cDNADB!");
400 return NULL;
401 }
402
403 /** should check sequence database **/
404 cses = default_cDNA_ComplexSequenceEvalSet();
405
406 if( cses->type != SEQUENCE_CDNA ) {
407 warn("You can't make a cDNA database with a non SEQUENCE_cDNA cses type [%d]",cses->type);
408 return NULL;
409 }
410
411
412 out = cDNADB_alloc();
413
414 out->is_single_seq = FALSE;
415 out->sdb = hard_link_SequenceDB(seqdb);
416 out->cses = hard_link_ComplexSequenceEvalSet(cses);
417 free_ComplexSequenceEvalSet(cses);
418
419 return out;
420 }
421
422
423 # line 404 "cdnadb.c"
424 /* Function: hard_link_cDNADB(obj)
425 *
426 * Descrip: Bumps up the reference count of the object
427 * Meaning that multiple pointers can 'own' it
428 *
429 *
430 * Arg: obj [UNKN ] Object to be hard linked [cDNADB *]
431 *
432 * Return [UNKN ] Undocumented return value [cDNADB *]
433 *
434 */
hard_link_cDNADB(cDNADB * obj)435 cDNADB * hard_link_cDNADB(cDNADB * obj)
436 {
437 if( obj == NULL ) {
438 warn("Trying to hard link to a cDNADB object: passed a NULL object");
439 return NULL;
440 }
441 obj->dynamite_hard_link++;
442 return obj;
443 }
444
445
446 /* Function: cDNADB_alloc(void)
447 *
448 * Descrip: Allocates structure: assigns defaults if given
449 *
450 *
451 *
452 * Return [UNKN ] Undocumented return value [cDNADB *]
453 *
454 */
cDNADB_alloc(void)455 cDNADB * cDNADB_alloc(void)
456 {
457 cDNADB * out; /* out is exported at end of function */
458
459
460 /* call ckalloc and see if NULL */
461 if((out=(cDNADB *) ckalloc (sizeof(cDNADB))) == NULL) {
462 warn("cDNADB_alloc failed ");
463 return NULL; /* calling function should respond! */
464 }
465 out->dynamite_hard_link = 1;
466 #ifdef PTHREAD
467 pthread_mutex_init(&(out->dynamite_mutex),NULL);
468 #endif
469 out->is_single_seq = FALSE;
470 out->done_forward = FALSE;
471 out->forward_only = FALSE;
472 out->forw = NULL;
473 out->rev = NULL;
474 out->sdb = NULL;
475 out->current = NULL;
476 out->cses = NULL;
477 out->error_handling = CDNADB_READ_THROUGH;
478 out->error_tol = 0.7;
479
480
481 return out;
482 }
483
484
485 /* Function: free_cDNADB(obj)
486 *
487 * Descrip: Free Function: removes the memory held by obj
488 * Will chain up to owned members and clear all lists
489 *
490 *
491 * Arg: obj [UNKN ] Object that is free'd [cDNADB *]
492 *
493 * Return [UNKN ] Undocumented return value [cDNADB *]
494 *
495 */
free_cDNADB(cDNADB * obj)496 cDNADB * free_cDNADB(cDNADB * obj)
497 {
498 int return_early = 0;
499
500
501 if( obj == NULL) {
502 warn("Attempting to free a NULL pointer to a cDNADB obj. Should be trappable");
503 return NULL;
504 }
505
506
507 #ifdef PTHREAD
508 assert(pthread_mutex_lock(&(obj->dynamite_mutex)) == 0);
509 #endif
510 if( obj->dynamite_hard_link > 1) {
511 return_early = 1;
512 obj->dynamite_hard_link--;
513 }
514 #ifdef PTHREAD
515 assert(pthread_mutex_unlock(&(obj->dynamite_mutex)) == 0);
516 #endif
517 if( return_early == 1)
518 return NULL;
519 if( obj->forw != NULL)
520 free_ComplexSequence(obj->forw);
521 if( obj->rev != NULL)
522 free_ComplexSequence(obj->rev);
523 if( obj->sdb != NULL)
524 free_SequenceDB(obj->sdb);
525 if( obj->current != NULL)
526 free_Sequence(obj->current);
527 if( obj->cses != NULL)
528 free_ComplexSequenceEvalSet(obj->cses);
529
530
531 ckfree(obj);
532 return NULL;
533 }
534
535
536 /* Function: replace_is_single_seq_cDNADB(obj,is_single_seq)
537 *
538 * Descrip: Replace member variable is_single_seq
539 * For use principly by API functions
540 *
541 *
542 * Arg: obj [UNKN ] Object holding the variable [cDNADB *]
543 * Arg: is_single_seq [OWNER] New value of the variable [boolean]
544 *
545 * Return [SOFT ] member variable is_single_seq [boolean]
546 *
547 */
replace_is_single_seq_cDNADB(cDNADB * obj,boolean is_single_seq)548 boolean replace_is_single_seq_cDNADB(cDNADB * obj,boolean is_single_seq)
549 {
550 if( obj == NULL) {
551 warn("In replacement function is_single_seq for object cDNADB, got a NULL object");
552 return FALSE;
553 }
554 obj->is_single_seq = is_single_seq;
555 return TRUE;
556 }
557
558
559 /* Function: access_is_single_seq_cDNADB(obj)
560 *
561 * Descrip: Access member variable is_single_seq
562 * For use principly by API functions
563 *
564 *
565 * Arg: obj [UNKN ] Object holding the variable [cDNADB *]
566 *
567 * Return [SOFT ] member variable is_single_seq [boolean]
568 *
569 */
access_is_single_seq_cDNADB(cDNADB * obj)570 boolean access_is_single_seq_cDNADB(cDNADB * obj)
571 {
572 if( obj == NULL) {
573 warn("In accessor function is_single_seq for object cDNADB, got a NULL object");
574 return FALSE;
575 }
576 return obj->is_single_seq;
577 }
578
579
580 /* Function: replace_done_forward_cDNADB(obj,done_forward)
581 *
582 * Descrip: Replace member variable done_forward
583 * For use principly by API functions
584 *
585 *
586 * Arg: obj [UNKN ] Object holding the variable [cDNADB *]
587 * Arg: done_forward [OWNER] New value of the variable [boolean]
588 *
589 * Return [SOFT ] member variable done_forward [boolean]
590 *
591 */
replace_done_forward_cDNADB(cDNADB * obj,boolean done_forward)592 boolean replace_done_forward_cDNADB(cDNADB * obj,boolean done_forward)
593 {
594 if( obj == NULL) {
595 warn("In replacement function done_forward for object cDNADB, got a NULL object");
596 return FALSE;
597 }
598 obj->done_forward = done_forward;
599 return TRUE;
600 }
601
602
603 /* Function: access_done_forward_cDNADB(obj)
604 *
605 * Descrip: Access member variable done_forward
606 * For use principly by API functions
607 *
608 *
609 * Arg: obj [UNKN ] Object holding the variable [cDNADB *]
610 *
611 * Return [SOFT ] member variable done_forward [boolean]
612 *
613 */
access_done_forward_cDNADB(cDNADB * obj)614 boolean access_done_forward_cDNADB(cDNADB * obj)
615 {
616 if( obj == NULL) {
617 warn("In accessor function done_forward for object cDNADB, got a NULL object");
618 return FALSE;
619 }
620 return obj->done_forward;
621 }
622
623
624 /* Function: replace_forward_only_cDNADB(obj,forward_only)
625 *
626 * Descrip: Replace member variable forward_only
627 * For use principly by API functions
628 *
629 *
630 * Arg: obj [UNKN ] Object holding the variable [cDNADB *]
631 * Arg: forward_only [OWNER] New value of the variable [boolean]
632 *
633 * Return [SOFT ] member variable forward_only [boolean]
634 *
635 */
replace_forward_only_cDNADB(cDNADB * obj,boolean forward_only)636 boolean replace_forward_only_cDNADB(cDNADB * obj,boolean forward_only)
637 {
638 if( obj == NULL) {
639 warn("In replacement function forward_only for object cDNADB, got a NULL object");
640 return FALSE;
641 }
642 obj->forward_only = forward_only;
643 return TRUE;
644 }
645
646
647 /* Function: access_forward_only_cDNADB(obj)
648 *
649 * Descrip: Access member variable forward_only
650 * For use principly by API functions
651 *
652 *
653 * Arg: obj [UNKN ] Object holding the variable [cDNADB *]
654 *
655 * Return [SOFT ] member variable forward_only [boolean]
656 *
657 */
access_forward_only_cDNADB(cDNADB * obj)658 boolean access_forward_only_cDNADB(cDNADB * obj)
659 {
660 if( obj == NULL) {
661 warn("In accessor function forward_only for object cDNADB, got a NULL object");
662 return FALSE;
663 }
664 return obj->forward_only;
665 }
666
667
668 /* Function: replace_forw_cDNADB(obj,forw)
669 *
670 * Descrip: Replace member variable forw
671 * For use principly by API functions
672 *
673 *
674 * Arg: obj [UNKN ] Object holding the variable [cDNADB *]
675 * Arg: forw [OWNER] New value of the variable [ComplexSequence *]
676 *
677 * Return [SOFT ] member variable forw [boolean]
678 *
679 */
replace_forw_cDNADB(cDNADB * obj,ComplexSequence * forw)680 boolean replace_forw_cDNADB(cDNADB * obj,ComplexSequence * forw)
681 {
682 if( obj == NULL) {
683 warn("In replacement function forw for object cDNADB, got a NULL object");
684 return FALSE;
685 }
686 obj->forw = forw;
687 return TRUE;
688 }
689
690
691 /* Function: access_forw_cDNADB(obj)
692 *
693 * Descrip: Access member variable forw
694 * For use principly by API functions
695 *
696 *
697 * Arg: obj [UNKN ] Object holding the variable [cDNADB *]
698 *
699 * Return [SOFT ] member variable forw [ComplexSequence *]
700 *
701 */
access_forw_cDNADB(cDNADB * obj)702 ComplexSequence * access_forw_cDNADB(cDNADB * obj)
703 {
704 if( obj == NULL) {
705 warn("In accessor function forw for object cDNADB, got a NULL object");
706 return NULL;
707 }
708 return obj->forw;
709 }
710
711
712 /* Function: replace_rev_cDNADB(obj,rev)
713 *
714 * Descrip: Replace member variable rev
715 * For use principly by API functions
716 *
717 *
718 * Arg: obj [UNKN ] Object holding the variable [cDNADB *]
719 * Arg: rev [OWNER] New value of the variable [ComplexSequence *]
720 *
721 * Return [SOFT ] member variable rev [boolean]
722 *
723 */
replace_rev_cDNADB(cDNADB * obj,ComplexSequence * rev)724 boolean replace_rev_cDNADB(cDNADB * obj,ComplexSequence * rev)
725 {
726 if( obj == NULL) {
727 warn("In replacement function rev for object cDNADB, got a NULL object");
728 return FALSE;
729 }
730 obj->rev = rev;
731 return TRUE;
732 }
733
734
735 /* Function: access_rev_cDNADB(obj)
736 *
737 * Descrip: Access member variable rev
738 * For use principly by API functions
739 *
740 *
741 * Arg: obj [UNKN ] Object holding the variable [cDNADB *]
742 *
743 * Return [SOFT ] member variable rev [ComplexSequence *]
744 *
745 */
access_rev_cDNADB(cDNADB * obj)746 ComplexSequence * access_rev_cDNADB(cDNADB * obj)
747 {
748 if( obj == NULL) {
749 warn("In accessor function rev for object cDNADB, got a NULL object");
750 return NULL;
751 }
752 return obj->rev;
753 }
754
755
756 /* Function: replace_sdb_cDNADB(obj,sdb)
757 *
758 * Descrip: Replace member variable sdb
759 * For use principly by API functions
760 *
761 *
762 * Arg: obj [UNKN ] Object holding the variable [cDNADB *]
763 * Arg: sdb [OWNER] New value of the variable [SequenceDB *]
764 *
765 * Return [SOFT ] member variable sdb [boolean]
766 *
767 */
replace_sdb_cDNADB(cDNADB * obj,SequenceDB * sdb)768 boolean replace_sdb_cDNADB(cDNADB * obj,SequenceDB * sdb)
769 {
770 if( obj == NULL) {
771 warn("In replacement function sdb for object cDNADB, got a NULL object");
772 return FALSE;
773 }
774 obj->sdb = sdb;
775 return TRUE;
776 }
777
778
779 /* Function: access_sdb_cDNADB(obj)
780 *
781 * Descrip: Access member variable sdb
782 * For use principly by API functions
783 *
784 *
785 * Arg: obj [UNKN ] Object holding the variable [cDNADB *]
786 *
787 * Return [SOFT ] member variable sdb [SequenceDB *]
788 *
789 */
access_sdb_cDNADB(cDNADB * obj)790 SequenceDB * access_sdb_cDNADB(cDNADB * obj)
791 {
792 if( obj == NULL) {
793 warn("In accessor function sdb for object cDNADB, got a NULL object");
794 return NULL;
795 }
796 return obj->sdb;
797 }
798
799
800 /* Function: replace_current_cDNADB(obj,current)
801 *
802 * Descrip: Replace member variable current
803 * For use principly by API functions
804 *
805 *
806 * Arg: obj [UNKN ] Object holding the variable [cDNADB *]
807 * Arg: current [OWNER] New value of the variable [Sequence *]
808 *
809 * Return [SOFT ] member variable current [boolean]
810 *
811 */
replace_current_cDNADB(cDNADB * obj,Sequence * current)812 boolean replace_current_cDNADB(cDNADB * obj,Sequence * current)
813 {
814 if( obj == NULL) {
815 warn("In replacement function current for object cDNADB, got a NULL object");
816 return FALSE;
817 }
818 obj->current = current;
819 return TRUE;
820 }
821
822
823 /* Function: access_current_cDNADB(obj)
824 *
825 * Descrip: Access member variable current
826 * For use principly by API functions
827 *
828 *
829 * Arg: obj [UNKN ] Object holding the variable [cDNADB *]
830 *
831 * Return [SOFT ] member variable current [Sequence *]
832 *
833 */
access_current_cDNADB(cDNADB * obj)834 Sequence * access_current_cDNADB(cDNADB * obj)
835 {
836 if( obj == NULL) {
837 warn("In accessor function current for object cDNADB, got a NULL object");
838 return NULL;
839 }
840 return obj->current;
841 }
842
843
844 /* Function: replace_cses_cDNADB(obj,cses)
845 *
846 * Descrip: Replace member variable cses
847 * For use principly by API functions
848 *
849 *
850 * Arg: obj [UNKN ] Object holding the variable [cDNADB *]
851 * Arg: cses [OWNER] New value of the variable [ComplexSequenceEvalSet *]
852 *
853 * Return [SOFT ] member variable cses [boolean]
854 *
855 */
replace_cses_cDNADB(cDNADB * obj,ComplexSequenceEvalSet * cses)856 boolean replace_cses_cDNADB(cDNADB * obj,ComplexSequenceEvalSet * cses)
857 {
858 if( obj == NULL) {
859 warn("In replacement function cses for object cDNADB, got a NULL object");
860 return FALSE;
861 }
862 obj->cses = cses;
863 return TRUE;
864 }
865
866
867 /* Function: access_cses_cDNADB(obj)
868 *
869 * Descrip: Access member variable cses
870 * For use principly by API functions
871 *
872 *
873 * Arg: obj [UNKN ] Object holding the variable [cDNADB *]
874 *
875 * Return [SOFT ] member variable cses [ComplexSequenceEvalSet *]
876 *
877 */
access_cses_cDNADB(cDNADB * obj)878 ComplexSequenceEvalSet * access_cses_cDNADB(cDNADB * obj)
879 {
880 if( obj == NULL) {
881 warn("In accessor function cses for object cDNADB, got a NULL object");
882 return NULL;
883 }
884 return obj->cses;
885 }
886
887
888
889 #ifdef _cplusplus
890 }
891 #endif
892