257
258
atp = AsnReadId(aip,amp, atp);
260
if (atp == INSDSEQ_project) {
261
if ( AsnReadVal(aip, atp, &av) <= 0) {
264
ptr -> project = av.ptrvalue;
265
atp = AsnReadId(aip,amp, atp);
259
267
if (atp == INSDSEQ_keywords) {
260
268
ptr -> keywords = AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_PTRVAL_SLOT, &isError);
261
269
if (isError && ptr -> keywords == NULL) {
455
463
retval = AsnGenericBaseSeqOfAsnWrite(ptr -> other_seqids ,ASNCODE_PTRVAL_SLOT, aip, INSDSEQ_other_seqids, INSDSEQ_other_seqids_E);
456
464
retval = AsnGenericBaseSeqOfAsnWrite(ptr -> secondary_accessions ,ASNCODE_PTRVAL_SLOT, aip, INSDSEQ_secondary_accessions, INSDSEQ_secondary_accessions_E);
465
if (ptr -> project != NULL) {
466
av.ptrvalue = ptr -> project;
467
retval = AsnWrite(aip, INSDSEQ_project, &av);
457
469
retval = AsnGenericBaseSeqOfAsnWrite(ptr -> keywords ,ASNCODE_PTRVAL_SLOT, aip, INSDSEQ_keywords, INSDSEQ_keywords_E);
458
470
if (ptr -> segment != NULL) {
459
471
av.ptrvalue = ptr -> segment;
602
616
ptr -> reference = av.ptrvalue;
603
617
atp = AsnReadId(aip,amp, atp);
619
if (atp == INSDREFERENCE_position) {
620
if ( AsnReadVal(aip, atp, &av) <= 0) {
623
ptr -> position = av.ptrvalue;
624
atp = AsnReadId(aip,amp, atp);
605
626
if (atp == INSDREFERENCE_authors) {
606
627
ptr -> authors = AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_PTRVAL_SLOT, &isError);
607
628
if (isError && ptr -> authors == NULL) {
630
651
ptr -> journal = av.ptrvalue;
631
652
atp = AsnReadId(aip,amp, atp);
633
if (atp == INSDREFERENCE_medline) {
634
if ( AsnReadVal(aip, atp, &av) <= 0) {
654
if (atp == INSDREFERENCE_xref) {
655
ptr -> xref = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) INSDXrefAsnRead, (AsnOptFreeFunc) INSDXrefFree);
656
if (isError && ptr -> xref == NULL) {
637
ptr -> medline = av.intvalue;
638
ptr -> OBbits__ |= 1<<0;
639
659
atp = AsnReadId(aip,amp, atp);
641
661
if (atp == INSDREFERENCE_pubmed) {
708
728
av.ptrvalue = ptr -> reference;
709
729
retval = AsnWrite(aip, INSDREFERENCE_reference, &av);
731
if (ptr -> position != NULL) {
732
av.ptrvalue = ptr -> position;
733
retval = AsnWrite(aip, INSDREFERENCE_position, &av);
711
735
retval = AsnGenericBaseSeqOfAsnWrite(ptr -> authors ,ASNCODE_PTRVAL_SLOT, aip, INSDREFERENCE_authors, INSDREFERENCE_authors_E);
712
736
if (ptr -> consortium != NULL) {
713
737
av.ptrvalue = ptr -> consortium;
721
745
av.ptrvalue = ptr -> journal;
722
746
retval = AsnWrite(aip, INSDREFERENCE_journal, &av);
724
if (ptr -> medline || (ptr -> OBbits__ & (1<<0) )){ av.intvalue = ptr -> medline;
725
retval = AsnWrite(aip, INSDREFERENCE_medline, &av);
727
if (ptr -> pubmed || (ptr -> OBbits__ & (1<<1) )){ av.intvalue = ptr -> pubmed;
748
AsnGenericUserSeqOfAsnWrite(ptr -> xref, (AsnWriteFunc) INSDXrefAsnWrite, aip, INSDREFERENCE_xref, INSDREFERENCE_xref_E);
749
if (ptr -> pubmed || (ptr -> OBbits__ & (1<<0) )){ av.intvalue = ptr -> pubmed;
728
750
retval = AsnWrite(aip, INSDREFERENCE_pubmed, &av);
730
752
if (ptr -> remark != NULL) {
849
872
atp = AsnReadId(aip,amp, atp);
874
if (atp == INSDFEATURE_operator) {
875
if ( AsnReadVal(aip, atp, &av) <= 0) {
878
ptr -> operator__ = av.ptrvalue;
879
atp = AsnReadId(aip,amp, atp);
881
if (atp == INSDFEATURE_partial5) {
882
if ( AsnReadVal(aip, atp, &av) <= 0) {
885
ptr -> partial5 = av.boolvalue;
886
ptr -> OBbits__ |= 1<<0;
887
atp = AsnReadId(aip,amp, atp);
889
if (atp == INSDFEATURE_partial3) {
890
if ( AsnReadVal(aip, atp, &av) <= 0) {
893
ptr -> partial3 = av.boolvalue;
894
ptr -> OBbits__ |= 1<<1;
895
atp = AsnReadId(aip,amp, atp);
851
897
if (atp == INSDFEATURE_quals) {
852
898
ptr -> quals = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) INSDQualifierAsnRead, (AsnOptFreeFunc) INSDQualifierFree);
853
899
if (isError && ptr -> quals == NULL) {
915
961
retval = AsnWrite(aip, INSDFEATURE_location, &av);
917
963
AsnGenericUserSeqOfAsnWrite(ptr -> intervals, (AsnWriteFunc) INSDIntervalAsnWrite, aip, INSDFEATURE_intervals, INSDFEATURE_intervals_E);
964
if (ptr -> operator__ != NULL) {
965
av.ptrvalue = ptr -> operator__;
966
retval = AsnWrite(aip, INSDFEATURE_operator, &av);
968
if (ptr -> partial5 || (ptr -> OBbits__ & (1<<0) )){ av.boolvalue = ptr -> partial5;
969
retval = AsnWrite(aip, INSDFEATURE_partial5, &av);
971
if (ptr -> partial3 || (ptr -> OBbits__ & (1<<1) )){ av.boolvalue = ptr -> partial3;
972
retval = AsnWrite(aip, INSDFEATURE_partial3, &av);
918
974
AsnGenericUserSeqOfAsnWrite(ptr -> quals, (AsnWriteFunc) INSDQualifierAsnWrite, aip, INSDFEATURE_quals, INSDFEATURE_quals_E);
919
975
if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
931
987
/**************************************************
991
**************************************************/
996
INSDXrefPtr ptr = MemNew((size_t) sizeof(INSDXref));
1003
/**************************************************
1007
**************************************************/
1010
INSDXrefFree(INSDXrefPtr ptr)
1016
MemFree(ptr -> dbname);
1018
return MemFree(ptr);
1022
/**************************************************
1026
**************************************************/
1029
INSDXrefAsnRead(AsnIoPtr aip, AsnTypePtr orig)
1033
Boolean isError = FALSE;
1039
if (! objinsdseqAsnLoad()) {
1048
if (orig == NULL) { /* INSDXref ::= (self contained) */
1049
atp = AsnReadId(aip, amp, INSDXREF);
1051
atp = AsnLinkType(orig, INSDXREF);
1053
/* link in local tree */
1058
ptr = INSDXrefNew();
1062
if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */
1066
atp = AsnReadId(aip,amp, atp);
1069
if (atp == INSDXREF_dbname) {
1070
if ( AsnReadVal(aip, atp, &av) <= 0) {
1073
ptr -> dbname = av.ptrvalue;
1074
atp = AsnReadId(aip,amp, atp);
1076
if (atp == INSDXREF_id) {
1077
if ( AsnReadVal(aip, atp, &av) <= 0) {
1080
ptr -> id = av.ptrvalue;
1081
atp = AsnReadId(aip,amp, atp);
1084
if (AsnReadVal(aip, atp, &av) <= 0) {
1090
AsnUnlinkType(orig); /* unlink local tree */
1094
aip -> io_failure = TRUE;
1095
ptr = INSDXrefFree(ptr);
1101
/**************************************************
1103
* INSDXrefAsnWrite()
1105
**************************************************/
1106
NLM_EXTERN Boolean LIBCALL
1107
INSDXrefAsnWrite(INSDXrefPtr ptr, AsnIoPtr aip, AsnTypePtr orig)
1111
Boolean retval = FALSE;
1115
if (! objinsdseqAsnLoad()) {
1124
atp = AsnLinkType(orig, INSDXREF); /* link local tree */
1129
if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
1130
if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) {
1134
if (ptr -> dbname != NULL) {
1135
av.ptrvalue = ptr -> dbname;
1136
retval = AsnWrite(aip, INSDXREF_dbname, &av);
1138
if (ptr -> id != NULL) {
1139
av.ptrvalue = ptr -> id;
1140
retval = AsnWrite(aip, INSDXREF_id, &av);
1142
if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
1148
AsnUnlinkType(orig); /* unlink local tree */
1154
/**************************************************
933
1156
* INSDIntervalNew()
935
1158
**************************************************/
1033
1256
ptr -> OBbits__ |= 1<<2;
1034
1257
atp = AsnReadId(aip,amp, atp);
1259
if (atp == INSDINTERVAL_iscomp) {
1260
if ( AsnReadVal(aip, atp, &av) <= 0) {
1263
ptr -> iscomp = av.boolvalue;
1264
ptr -> OBbits__ |= 1<<3;
1265
atp = AsnReadId(aip,amp, atp);
1267
if (atp == INSDINTERVAL_interbp) {
1268
if ( AsnReadVal(aip, atp, &av) <= 0) {
1271
ptr -> interbp = av.boolvalue;
1272
ptr -> OBbits__ |= 1<<4;
1273
atp = AsnReadId(aip,amp, atp);
1036
1275
if (atp == INSDINTERVAL_accession) {
1037
1276
if ( AsnReadVal(aip, atp, &av) <= 0) {
1100
1339
if (ptr -> point || (ptr -> OBbits__ & (1<<2) )){ av.intvalue = ptr -> point;
1101
1340
retval = AsnWrite(aip, INSDINTERVAL_point, &av);
1342
if (ptr -> iscomp || (ptr -> OBbits__ & (1<<3) )){ av.boolvalue = ptr -> iscomp;
1343
retval = AsnWrite(aip, INSDINTERVAL_iscomp, &av);
1345
if (ptr -> interbp || (ptr -> OBbits__ & (1<<4) )){ av.boolvalue = ptr -> interbp;
1346
retval = AsnWrite(aip, INSDINTERVAL_interbp, &av);
1103
1348
if (ptr -> accession != NULL) {
1104
1349
av.ptrvalue = ptr -> accession;
1105
1350
retval = AsnWrite(aip, INSDINTERVAL_accession, &av);