diff options
author | Aaron M. Ucko <ucko@debian.org> | 2005-03-24 18:46:06 +0000 |
---|---|---|
committer | Aaron M. Ucko <ucko@debian.org> | 2005-03-24 18:46:06 +0000 |
commit | 63b21a5f6060202b6d5c888d203e78ba871abcc2 (patch) | |
tree | 03fb3548fb6902e89097d17630f910e220b420a8 /network | |
parent | d5cd243f986e2366bd1dfe5f923d2ce7e1002f93 (diff) |
Load ncbi (6.1.20041020) into ncbi-tools6/branches/upstream/current.
Diffstat (limited to 'network')
-rw-r--r-- | network/blast3/client/netblap3.h | 4 | ||||
-rw-r--r-- | network/id1arch/idfetch.c | 215 | ||||
-rw-r--r-- | network/id2arch/id2.asn | 18 | ||||
-rw-r--r-- | network/id2arch/id2.c | 29 | ||||
-rw-r--r-- | network/id2arch/id2.h | 226 | ||||
-rw-r--r-- | network/id2arch/id2gen.h | 18 | ||||
-rw-r--r-- | network/id2arch/id2sgen.c | 658 | ||||
-rw-r--r-- | network/id2arch/id2sgen.h | 91 | ||||
-rw-r--r-- | network/id2arch/seqsplit.asn | 145 | ||||
-rw-r--r-- | network/id2arch/seqsplit.h | 308 | ||||
-rw-r--r-- | network/medarch/client/mdrcherr.h | 7 | ||||
-rw-r--r-- | network/medarch/client/medarch.msg | 3 | ||||
-rw-r--r-- | network/medarch/client/medutil.c | 949 | ||||
-rw-r--r-- | network/nsclilib/ni_service.c | 14 | ||||
-rw-r--r-- | network/nsclilib/ni_www.c | 8 | ||||
-rw-r--r-- | network/taxon1/common/taxutil.c | 6 | ||||
-rw-r--r-- | network/taxon1/taxon2/tc2proc.c | 4 | ||||
-rw-r--r-- | network/wwwblast/Src/wblast2.c | 340 | ||||
-rw-r--r-- | network/wwwblast/Src/wwwblast.h | 8 |
19 files changed, 2050 insertions, 1001 deletions
diff --git a/network/blast3/client/netblap3.h b/network/blast3/client/netblap3.h index 239e34cc..73c8f66e 100644 --- a/network/blast3/client/netblap3.h +++ b/network/blast3/client/netblap3.h @@ -34,6 +34,9 @@ * * RCS Modification History: * $Log: netblap3.h,v $ +* Revision 1.32 2004/06/30 12:34:14 madden +* Add include for blfmtutl.h +* * Revision 1.31 2003/01/10 21:45:06 bealer * - Modify to return errors from BLASTGetUidsFromQuery instead of logging them. * @@ -133,6 +136,7 @@ #include <ni_types.h> #include <blastdef.h> #include <blastpri.h> +#include <blfmtutl.h> #undef NLM_EXTERN #ifdef NLM_IMPORT diff --git a/network/id1arch/idfetch.c b/network/id1arch/idfetch.c index 416f03e6..52992c2e 100644 --- a/network/id1arch/idfetch.c +++ b/network/id1arch/idfetch.c @@ -25,6 +25,15 @@ * Author Karl Sirotkin * $Log: idfetch.c,v $ + Revision 1.35 2004/10/12 21:39:28 vysokolo + Added intervals of accessions like: "ABC_000123-ABC_000456" + + Revision 1.34 2004/10/04 19:30:25 vysokolo + The "strcasecmp" replaced by "StringICmp" + + Revision 1.33 2004/09/30 17:59:26 vysokolo + Added key -F to enable features by name. + Revision 1.32 2004/05/25 18:41:35 kans removed obsolete STREAM_SEQ_PORT_FIRST flag @@ -160,7 +169,6 @@ * Modified by Eugene Yaschenko for ID1 Server * */ - #include <ncbi.h> #include <objsset.h> #include <accid1.h> @@ -224,7 +232,8 @@ prf|acc|name pdb|entry|chain", {"Log file", NULL,NULL,NULL,TRUE,'l',ARG_FILE_OUT,0.0,0,NULL}, {"Generate gi list by entrez query", NULL,NULL,NULL,TRUE,'q',ARG_STRING,0.0,0,NULL}, {"Generate gi list by entrez query", NULL,NULL,NULL,TRUE,'Q',ARG_FILE_IN,0.0,0,NULL}, - {"Output only the list of gis, used with -q", NULL,NULL,NULL,TRUE,'n',ARG_BOOLEAN,0.0,0,NULL} + {"Output only the list of gis, used with -q", NULL,NULL,NULL,TRUE,'n',ARG_BOOLEAN,0.0,0,NULL}, + {"Add features delimited by ','. Allowed values are: 'CDD', 'SNP', 'SNP_graph', 'MGC'.", NULL,NULL,NULL,TRUE,'F',ARG_STRING,0.0,0,NULL} }; int Numarg = sizeof(myargs)/sizeof(myargs[0]); @@ -241,13 +250,16 @@ int Numarg = sizeof(myargs)/sizeof(myargs[0]); static Nlm_Int2 Nlm_WhichArg PROTO(( Nlm_Char which, Nlm_Int2 numargs, Nlm_ArgPtr ap)); static void MyBioseqToFasta(BioseqPtr bsp, Pointer userdata); +static Boolean CreateMaxPlexParam(); +static Int4 GetIntervalAccession( const Char* pAccession, Char* pResult); + Int4 giBuffer[1000]; int giBufferPos = 0; DataVal Val; Int2 fileoutarg, logarg, outtypearg,maxplexarg,seqidarg, giarg, fastaarg, infotypearg, entarg, dbarg, gifilearg, - entrezqueryarg, entrezqueryfilearg, onlylistarg; + entrezqueryarg, entrezqueryfilearg, onlylistarg, showfeatures, maxplex_param; FILE * fp = NULL; AsnIoPtr asnout=NULL; @@ -262,6 +274,8 @@ Int2 Main() FILE * fp_in = NULL; SeqIdPtr sip; Char tbuf[1024]; + static CharPtr accession = NULL; + int type_int; /* check command line arguments */ @@ -289,6 +303,13 @@ Int2 Main() MACRO_SETARG('q', entrezqueryarg) MACRO_SETARG('Q', entrezqueryfilearg) MACRO_SETARG('n', onlylistarg) + MACRO_SETARG('F', showfeatures) + + if( !CreateMaxPlexParam()) + { + has_trouble=TRUE; + goto FATAL; + } if(! SeqEntryLoad()) ErrShow(); @@ -462,9 +483,8 @@ Int2 Main() "flaTtened SeqId, format: type(name,accession,release,version) or type=accession", */ - static CharPtr name = NULL, accession = NULL, release = NULL, version = NULL, number = NULL; + static CharPtr name = NULL, release = NULL, version = NULL, number = NULL; CharPtr p; - int type_int; static CharPtr PNTR fields [] = {&name, &accession, &release, &number}; Boolean found_equals = FALSE, found_left = FALSE, found_colon = FALSE, flat_seqid_err = FALSE, @@ -472,7 +492,6 @@ Int2 Main() int dex; TextSeqIdPtr tsip; - sip = ValNodeNew(NULL); type_int = atoi(myargs[seqidarg].strvalue); for(p = myargs[seqidarg].strvalue; *p; p++ ) { @@ -561,6 +580,7 @@ Int2 Main() "id1test: could not find \'(\' or \'=\' or \':\' in flattened seqid=%s",myargs[seqidarg].strvalue); /* ) match */ exit(1); } + sip = ValNodeNew(NULL); sip->choice = type_int; switch(type_int) { @@ -595,6 +615,7 @@ Int2 Main() case SEQID_GENERAL : case SEQID_PDB : case SEQID_LOCAL : + default: ErrPost(CTX_NCBIIDRETRIEVE,30, "Sorry, this test program does not support %d patent, general, pdb, or local, try id2asn ", type_int); @@ -605,24 +626,63 @@ Int2 Main() if(! fp_in && ! gi && ! (myargs[entrezqueryarg].strvalue || myargs[entrezqueryfilearg].strvalue)) { - gi = ID1ArchGIGet (sip); - if(gi <= 0) + Char tacc[64]; + if( sip->data.ptrvalue && GetIntervalAccession( accession, tacc) > 0 ) { - if(sip->choice==SEQID_GENERAL){ - Dbtag *db = (Dbtag*)sip->data.ptrvalue; - gi=myargs[entarg].intvalue=db->tag->str?atoi(db->tag->str):db->tag->id; - myargs[dbarg].strvalue=StringSave(db->db); - } else { - SeqIdPrint(sip, tbuf, PRINTID_FASTA_SHORT); - ErrPostEx(SEV_ERROR, 0, 0, "Couldn't find SeqId [%s]", tbuf); - goto FATAL; + do{ + Int4 tgi = TryGetGi( type_int, tacc, NULL, 0); + if(tgi <= 0) + { + SeqIdPrint(sip, tbuf, PRINTID_FASTA_SHORT); + ErrPostEx(SEV_ERROR, 0, 0, "Couldn't find SeqId [%s]", tbuf); + has_trouble=TRUE; + break; } + if( !IdFetch_func(tgi,myargs[dbarg].strvalue, myargs[entarg].intvalue,maxplex_param)) + { + has_trouble=TRUE; + break; + } + + if(fp) fflush(fp); + } + while( GetIntervalAccession( NULL, tacc) > 0); + if(fp) fflush(fp); + if( has_trouble ) goto FATAL; + } + else + { + gi = ID1ArchGIGet (sip); + if(gi <= 0) + { + if(sip->choice==SEQID_GENERAL){ + Dbtag *db = (Dbtag*)sip->data.ptrvalue; + gi=myargs[entarg].intvalue=db->tag->str?atoi(db->tag->str):db->tag->id; + myargs[dbarg].strvalue=StringSave(db->db); + } else { + SeqIdPrint(sip, tbuf, PRINTID_FASTA_SHORT); + ErrPostEx(SEV_ERROR, 0, 0, "Couldn't find SeqId [%s]", tbuf); + goto FATAL; + } + } } } else if(fp_in) { + Char tacc[1024]; while(fgets(tbuf,sizeof(tbuf)-1,fp_in)){ - IdFetch_func1(tbuf, myargs[maxplexarg].intvalue); + if( GetIntervalAccession( tbuf, tacc) > 0 ) + { + do{ + IdFetch_func1(tacc, maxplex_param); + if(fp) fflush(fp); + } + while( GetIntervalAccession( NULL, tacc) > 0); + } + else + { + IdFetch_func1(tbuf, maxplex_param); + } if(fp) fflush(fp); } } @@ -652,7 +712,7 @@ Int2 Main() } } - if(gi>0 && !IdFetch_func(gi,myargs[dbarg].strvalue, myargs[entarg].intvalue,myargs[maxplexarg].intvalue)) + if(gi>0 && !IdFetch_func(gi,myargs[dbarg].strvalue, myargs[entarg].intvalue,maxplex_param)) { has_trouble=TRUE; goto FATAL; @@ -699,7 +759,7 @@ void EntrezQuery(char *query) IdFetch_func(ids[i], myargs[dbarg].strvalue, myargs[entarg].intvalue, - myargs[maxplexarg].intvalue); + maxplex_param); } } @@ -805,7 +865,7 @@ static Boolean IdFetch_func1(CharPtr data, Int2 maxplex) return IdFetch_func(gi, myargs[dbarg].strvalue, myargs[entarg].intvalue, - myargs[maxplexarg].intvalue); + maxplex_param); if(ver == INT2_MIN && ( @@ -818,7 +878,7 @@ static Boolean IdFetch_func1(CharPtr data, Int2 maxplex) return IdFetch_func(gi, myargs[dbarg].strvalue, myargs[entarg].intvalue, - myargs[maxplexarg].intvalue); + maxplex_param); return 0; } else @@ -1217,3 +1277,116 @@ MyBioseqToFasta(BioseqPtr bsp, Pointer userdata) start=stop+1; } } + +Boolean CreateMaxPlexParam() +{ + Char buf[1024]; + Char *ptoken = NULL; + maxplex_param = 0xfffffff0 | myargs[maxplexarg].intvalue; + + if(myargs[showfeatures].strvalue) + { + strncpy( buf, myargs[showfeatures].strvalue, 1024); + ptoken = strtok( buf, ","); + while( ptoken) + { + if( !StringICmp( ptoken, "CDD")) + { + maxplex_param &= 0xffffff7f; + } + else if( !StringICmp( ptoken, "SNP")) + { + maxplex_param &= 0xffffffef; + } + else if( !StringICmp( ptoken, "SNP_graph")) + { + maxplex_param &= 0xffffffbf; + } + else if( !StringICmp( ptoken, "MGC")) + { + maxplex_param &= 0xfffffeff; + } + else + { + /* Error: unknown feature */ + ErrPostEx(SEV_ERROR,0,0,"Unknown feature type [%s]", ptoken); + return FALSE; + } + ptoken = strtok( NULL, ","); + } + } + return TRUE; +} + +static Int4 GetPrefixIndexFromAcession( const Char* pSrc, Char* pDest, Int4* pDiditsLen) +{ + Int4 ret; + while( *pSrc ) + { + if( isdigit( *pSrc)) break; + *pDest++ = *pSrc++; + } + *pDest = '\0'; + if( !*pSrc ) return -1; + ret = atoi( pSrc); + *pDiditsLen = 0; + while( isdigit( *pSrc++)) ++(*pDiditsLen); + return ret; +} + +/************************************************* +* GetIntervalAccession parses string as 'ABC_0000123-ABC_0000456' +* and *returns* in 'pResult' strings like 'ABC_0000123', 'ABC_0000124', 'ABC_0000125', ..., 'ABC_0000456' +* iteratively using 'iterator' +* First call 'pAccession' must be a string like 'ABC_0000123-ABC_0000456', and all other times NULL +* returns: 0 if no more iterations +* -1 if wrong format of input string +* >0 if next iteration are present +**************************************************/ +static Int4 GetIntervalAccession( const Char* pAccession, Char* pResult) +{ + static Int4 iterator=0, Start=0, End=0, DigitsStart=0; + static Char pStartPrefix[64]={'\0'}; + static Char pFormat[64]={'\0'}; + + if( pAccession ) + { + Int4 DigitsEnd=0; + Char pBuff[64]={'\0'}; + Char pEndPrefix[64]; + Char *pEnd, *pStart; + + iterator = 0; + + strncpy( pBuff, pAccession, 64); + /*parse interval*/ + + /*find dash*/ + pEnd = pStart = pBuff; + while( *pEnd++ ) + { + if( *pEnd == '-' ) break; + } + if( !*pEnd ) return -1; /*no dash found*/ + + *pEnd++ = '\0'; + + /*find index of start and end in the interval*/ + Start = GetPrefixIndexFromAcession( pStart, pStartPrefix, &DigitsStart); + End = GetPrefixIndexFromAcession( pEnd, pEndPrefix, &DigitsEnd); + + if( DigitsStart != DigitsEnd || strcmp( pStartPrefix, pEndPrefix) || Start >= End || DigitsStart < 1) + { + return -1; /* wrong interval format */ + } + sprintf( pFormat, "%%s%%0%hdhd", DigitsStart); + } + + if( Start+iterator > End ) return 0; /*stop*/ + + /* return next accession */ + sprintf( pResult, pFormat, pStartPrefix, Start+iterator); + + return ++iterator; +} + diff --git a/network/id2arch/id2.asn b/network/id2arch/id2.asn index d44755f7..b8ad3042 100644 --- a/network/id2arch/id2.asn +++ b/network/id2arch/id2.asn @@ -1,4 +1,4 @@ ---$Revision: 1.12 $ +--$Revision: 1.14 $ --******************************************************************** -- -- Network Id server network access @@ -65,11 +65,11 @@ ID2-Request-Get-Packages ::= SEQUENCE { ID2-Request-Get-Seq-id ::= SEQUENCE { seq-id ID2-Seq-id, seq-id-type INTEGER { - any (0), -- return any one Seq-id + any (0), -- return any qualified Seq-id gi (1), -- gi is preferred text (2), -- text Seq-id (accession etc) is preferred general (4), -- general Seq-id is preferred - all (127) -- return all Seq-ids of the sequence + all (127) -- return all qualified Seq-ids of the sequence } DEFAULT any } @@ -286,13 +286,23 @@ ID2-Reply-Get-Seq-id ::= SEQUENCE { } +ID2-Blob-State ::= ENUMERATED { + live (0), + suppressed-temp (1), + suppressed (2), + dead (3), + protected (4), + withdrawn (5) +} + + -- Reply to ID2-Request-Get-Blob-Id. ID2-Reply-Get-Blob-Id ::= SEQUENCE { -- requested Seq-id seq-id Seq-id, -- result - blob-id ID2-Blob-Id, + blob-id ID2-Blob-Id OPTIONAL, -- version of split data -- (0 for non split) diff --git a/network/id2arch/id2.c b/network/id2arch/id2.c index fe8c90a7..b2cf1384 100644 --- a/network/id2arch/id2.c +++ b/network/id2arch/id2.c @@ -32,7 +32,7 @@ id2genAsnLoad(void) /************************************************** * Generated object loaders for Module NCBI-ID2Access -* Generated using ASNCODE Revision: 6.0 at May 3, 2004 6:18 PM +* Generated using ASNCODE Revision: 6.0 at Oct 18, 2004 1:24 AM * **************************************************/ @@ -2769,6 +2769,13 @@ ID2ReplyAsnRead(AsnIoPtr aip, AsnTypePtr orig) } atp = AsnReadId(aip,amp, atp); } + if (atp == ID2_REPLY_discard) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> discard = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } if (AsnReadVal(aip, atp, &av) <= 0) { goto erret; @@ -2954,6 +2961,8 @@ ID2ReplyAsnWrite(ID2ReplyPtr ptr, AsnIoPtr aip, AsnTypePtr orig) goto erret; } } + av.intvalue = ptr -> discard; + retval = AsnWrite(aip, ID2_REPLY_discard, &av); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -3497,6 +3506,13 @@ ID2ReplyGetSeqIdAsnRead(AsnIoPtr aip, AsnTypePtr orig) } atp = AsnReadId(aip,amp, atp); } + if (atp == REPLY_GET_SEQ_ID_end_of_reply) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> end_of_reply = av.boolvalue; + atp = AsnReadId(aip,amp, atp); + } if (AsnReadVal(aip, atp, &av) <= 0) { goto erret; @@ -3554,6 +3570,8 @@ ID2ReplyGetSeqIdAsnWrite(ID2ReplyGetSeqIdPtr ptr, AsnIoPtr aip, AsnTypePtr orig) } } AsnGenericChoiceSeqOfAsnWrite(ptr -> seq_id, (AsnWriteFunc) SeqIdAsnWrite, aip, ID2_REPLY_GET_SEQ_ID_seq_id, ID2_REPLY_GET_SEQ_ID_seq_id_E); + av.boolvalue = ptr -> end_of_reply; + retval = AsnWrite(aip, REPLY_GET_SEQ_ID_end_of_reply, &av); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -3678,6 +3696,13 @@ ID2ReplyGetBlobIdAsnRead(AsnIoPtr aip, AsnTypePtr orig) } atp = AsnReadId(aip,amp, atp); } + if (atp == REPLY_GET_BLOB_ID_end_of_reply) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> end_of_reply = av.boolvalue; + atp = AsnReadId(aip,amp, atp); + } if (AsnReadVal(aip, atp, &av) <= 0) { goto erret; @@ -3742,6 +3767,8 @@ ID2ReplyGetBlobIdAsnWrite(ID2ReplyGetBlobIdPtr ptr, AsnIoPtr aip, AsnTypePtr ori av.intvalue = ptr -> split_version; retval = AsnWrite(aip, GET_BLOB_ID_split_version, &av); AsnGenericUserSeqOfAsnWrite(ptr -> annot_info, (AsnWriteFunc) ID2SSeqAnnotInfoAsnWrite, aip, REPLY_GET_BLOB_ID_annot_info, REPLY_GET_BLOB_ID_annot_info_E); + av.boolvalue = ptr -> end_of_reply; + retval = AsnWrite(aip, REPLY_GET_BLOB_ID_end_of_reply, &av); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } diff --git a/network/id2arch/id2.h b/network/id2arch/id2.h index 874c3e2c..4c2ff16a 100644 --- a/network/id2arch/id2.h +++ b/network/id2arch/id2.h @@ -9,8 +9,8 @@ #include <asn.h> #endif -static char * asnfilename = "id2.h10"; -static AsnValxNode avnx[48] = { +static char * asnfilename = "id2.h14"; +static AsnValxNode avnx[57] = { {20,"set-value" ,1,0.0,&avnx[1] } , {20,"get-value" ,2,0.0,&avnx[2] } , {20,"force-value" ,3,0.0,&avnx[3] } , @@ -58,9 +58,18 @@ static AsnValxNode avnx[48] = { {20,"nlmzip" ,2,0.0,&avnx[45] } , {20,"bzip2" ,3,0.0,NULL } , {3,NULL,0,0.0,NULL } , - {3,NULL,0,0.0,NULL } }; - -static AsnType atx[142] = { + {3,NULL,0,0.0,NULL } , + {20,"reply" ,0,0.0,&avnx[49] } , + {20,"last-octet-string" ,1,0.0,&avnx[50] } , + {20,"nothing" ,2,0.0,NULL } , + {20,"live" ,0,0.0,&avnx[52] } , + {20,"suppressed-temp" ,1,0.0,&avnx[53] } , + {20,"suppressed" ,2,0.0,&avnx[54] } , + {20,"dead" ,3,0.0,&avnx[55] } , + {20,"protected" ,4,0.0,&avnx[56] } , + {20,"withdrawn" ,5,0.0,NULL } }; + +static AsnType atx[146] = { {401, "Seq-id" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[1]} , {402, "Seq-loc" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[2]} , {403, "ID2S-Chunk-Id" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[3]} , @@ -73,7 +82,7 @@ static AsnType atx[142] = { {0, "params" ,128,1,0,1,0,0,0,0,NULL,&atx[10],NULL,0,&atx[21]} , {407, "ID2-Params" ,1,0,0,0,0,0,0,0,NULL,&atx[17],&atx[11],0,&atx[25]} , {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[12],NULL,0,NULL} , - {430, "ID2-Param" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[13],0,NULL} , + {431, "ID2-Param" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[13],0,NULL} , {0, "name" ,128,0,0,0,0,0,0,0,NULL,&atx[14],NULL,0,&atx[15]} , {323, "VisibleString" ,0,26,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , {0, "value" ,128,1,0,1,0,0,0,0,NULL,&atx[17],&atx[16],0,&atx[18]} , @@ -147,65 +156,69 @@ static AsnType atx[142] = { {0, "retry-delay" ,128,1,0,1,0,0,0,0,NULL,&atx[8],NULL,0,&atx[84]} , {0, "message" ,128,2,0,1,0,0,0,0,NULL,&atx[14],NULL,0,NULL} , {0, "end-of-reply" ,128,3,0,1,0,0,0,0,NULL,&atx[23],NULL,0,&atx[86]} , - {0, "reply" ,128,4,0,0,0,0,0,0,NULL,&atx[35],&atx[87],0,NULL} , + {0, "reply" ,128,4,0,0,0,0,0,0,NULL,&atx[35],&atx[87],0,&atx[139]} , {0, "init" ,128,0,0,0,0,0,0,0,NULL,&atx[23],NULL,0,&atx[88]} , {0, "empty" ,128,1,0,0,0,0,0,0,NULL,&atx[23],NULL,0,&atx[89]} , {0, "get-package" ,128,2,0,0,0,0,0,0,NULL,&atx[90],NULL,0,&atx[93]} , {419, "ID2-Reply-Get-Package" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[91],0,&atx[94]} , {0, "name" ,128,0,0,0,0,0,0,0,NULL,&atx[14],NULL,0,&atx[92]} , {0, "params" ,128,1,0,1,0,0,0,0,NULL,&atx[10],NULL,0,NULL} , - {0, "get-seq-id" ,128,3,0,0,0,0,0,0,NULL,&atx[94],NULL,0,&atx[98]} , - {420, "ID2-Reply-Get-Seq-id" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[95],0,&atx[99]} , + {0, "get-seq-id" ,128,3,0,0,0,0,0,0,NULL,&atx[94],NULL,0,&atx[99]} , + {420, "ID2-Reply-Get-Seq-id" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[95],0,&atx[100]} , {0, "request" ,128,0,0,0,0,0,0,0,NULL,&atx[30],NULL,0,&atx[96]} , - {0, "seq-id" ,128,1,0,1,0,0,0,0,NULL,&atx[17],&atx[97],0,NULL} , + {0, "seq-id" ,128,1,0,1,0,0,0,0,NULL,&atx[17],&atx[97],0,&atx[98]} , {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[0],NULL,0,NULL} , - {0, "get-blob-id" ,128,4,0,0,0,0,0,0,NULL,&atx[99],NULL,0,&atx[105]} , - {421, "ID2-Reply-Get-Blob-Id" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[100],0,&atx[106]} , - {0, "seq-id" ,128,0,0,0,0,0,0,0,NULL,&atx[0],NULL,0,&atx[101]} , - {0, "blob-id" ,128,1,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[102]} , - {0, "split-version" ,128,2,0,0,1,0,0,0,&avnx[32],&atx[8],NULL,0,&atx[103]} , - {0, "annot-info" ,128,3,0,1,0,0,0,0,NULL,&atx[17],&atx[104],0,NULL} , + {0, "end-of-reply" ,128,2,0,1,0,0,0,0,NULL,&atx[23],NULL,0,NULL} , + {0, "get-blob-id" ,128,4,0,0,0,0,0,0,NULL,&atx[100],NULL,0,&atx[107]} , + {421, "ID2-Reply-Get-Blob-Id" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[101],0,&atx[108]} , + {0, "seq-id" ,128,0,0,0,0,0,0,0,NULL,&atx[0],NULL,0,&atx[102]} , + {0, "blob-id" ,128,1,0,1,0,0,0,0,NULL,&atx[47],NULL,0,&atx[103]} , + {0, "split-version" ,128,2,0,0,1,0,0,0,&avnx[32],&atx[8],NULL,0,&atx[104]} , + {0, "annot-info" ,128,3,0,1,0,0,0,0,NULL,&atx[17],&atx[105],0,&atx[106]} , {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[3],NULL,0,NULL} , - {0, "get-blob-seq-ids" ,128,5,0,0,0,0,0,0,NULL,&atx[106],NULL,0,&atx[116]} , - {422, "ID2-Reply-Get-Blob-Seq-ids" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[107],0,&atx[117]} , - {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[108]} , - {0, "ids" ,128,1,0,1,0,0,0,0,NULL,&atx[109],NULL,0,NULL} , - {427, "ID2-Reply-Data" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[110],0,&atx[137]} , - {0, "data-type" ,128,0,0,0,1,0,0,0,&avnx[37],&atx[8],&avnx[33],0,&atx[111]} , - {0, "data-format" ,128,1,0,0,1,0,0,0,&avnx[41],&atx[8],&avnx[38],0,&atx[112]} , - {0, "data-compression" ,128,2,0,0,1,0,0,0,&avnx[46],&atx[8],&avnx[42],0,&atx[113]} , - {0, "data" ,128,3,0,0,0,0,0,0,NULL,&atx[17],&atx[114],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[115],NULL,0,NULL} , + {0, "end-of-reply" ,128,4,0,1,0,0,0,0,NULL,&atx[23],NULL,0,NULL} , + {0, "get-blob-seq-ids" ,128,5,0,0,0,0,0,0,NULL,&atx[108],NULL,0,&atx[118]} , + {422, "ID2-Reply-Get-Blob-Seq-ids" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[109],0,&atx[119]} , + {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[110]} , + {0, "ids" ,128,1,0,1,0,0,0,0,NULL,&atx[111],NULL,0,NULL} , + {428, "ID2-Reply-Data" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[112],0,&atx[141]} , + {0, "data-type" ,128,0,0,0,1,0,0,0,&avnx[37],&atx[8],&avnx[33],0,&atx[113]} , + {0, "data-format" ,128,1,0,0,1,0,0,0,&avnx[41],&atx[8],&avnx[38],0,&atx[114]} , + {0, "data-compression" ,128,2,0,0,1,0,0,0,&avnx[46],&atx[8],&avnx[42],0,&atx[115]} , + {0, "data" ,128,3,0,0,0,0,0,0,NULL,&atx[17],&atx[116],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[117],NULL,0,NULL} , {304, "OCTET STRING" ,0,4,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , - {0, "get-blob" ,128,6,0,0,0,0,0,0,NULL,&atx[117],NULL,0,&atx[121]} , - {423, "ID2-Reply-Get-Blob" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[118],0,&atx[122]} , - {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[119]} , - {0, "split-version" ,128,1,0,0,1,0,0,0,&avnx[47],&atx[8],NULL,0,&atx[120]} , - {0, "data" ,128,2,0,1,0,0,0,0,NULL,&atx[109],NULL,0,NULL} , - {0, "reget-blob" ,128,7,0,0,0,0,0,0,NULL,&atx[122],NULL,0,&atx[127]} , - {424, "ID2-Reply-ReGet-Blob" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[123],0,&atx[128]} , - {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[124]} , - {0, "split-version" ,128,1,0,0,0,0,0,0,NULL,&atx[8],NULL,0,&atx[125]} , - {0, "offset" ,128,2,0,0,0,0,0,0,NULL,&atx[8],NULL,0,&atx[126]} , - {0, "data" ,128,3,0,1,0,0,0,0,NULL,&atx[109],NULL,0,NULL} , - {0, "get-split-info" ,128,8,0,0,0,0,0,0,NULL,&atx[128],NULL,0,&atx[132]} , - {425, "ID2S-Reply-Get-Split-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[129],0,&atx[133]} , - {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[130]} , - {0, "split-version" ,128,1,0,0,0,0,0,0,NULL,&atx[8],NULL,0,&atx[131]} , - {0, "data" ,128,2,0,1,0,0,0,0,NULL,&atx[109],NULL,0,NULL} , - {0, "get-chunk" ,128,9,0,0,0,0,0,0,NULL,&atx[133],NULL,0,NULL} , - {426, "ID2S-Reply-Get-Chunk" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[134],0,&atx[109]} , - {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[135]} , - {0, "chunk-id" ,128,1,0,0,0,0,0,0,NULL,&atx[2],NULL,0,&atx[136]} , - {0, "data" ,128,2,0,1,0,0,0,0,NULL,&atx[109],NULL,0,NULL} , - {428, "ID2-Blob-Seq-ids" ,1,0,0,0,0,0,0,0,NULL,&atx[17],&atx[138],0,&atx[139]} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[139],NULL,0,NULL} , - {429, "ID2-Blob-Seq-id" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[140],0,&atx[12]} , - {0, "seq-id" ,128,0,0,0,0,0,0,0,NULL,&atx[0],NULL,0,&atx[141]} , + {0, "get-blob" ,128,6,0,0,0,0,0,0,NULL,&atx[119],NULL,0,&atx[123]} , + {423, "ID2-Reply-Get-Blob" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[120],0,&atx[124]} , + {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[121]} , + {0, "split-version" ,128,1,0,0,1,0,0,0,&avnx[47],&atx[8],NULL,0,&atx[122]} , + {0, "data" ,128,2,0,1,0,0,0,0,NULL,&atx[111],NULL,0,NULL} , + {0, "reget-blob" ,128,7,0,0,0,0,0,0,NULL,&atx[124],NULL,0,&atx[129]} , + {424, "ID2-Reply-ReGet-Blob" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[125],0,&atx[130]} , + {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[126]} , + {0, "split-version" ,128,1,0,0,0,0,0,0,NULL,&atx[8],NULL,0,&atx[127]} , + {0, "offset" ,128,2,0,0,0,0,0,0,NULL,&atx[8],NULL,0,&atx[128]} , + {0, "data" ,128,3,0,1,0,0,0,0,NULL,&atx[111],NULL,0,NULL} , + {0, "get-split-info" ,128,8,0,0,0,0,0,0,NULL,&atx[130],NULL,0,&atx[134]} , + {425, "ID2S-Reply-Get-Split-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[131],0,&atx[135]} , + {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[132]} , + {0, "split-version" ,128,1,0,0,0,0,0,0,NULL,&atx[8],NULL,0,&atx[133]} , + {0, "data" ,128,2,0,1,0,0,0,0,NULL,&atx[111],NULL,0,NULL} , + {0, "get-chunk" ,128,9,0,0,0,0,0,0,NULL,&atx[135],NULL,0,NULL} , + {426, "ID2S-Reply-Get-Chunk" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[136],0,&atx[140]} , + {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[137]} , + {0, "chunk-id" ,128,1,0,0,0,0,0,0,NULL,&atx[2],NULL,0,&atx[138]} , + {0, "data" ,128,2,0,1,0,0,0,0,NULL,&atx[111],NULL,0,NULL} , + {0, "discard" ,128,5,0,1,0,0,0,0,NULL,&atx[19],&avnx[48],0,NULL} , + {427, "ID2-Blob-State" ,1,0,0,0,0,0,0,0,NULL,&atx[19],&avnx[51],0,&atx[111]} , + {429, "ID2-Blob-Seq-ids" ,1,0,0,0,0,0,0,0,NULL,&atx[17],&atx[142],0,&atx[143]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[143],NULL,0,NULL} , + {430, "ID2-Blob-Seq-id" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[144],0,&atx[12]} , + {0, "seq-id" ,128,0,0,0,0,0,0,0,NULL,&atx[0],NULL,0,&atx[145]} , {0, "replaced" ,128,1,0,1,0,0,0,0,NULL,&atx[23],NULL,0,NULL} }; static AsnModule ampx[1] = { - { "NCBI-ID2Access" , "id2.h10",&atx[0],NULL,NULL,0,0} }; + { "NCBI-ID2Access" , "id2.h14",&atx[0],NULL,NULL,0,0} }; static AsnValxNodePtr avn = avnx; static AsnTypePtr at = atx; @@ -302,12 +315,13 @@ static AsnModulePtr amp = ampx; #define ID2_REPLY_reply_empty &at[88] #define ID2_REPLY_reply_get_package &at[89] #define ID2_REPLY_reply_get_seq_id &at[93] -#define ID2_REPLY_reply_get_blob_id &at[98] -#define REPLY_reply_get_blob_seq_ids &at[105] -#define ID2_REPLY_reply_get_blob &at[116] -#define ID2_REPLY_reply_reget_blob &at[121] -#define ID2_REPLY_reply_get_split_info &at[127] -#define ID2_REPLY_reply_get_chunk &at[132] +#define ID2_REPLY_reply_get_blob_id &at[99] +#define REPLY_reply_get_blob_seq_ids &at[107] +#define ID2_REPLY_reply_get_blob &at[118] +#define ID2_REPLY_reply_reget_blob &at[123] +#define ID2_REPLY_reply_get_split_info &at[129] +#define ID2_REPLY_reply_get_chunk &at[134] +#define ID2_REPLY_discard &at[139] #define ID2_ERROR &at[81] #define ID2_ERROR_severity &at[82] @@ -322,52 +336,56 @@ static AsnModulePtr amp = ampx; #define ID2_REPLY_GET_SEQ_ID_request &at[95] #define ID2_REPLY_GET_SEQ_ID_seq_id &at[96] #define ID2_REPLY_GET_SEQ_ID_seq_id_E &at[97] - -#define ID2_REPLY_GET_BLOB_ID &at[99] -#define ID2_REPLY_GET_BLOB_ID_seq_id &at[100] -#define ID2_REPLY_GET_BLOB_ID_blob_id &at[101] -#define GET_BLOB_ID_split_version &at[102] -#define REPLY_GET_BLOB_ID_annot_info &at[103] -#define REPLY_GET_BLOB_ID_annot_info_E &at[104] - -#define ID2_REPLY_GET_BLOB_SEQ_IDS &at[106] -#define REPLY_GET_BLOB_SEQ_IDS_blob_id &at[107] -#define ID2_REPLY_GET_BLOB_SEQ_IDS_ids &at[108] - -#define ID2_REPLY_GET_BLOB &at[117] -#define ID2_REPLY_GET_BLOB_blob_id &at[118] -#define REPLY_GET_BLOB_split_version &at[119] -#define ID2_REPLY_GET_BLOB_data &at[120] - -#define ID2_REPLY_REGET_BLOB &at[122] -#define ID2_REPLY_REGET_BLOB_blob_id &at[123] -#define REPLY_REGET_BLOB_split_version &at[124] -#define ID2_REPLY_REGET_BLOB_offset &at[125] -#define ID2_REPLY_REGET_BLOB_data &at[126] - -#define ID2S_REPLY_GET_SPLIT_INFO &at[128] -#define REPLY_GET_SPLIT_INFO_blob_id &at[129] -#define GET_SPLIT_INFO_split_version &at[130] -#define ID2S_REPLY_GET_SPLIT_INFO_data &at[131] - -#define ID2S_REPLY_GET_CHUNK &at[133] -#define ID2S_REPLY_GET_CHUNK_blob_id &at[134] -#define ID2S_REPLY_GET_CHUNK_chunk_id &at[135] -#define ID2S_REPLY_GET_CHUNK_data &at[136] - -#define ID2_REPLY_DATA &at[109] -#define ID2_REPLY_DATA_data_type &at[110] -#define ID2_REPLY_DATA_data_format &at[111] -#define ID2_REPLY_DATA_data_compression &at[112] -#define ID2_REPLY_DATA_data &at[113] -#define ID2_REPLY_DATA_data_E &at[114] - -#define ID2_BLOB_SEQ_IDS &at[137] -#define ID2_BLOB_SEQ_IDS_E &at[138] - -#define ID2_BLOB_SEQ_ID &at[139] -#define ID2_BLOB_SEQ_ID_seq_id &at[140] -#define ID2_BLOB_SEQ_ID_replaced &at[141] +#define REPLY_GET_SEQ_ID_end_of_reply &at[98] + +#define ID2_REPLY_GET_BLOB_ID &at[100] +#define ID2_REPLY_GET_BLOB_ID_seq_id &at[101] +#define ID2_REPLY_GET_BLOB_ID_blob_id &at[102] +#define GET_BLOB_ID_split_version &at[103] +#define REPLY_GET_BLOB_ID_annot_info &at[104] +#define REPLY_GET_BLOB_ID_annot_info_E &at[105] +#define REPLY_GET_BLOB_ID_end_of_reply &at[106] + +#define ID2_REPLY_GET_BLOB_SEQ_IDS &at[108] +#define REPLY_GET_BLOB_SEQ_IDS_blob_id &at[109] +#define ID2_REPLY_GET_BLOB_SEQ_IDS_ids &at[110] + +#define ID2_REPLY_GET_BLOB &at[119] +#define ID2_REPLY_GET_BLOB_blob_id &at[120] +#define REPLY_GET_BLOB_split_version &at[121] +#define ID2_REPLY_GET_BLOB_data &at[122] + +#define ID2_REPLY_REGET_BLOB &at[124] +#define ID2_REPLY_REGET_BLOB_blob_id &at[125] +#define REPLY_REGET_BLOB_split_version &at[126] +#define ID2_REPLY_REGET_BLOB_offset &at[127] +#define ID2_REPLY_REGET_BLOB_data &at[128] + +#define ID2S_REPLY_GET_SPLIT_INFO &at[130] +#define REPLY_GET_SPLIT_INFO_blob_id &at[131] +#define GET_SPLIT_INFO_split_version &at[132] +#define ID2S_REPLY_GET_SPLIT_INFO_data &at[133] + +#define ID2S_REPLY_GET_CHUNK &at[135] +#define ID2S_REPLY_GET_CHUNK_blob_id &at[136] +#define ID2S_REPLY_GET_CHUNK_chunk_id &at[137] +#define ID2S_REPLY_GET_CHUNK_data &at[138] + +#define ID2_BLOB_STATE &at[140] + +#define ID2_REPLY_DATA &at[111] +#define ID2_REPLY_DATA_data_type &at[112] +#define ID2_REPLY_DATA_data_format &at[113] +#define ID2_REPLY_DATA_data_compression &at[114] +#define ID2_REPLY_DATA_data &at[115] +#define ID2_REPLY_DATA_data_E &at[116] + +#define ID2_BLOB_SEQ_IDS &at[141] +#define ID2_BLOB_SEQ_IDS_E &at[142] + +#define ID2_BLOB_SEQ_ID &at[143] +#define ID2_BLOB_SEQ_ID_seq_id &at[144] +#define ID2_BLOB_SEQ_ID_replaced &at[145] #define ID2_PARAM &at[12] #define ID2_PARAM_name &at[13] diff --git a/network/id2arch/id2gen.h b/network/id2arch/id2gen.h index c88e6c92..97df398d 100644 --- a/network/id2arch/id2gen.h +++ b/network/id2arch/id2gen.h @@ -17,7 +17,7 @@ extern "C" { /* } */ /************************************************** * * Generated objects for Module NCBI-ID2Access -* Generated using ASNCODE Revision: 6.0 at May 3, 2004 6:18 PM +* Generated using ASNCODE Revision: 6.0 at Oct 18, 2004 1:24 AM * **************************************************/ @@ -334,6 +334,12 @@ typedef struct struct_ID2_Reply { struct struct_ID2_Error PNTR error; Uint1 end_of_reply; ValNodePtr Reply_reply; + Uint2 discard; + /* following #defines are for enumerated type, not used by object loaders */ +#define ID2_Reply_discard_reply 0 +#define ID2_Reply_discard_last_octet_string 1 +#define ID2_Reply_discard_nothing 2 + } ID2Reply, PNTR ID2ReplyPtr; @@ -427,6 +433,7 @@ NLM_EXTERN Boolean LIBCALL ID2ReplyGetPackageAsnWrite PROTO (( ID2ReplyGetPackag typedef struct struct_ID2_Reply_Get_Seq_id { struct struct_ID2_Request_Get_Seq_id PNTR request; ValNodePtr seq_id; + Uint1 end_of_reply; } ID2ReplyGetSeqId, PNTR ID2ReplyGetSeqIdPtr; @@ -447,6 +454,7 @@ typedef struct struct_ID2_Reply_Get_Blob_Id { struct struct_ID2_Blob_Id PNTR blob_id; Int4 split_version; struct struct_ID2S_Seq_annot_Info PNTR annot_info; + Uint1 end_of_reply; } ID2ReplyGetBlobId, PNTR ID2ReplyGetBlobIdPtr; @@ -550,6 +558,14 @@ NLM_EXTERN ID2SReplyGetChunkPtr LIBCALL ID2SReplyGetChunkNew PROTO (( void )); NLM_EXTERN ID2SReplyGetChunkPtr LIBCALL ID2SReplyGetChunkAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); NLM_EXTERN Boolean LIBCALL ID2SReplyGetChunkAsnWrite PROTO (( ID2SReplyGetChunkPtr , AsnIoPtr, AsnTypePtr)); +/* following #defines are for enumerated type, not used by object loaders */ +#define ID2_Blob_State_live 0 +#define ID2_Blob_State_suppressed_temp 1 +#define ID2_Blob_State_suppressed 2 +#define ID2_Blob_State_dead 3 +#define ID2_Blob_State_protected__ 4 +#define ID2_Blob_State_withdrawn 5 + /************************************************** diff --git a/network/id2arch/id2sgen.c b/network/id2arch/id2sgen.c index c6c866df..00bfba67 100644 --- a/network/id2arch/id2sgen.c +++ b/network/id2arch/id2sgen.c @@ -32,7 +32,7 @@ id2sgenAsnLoad(void) /************************************************** * Generated object loaders for Module NCBI-Seq-split -* Generated using ASNCODE Revision: 6.0 at May 3, 2004 6:18 PM +* Generated using ASNCODE Revision: 6.0 at Oct 18, 2004 1:24 AM * **************************************************/ @@ -1267,6 +1267,9 @@ ID2SChunkContentFree(ValNodePtr anp) case ID2SChunkContent_seq_annot_place: ID2SSeqAnnotPlaceInfoFree(anp -> data.ptrvalue); break; + case ID2SChunkContent_bioseq_place: + AsnGenericUserSeqOfFree((Pointer) pnt, (AsnOptFreeFunc) ID2SBioseqPlaceInfoFree); + break; } return MemFree(anp); } @@ -1347,6 +1350,14 @@ ID2SChunkContentAsnRead(AsnIoPtr aip, AsnTypePtr orig) choice = ID2SChunkContent_seq_annot_place; func = (AsnReadFunc) ID2SSeqAnnotPlaceInfoAsnRead; } + else if (atp == ID2S_CHUNK_CONTENT_bioseq_place) { + choice = ID2SChunkContent_bioseq_place; + anp -> data.ptrvalue = + AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SBioseqPlaceInfoAsnRead, (AsnOptFreeFunc) ID2SBioseqPlaceInfoFree); + if (isError && anp -> data.ptrvalue == NULL) { + goto erret; + } + } anp->choice = choice; if (func != NULL) { @@ -1432,6 +1443,9 @@ ID2SChunkContentAsnWrite(ID2SChunkContentPtr anp, AsnIoPtr aip, AsnTypePtr orig) writetype = CHUNK_CONTENT_seq_annot_place; func = (AsnWriteFunc) ID2SSeqAnnotPlaceInfoAsnWrite; break; + case ID2SChunkContent_bioseq_place: + retval = AsnGenericUserSeqOfAsnWrite((Pointer) pnt, (AsnWriteFunc) ID2SBioseqPlaceInfoAsnWrite, aip, ID2S_CHUNK_CONTENT_bioseq_place, CHUNK_CONTENT_bioseq_place_E); + break; } if (writetype != NULL) { retval = (* func)(pnt, aip, writetype); /* write it out */ @@ -1476,8 +1490,8 @@ ID2SSeqDescrInfoFree(ID2SSeqDescrInfoPtr ptr) if(ptr == NULL) { return NULL; } - AsnGenericUserSeqOfFree(ptr -> bioseqs, (AsnOptFreeFunc) ID2IdRangeFree); - AsnGenericUserSeqOfFree(ptr -> bioseq_sets, (AsnOptFreeFunc) ID2IdRangeFree); + ID2BioseqIdsFree(ptr -> bioseqs); + ID2BioseqSetIdsFree(ptr -> bioseq_sets); return MemFree(ptr); } @@ -1537,15 +1551,15 @@ ID2SSeqDescrInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); } if (atp == ID2S_SEQ_DESCR_INFO_bioseqs) { - ptr -> bioseqs = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2IdRangeAsnRead, (AsnOptFreeFunc) ID2IdRangeFree); - if (isError && ptr -> bioseqs == NULL) { + ptr -> bioseqs = ID2BioseqIdsAsnRead(aip, atp); + if (aip -> io_failure) { goto erret; } atp = AsnReadId(aip,amp, atp); } if (atp == ID2S_SEQ_DESCR_INFO_bioseq_sets) { - ptr -> bioseq_sets = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2IdRangeAsnRead, (AsnOptFreeFunc) ID2IdRangeFree); - if (isError && ptr -> bioseq_sets == NULL) { + ptr -> bioseq_sets = ID2BioseqSetIdsAsnRead(aip, atp); + if (aip -> io_failure) { goto erret; } atp = AsnReadId(aip,amp, atp); @@ -1603,8 +1617,16 @@ ID2SSeqDescrInfoAsnWrite(ID2SSeqDescrInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) av.intvalue = ptr -> type_mask; retval = AsnWrite(aip, ID2S_SEQ_DESCR_INFO_type_mask, &av); - AsnGenericUserSeqOfAsnWrite(ptr -> bioseqs, (AsnWriteFunc) ID2IdRangeAsnWrite, aip, ID2S_SEQ_DESCR_INFO_bioseqs, ID2S_SEQ_DESCR_INFO_bioseqs_E); - AsnGenericUserSeqOfAsnWrite(ptr -> bioseq_sets, (AsnWriteFunc) ID2IdRangeAsnWrite, aip, ID2S_SEQ_DESCR_INFO_bioseq_sets, SEQ_DESCR_INFO_bioseq_sets_E); + if (ptr -> bioseqs != NULL) { + if ( ! ID2BioseqIdsAsnWrite(ptr -> bioseqs, aip, ID2S_SEQ_DESCR_INFO_bioseqs)) { + goto erret; + } + } + if (ptr -> bioseq_sets != NULL) { + if ( ! ID2BioseqSetIdsAsnWrite(ptr -> bioseq_sets, aip, ID2S_SEQ_DESCR_INFO_bioseq_sets)) { + goto erret; + } + } if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -1646,7 +1668,7 @@ ID2SSeqAssemblyInfoFree(ID2SSeqAssemblyInfoPtr ptr) if(ptr == NULL) { return NULL; } - AsnGenericUserSeqOfFree(ptr -> bioseqs, (AsnOptFreeFunc) ID2IdRangeFree); + ID2BioseqIdsFree(ptr -> bioseqs); return MemFree(ptr); } @@ -1699,8 +1721,8 @@ ID2SSeqAssemblyInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) func = NULL; if (atp == ID2S_SEQ_ASSEMBLY_INFO_bioseqs) { - ptr -> bioseqs = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2IdRangeAsnRead, (AsnOptFreeFunc) ID2IdRangeFree); - if (isError && ptr -> bioseqs == NULL) { + ptr -> bioseqs = ID2BioseqIdsAsnRead(aip, atp); + if (aip -> io_failure) { goto erret; } atp = AsnReadId(aip,amp, atp); @@ -1756,7 +1778,11 @@ ID2SSeqAssemblyInfoAsnWrite(ID2SSeqAssemblyInfoPtr ptr, AsnIoPtr aip, AsnTypePtr goto erret; } - AsnGenericUserSeqOfAsnWrite(ptr -> bioseqs, (AsnWriteFunc) ID2IdRangeAsnWrite, aip, ID2S_SEQ_ASSEMBLY_INFO_bioseqs, SEQ_ASSEMBLY_INFO_bioseqs_E); + if (ptr -> bioseqs != NULL) { + if ( ! ID2BioseqIdsAsnWrite(ptr -> bioseqs, aip, ID2S_SEQ_ASSEMBLY_INFO_bioseqs)) { + goto erret; + } + } if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -1799,8 +1825,8 @@ ID2SSeqAnnotPlaceInfoFree(ID2SSeqAnnotPlaceInfoPtr ptr) return NULL; } MemFree(ptr -> name); - AsnGenericUserSeqOfFree(ptr -> bioseqs, (AsnOptFreeFunc) ID2IdRangeFree); - AsnGenericUserSeqOfFree(ptr -> bioseq_sets, (AsnOptFreeFunc) ID2IdRangeFree); + ID2BioseqIdsFree(ptr -> bioseqs); + ID2BioseqSetIdsFree(ptr -> bioseq_sets); return MemFree(ptr); } @@ -1860,15 +1886,15 @@ ID2SSeqAnnotPlaceInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); } if (atp == SEQ_ANNOT_PLACE_INFO_bioseqs) { - ptr -> bioseqs = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2IdRangeAsnRead, (AsnOptFreeFunc) ID2IdRangeFree); - if (isError && ptr -> bioseqs == NULL) { + ptr -> bioseqs = ID2BioseqIdsAsnRead(aip, atp); + if (aip -> io_failure) { goto erret; } atp = AsnReadId(aip,amp, atp); } if (atp == ANNOT_PLACE_INFO_bioseq_sets) { - ptr -> bioseq_sets = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2IdRangeAsnRead, (AsnOptFreeFunc) ID2IdRangeFree); - if (isError && ptr -> bioseq_sets == NULL) { + ptr -> bioseq_sets = ID2BioseqSetIdsAsnRead(aip, atp); + if (aip -> io_failure) { goto erret; } atp = AsnReadId(aip,amp, atp); @@ -1928,8 +1954,177 @@ ID2SSeqAnnotPlaceInfoAsnWrite(ID2SSeqAnnotPlaceInfoPtr ptr, AsnIoPtr aip, AsnTyp av.ptrvalue = ptr -> name; retval = AsnWrite(aip, ID2S_SEQ_ANNOT_PLACE_INFO_name, &av); } - AsnGenericUserSeqOfAsnWrite(ptr -> bioseqs, (AsnWriteFunc) ID2IdRangeAsnWrite, aip, SEQ_ANNOT_PLACE_INFO_bioseqs, SEQ_ANNOT_PLACE_INFO_bioseqs_E); - AsnGenericUserSeqOfAsnWrite(ptr -> bioseq_sets, (AsnWriteFunc) ID2IdRangeAsnWrite, aip, ANNOT_PLACE_INFO_bioseq_sets, ANNOT_PLACE_INFO_bioseq_sets_E); + if (ptr -> bioseqs != NULL) { + if ( ! ID2BioseqIdsAsnWrite(ptr -> bioseqs, aip, SEQ_ANNOT_PLACE_INFO_bioseqs)) { + goto erret; + } + } + if (ptr -> bioseq_sets != NULL) { + if ( ! ID2BioseqSetIdsAsnWrite(ptr -> bioseq_sets, aip, ANNOT_PLACE_INFO_bioseq_sets)) { + goto erret; + } + } + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* +* ID2SBioseqPlaceInfoNew() +* +**************************************************/ +NLM_EXTERN +ID2SBioseqPlaceInfoPtr LIBCALL +ID2SBioseqPlaceInfoNew(void) +{ + ID2SBioseqPlaceInfoPtr ptr = MemNew((size_t) sizeof(ID2SBioseqPlaceInfo)); + + return ptr; + +} + + +/************************************************** +* +* ID2SBioseqPlaceInfoFree() +* +**************************************************/ +NLM_EXTERN +ID2SBioseqPlaceInfoPtr LIBCALL +ID2SBioseqPlaceInfoFree(ID2SBioseqPlaceInfoPtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + AsnGenericChoiceSeqOfFree(ptr -> seq_ids, (AsnOptFreeFunc) SeqIdFree); + return MemFree(ptr); +} + + +/************************************************** +* +* ID2SBioseqPlaceInfoAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2SBioseqPlaceInfoPtr LIBCALL +ID2SBioseqPlaceInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2SBioseqPlaceInfoPtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2SBioseqPlaceInfo ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2S_BIOSEQ_PLACE_INFO); + } else { + atp = AsnLinkType(orig, ID2S_BIOSEQ_PLACE_INFO); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + ptr = ID2SBioseqPlaceInfoNew(); + if (ptr == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + goto erret; + } + + atp = AsnReadId(aip,amp, atp); + func = NULL; + + if (atp == BIOSEQ_PLACE_INFO_bioseq_set) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> bioseq_set = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2S_BIOSEQ_PLACE_INFO_seq_ids) { + ptr -> seq_ids = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqIdAsnRead, (AsnOptFreeFunc) SeqIdFree); + if (isError && ptr -> seq_ids == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + /* end struct */ + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2SBioseqPlaceInfoFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2SBioseqPlaceInfoAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2SBioseqPlaceInfoAsnWrite(ID2SBioseqPlaceInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2S_BIOSEQ_PLACE_INFO); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + goto erret; + } + + av.intvalue = ptr -> bioseq_set; + retval = AsnWrite(aip, BIOSEQ_PLACE_INFO_bioseq_set, &av); + AsnGenericChoiceSeqOfAsnWrite(ptr -> seq_ids, (AsnWriteFunc) SeqIdAsnWrite, aip, ID2S_BIOSEQ_PLACE_INFO_seq_ids, BIOSEQ_PLACE_INFO_seq_ids_E); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -1944,6 +2139,234 @@ erret: /************************************************** * +* ID2BioseqIdsFree() +* +**************************************************/ +NLM_EXTERN +ID2BioseqIdsPtr LIBCALL +ID2BioseqIdsFree(ID2BioseqIdsPtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + AsnGenericUserSeqOfFree(ptr, (AsnOptFreeFunc) ID2IdRangeFree); + return NULL; +} + + +/************************************************** +* +* ID2BioseqIdsAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2BioseqIdsPtr LIBCALL +ID2BioseqIdsAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2BioseqIdsPtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2BioseqIds ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_BIOSEQ_IDS); + } else { + atp = AsnLinkType(orig, ID2_BIOSEQ_IDS); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + func = NULL; + + ptr = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2IdRangeAsnRead, (AsnOptFreeFunc) ID2IdRangeFree); + if (isError && ptr == NULL) { + goto erret; + } + + + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2BioseqIdsFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2BioseqIdsAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2BioseqIdsAsnWrite(ID2BioseqIdsPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2_BIOSEQ_IDS); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + retval = AsnGenericUserSeqOfAsnWrite(ptr , (AsnWriteFunc) ID2IdRangeAsnWrite, aip, atp, ID2_BIOSEQ_IDS_E); + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* +* ID2BioseqSetIdsFree() +* +**************************************************/ +NLM_EXTERN +ID2BioseqSetIdsPtr LIBCALL +ID2BioseqSetIdsFree(ID2BioseqSetIdsPtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + AsnGenericBaseSeqOfFree(ptr,ASNCODE_INTVAL_SLOT); + return NULL; +} + + +/************************************************** +* +* ID2BioseqSetIdsAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2BioseqSetIdsPtr LIBCALL +ID2BioseqSetIdsAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2BioseqSetIdsPtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2BioseqSetIds ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_BIOSEQ_SET_IDS); + } else { + atp = AsnLinkType(orig, ID2_BIOSEQ_SET_IDS); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + func = NULL; + + ptr = AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_INTVAL_SLOT, &isError); + if (isError && ptr == NULL) { + goto erret; + } + + + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2BioseqSetIdsFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2BioseqSetIdsAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2BioseqSetIdsAsnWrite(ID2BioseqSetIdsPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2_BIOSEQ_SET_IDS); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + retval = AsnGenericBaseSeqOfAsnWrite(ptr, ASNCODE_INTVAL_SLOT, aip, atp, ID2_BIOSEQ_SET_IDS_E); + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* * ID2SFeatTypeInfoNew() * **************************************************/ @@ -2509,8 +2932,9 @@ ID2SChunkDataFree(ID2SChunkDataPtr ptr) AsnGenericChoiceSeqOfFree(ptr -> descrs, (AsnOptFreeFunc) SeqDescrFree); AsnGenericUserSeqOfFree(ptr -> annots, (AsnOptFreeFunc) SeqAnnotFree); AsnGenericUserSeqOfFree(ptr -> assembly, (AsnOptFreeFunc) SeqAlignFree); - AsnGenericUserSeqOfFree(ptr -> seq_map, (AsnOptFreeFunc) SeqLiteralFree); - AsnGenericUserSeqOfFree(ptr -> seq_data, (AsnOptFreeFunc) SeqLiteralFree); + AsnGenericUserSeqOfFree(ptr -> seq_map, (AsnOptFreeFunc) ID2SSequencePieceFree); + AsnGenericUserSeqOfFree(ptr -> seq_data, (AsnOptFreeFunc) ID2SSequencePieceFree); + AsnGenericUserSeqOfFree(ptr -> bioseqs, (AsnOptFreeFunc) BioseqFree); return MemFree(ptr); } @@ -2535,6 +2959,9 @@ Id_idFree(ValNodePtr anp) { default: break; + case Id_id_seq_id: + SeqIdFree(anp -> data.ptrvalue); + break; } return MemFree(anp); } @@ -2616,19 +3043,26 @@ ID2SChunkDataAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); } if (atp == ID2S_CHUNK_DATA_seq_map) { - ptr -> seq_map = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqLiteralAsnRead, (AsnOptFreeFunc) SeqLiteralFree); + ptr -> seq_map = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SSequencePieceAsnRead, (AsnOptFreeFunc) ID2SSequencePieceFree); if (isError && ptr -> seq_map == NULL) { goto erret; } atp = AsnReadId(aip,amp, atp); } if (atp == ID2S_CHUNK_DATA_seq_data) { - ptr -> seq_data = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqLiteralAsnRead, (AsnOptFreeFunc) SeqLiteralFree); + ptr -> seq_data = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SSequencePieceAsnRead, (AsnOptFreeFunc) ID2SSequencePieceFree); if (isError && ptr -> seq_data == NULL) { goto erret; } atp = AsnReadId(aip,amp, atp); } + if (atp == ID2S_CHUNK_DATA_bioseqs) { + ptr -> bioseqs = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) BioseqAsnRead, (AsnOptFreeFunc) BioseqFree); + if (isError && ptr -> bioseqs == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } if (AsnReadVal(aip, atp, &av) <= 0) { goto erret; @@ -2712,6 +3146,10 @@ Id_idAsnRead(AsnIoPtr aip, AsnTypePtr orig) } anp->data.intvalue = av.intvalue; } + else if (atp == ID2S_CHUNK_DATA_id_seq_id) { + choice = Id_id_seq_id; + func = (AsnReadFunc) SeqIdAsnRead; + } anp->choice = choice; if (func != NULL) { @@ -2775,8 +3213,9 @@ ID2SChunkDataAsnWrite(ID2SChunkDataPtr ptr, AsnIoPtr aip, AsnTypePtr orig) AsnGenericChoiceSeqOfAsnWrite(ptr -> descrs, (AsnWriteFunc) SeqDescrAsnWrite, aip, ID2S_CHUNK_DATA_descrs, ID2S_CHUNK_DATA_descrs_E); AsnGenericUserSeqOfAsnWrite(ptr -> annots, (AsnWriteFunc) SeqAnnotAsnWrite, aip, ID2S_CHUNK_DATA_annots, ID2S_CHUNK_DATA_annots_E); AsnGenericUserSeqOfAsnWrite(ptr -> assembly, (AsnWriteFunc) SeqAlignAsnWrite, aip, ID2S_CHUNK_DATA_assembly, ID2S_CHUNK_DATA_assembly_E); - AsnGenericUserSeqOfAsnWrite(ptr -> seq_map, (AsnWriteFunc) SeqLiteralAsnWrite, aip, ID2S_CHUNK_DATA_seq_map, ID2S_CHUNK_DATA_seq_map_E); - AsnGenericUserSeqOfAsnWrite(ptr -> seq_data, (AsnWriteFunc) SeqLiteralAsnWrite, aip, ID2S_CHUNK_DATA_seq_data, ID2S_CHUNK_DATA_seq_data_E); + AsnGenericUserSeqOfAsnWrite(ptr -> seq_map, (AsnWriteFunc) ID2SSequencePieceAsnWrite, aip, ID2S_CHUNK_DATA_seq_map, ID2S_CHUNK_DATA_seq_map_E); + AsnGenericUserSeqOfAsnWrite(ptr -> seq_data, (AsnWriteFunc) ID2SSequencePieceAsnWrite, aip, ID2S_CHUNK_DATA_seq_data, ID2S_CHUNK_DATA_seq_data_E); + AsnGenericUserSeqOfAsnWrite(ptr -> bioseqs, (AsnWriteFunc) BioseqAsnWrite, aip, ID2S_CHUNK_DATA_bioseqs, ID2S_CHUNK_DATA_bioseqs_E); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -2836,6 +3275,10 @@ Id_idAsnWrite(Id_idPtr anp, AsnIoPtr aip, AsnTypePtr orig) av.intvalue = anp->data.intvalue; retval = AsnWrite(aip, ID2S_CHUNK_DATA_id_gi, &av); break; + case Id_id_seq_id: + writetype = ID2S_CHUNK_DATA_id_seq_id; + func = (AsnWriteFunc) SeqIdAsnWrite; + break; } if (writetype != NULL) { retval = (* func)(pnt, aip, writetype); /* write it out */ @@ -2853,6 +3296,167 @@ erret: /************************************************** * +* ID2SSequencePieceNew() +* +**************************************************/ +NLM_EXTERN +ID2SSequencePiecePtr LIBCALL +ID2SSequencePieceNew(void) +{ + ID2SSequencePiecePtr ptr = MemNew((size_t) sizeof(ID2SSequencePiece)); + + return ptr; + +} + + +/************************************************** +* +* ID2SSequencePieceFree() +* +**************************************************/ +NLM_EXTERN +ID2SSequencePiecePtr LIBCALL +ID2SSequencePieceFree(ID2SSequencePiecePtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + AsnGenericUserSeqOfFree(ptr -> data, (AsnOptFreeFunc) SeqLiteralFree); + return MemFree(ptr); +} + + +/************************************************** +* +* ID2SSequencePieceAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2SSequencePiecePtr LIBCALL +ID2SSequencePieceAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2SSequencePiecePtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2SSequencePiece ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2S_SEQUENCE_PIECE); + } else { + atp = AsnLinkType(orig, ID2S_SEQUENCE_PIECE); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + ptr = ID2SSequencePieceNew(); + if (ptr == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + goto erret; + } + + atp = AsnReadId(aip,amp, atp); + func = NULL; + + if (atp == ID2S_SEQUENCE_PIECE_start) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> start = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2S_SEQUENCE_PIECE_data) { + ptr -> data = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqLiteralAsnRead, (AsnOptFreeFunc) SeqLiteralFree); + if (isError && ptr -> data == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + /* end struct */ + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2SSequencePieceFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2SSequencePieceAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2SSequencePieceAsnWrite(ID2SSequencePiecePtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2S_SEQUENCE_PIECE); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + goto erret; + } + + av.intvalue = ptr -> start; + retval = AsnWrite(aip, ID2S_SEQUENCE_PIECE_start, &av); + AsnGenericUserSeqOfAsnWrite(ptr -> data, (AsnWriteFunc) SeqLiteralAsnWrite, aip, ID2S_SEQUENCE_PIECE_data, ID2S_SEQUENCE_PIECE_data_E); + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* * ID2IntervalNew() * **************************************************/ diff --git a/network/id2arch/id2sgen.h b/network/id2arch/id2sgen.h index 77c3d001..dd043526 100644 --- a/network/id2arch/id2sgen.h +++ b/network/id2arch/id2sgen.h @@ -17,7 +17,7 @@ extern "C" { /* } */ /************************************************** * * Generated objects for Module NCBI-Seq-split -* Generated using ASNCODE Revision: 6.0 at May 3, 2004 6:18 PM +* Generated using ASNCODE Revision: 6.0 at Oct 18, 2004 1:24 AM * **************************************************/ @@ -165,6 +165,7 @@ typedef ValNode ID2SChunkContent; #define ID2SChunkContent_seq_map 4 #define ID2SChunkContent_seq_data 5 #define ID2SChunkContent_seq_annot_place 6 +#define ID2SChunkContent_bioseq_place 7 NLM_EXTERN ID2SChunkContentPtr LIBCALL ID2SChunkContentFree PROTO ((ID2SChunkContentPtr )); @@ -181,7 +182,7 @@ NLM_EXTERN Boolean LIBCALL ID2SChunkContentAsnWrite PROTO (( ID2SChunkContentPtr typedef struct struct_ID2S_Seq_descr_Info { Int4 type_mask; struct struct_ID2_Id_Range PNTR bioseqs; - struct struct_ID2_Id_Range PNTR bioseq_sets; + ValNodePtr bioseq_sets; } ID2SSeqDescrInfo, PNTR ID2SSeqDescrInfoPtr; @@ -243,7 +244,7 @@ NLM_EXTERN Boolean LIBCALL ID2SSeqAssemblyInfoAsnWrite PROTO (( ID2SSeqAssemblyI typedef struct struct_ID2S_Seq_annot_place_Info { CharPtr name; struct struct_ID2_Id_Range PNTR bioseqs; - struct struct_ID2_Id_Range PNTR bioseq_sets; + ValNodePtr bioseq_sets; } ID2SSeqAnnotPlaceInfo, PNTR ID2SSeqAnnotPlaceInfoPtr; @@ -256,6 +257,65 @@ NLM_EXTERN Boolean LIBCALL ID2SSeqAnnotPlaceInfoAsnWrite PROTO (( ID2SSeqAnnotPl /************************************************** * +* ID2SBioseqPlaceInfo +* +**************************************************/ +typedef struct struct_ID2S_Bioseq_place_Info { + struct struct_ID2S_Bioseq_place_Info PNTR next; + Int4 bioseq_set; + ValNodePtr seq_ids; +} ID2SBioseqPlaceInfo, PNTR ID2SBioseqPlaceInfoPtr; + + +NLM_EXTERN ID2SBioseqPlaceInfoPtr LIBCALL ID2SBioseqPlaceInfoFree PROTO ((ID2SBioseqPlaceInfoPtr )); +NLM_EXTERN ID2SBioseqPlaceInfoPtr LIBCALL ID2SBioseqPlaceInfoNew PROTO (( void )); +NLM_EXTERN ID2SBioseqPlaceInfoPtr LIBCALL ID2SBioseqPlaceInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SBioseqPlaceInfoAsnWrite PROTO (( ID2SBioseqPlaceInfoPtr , AsnIoPtr, AsnTypePtr)); + + + +/************************************************** +* +* ID2BioseqIds +* +**************************************************/ +typedef struct struct_ID2IdRange ID2BioseqIds; +typedef struct struct_ID2IdRange PNTR ID2BioseqIdsPtr; +#define ID2BioseqIdsNew() ID2IdRangeNew() + +#ifdef NLM_GENERATED_CODE_PROTO + +NLM_EXTERN ID2BioseqIdsPtr LIBCALL ID2BioseqIdsFree PROTO ((ID2BioseqIdsPtr )); +NLM_EXTERN ID2BioseqIdsPtr LIBCALL ID2BioseqIdsNew PROTO (( void )); +NLM_EXTERN ID2BioseqIdsPtr LIBCALL ID2BioseqIdsAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2BioseqIdsAsnWrite PROTO (( ID2BioseqIdsPtr , AsnIoPtr, AsnTypePtr)); + +#endif /* NLM_GENERATED_CODE_PROTO */ + + + +/************************************************** +* +* ID2BioseqSetIds +* +**************************************************/ +typedef ValNode ID2BioseqSetIds; +typedef ValNodePtr ID2BioseqSetIdsPtr; +#define ID2BioseqSetIdsNew() ValNodeNew(NULL) + +#ifdef NLM_GENERATED_CODE_PROTO + +NLM_EXTERN ID2BioseqSetIdsPtr LIBCALL ID2BioseqSetIdsFree PROTO ((ID2BioseqSetIdsPtr )); +NLM_EXTERN ID2BioseqSetIdsPtr LIBCALL ID2BioseqSetIdsNew PROTO (( void )); +NLM_EXTERN ID2BioseqSetIdsPtr LIBCALL ID2BioseqSetIdsAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2BioseqSetIdsAsnWrite PROTO (( ID2BioseqSetIdsPtr , AsnIoPtr, AsnTypePtr)); + +#endif /* NLM_GENERATED_CODE_PROTO */ + + + +/************************************************** +* * ID2SFeatTypeInfo * **************************************************/ @@ -315,8 +375,9 @@ typedef struct struct_ID2S_Chunk_Data { ValNodePtr descrs; struct struct_Seq_annot PNTR annots; struct struct_Seq_align PNTR assembly; - struct struct_Seq_literal PNTR seq_map; - struct struct_Seq_literal PNTR seq_data; + struct struct_ID2S_Sequence_Piece PNTR seq_map; + struct struct_ID2S_Sequence_Piece PNTR seq_data; + struct struct_Bioseq PNTR bioseqs; } ID2SChunkData, PNTR ID2SChunkDataPtr; @@ -335,6 +396,7 @@ typedef ValNode Id_id; #define Id_id_bioseq_set 1 #define Id_id_gi 2 +#define Id_id_seq_id 3 #ifdef NLM_GENERATED_CODE_PROTO @@ -348,6 +410,25 @@ static Boolean LIBCALL Id_idAsnWrite PROTO (( Id_idPtr , AsnIoPtr, AsnTypePtr)); /************************************************** * +* ID2SSequencePiece +* +**************************************************/ +typedef struct struct_ID2S_Sequence_Piece { + struct struct_ID2S_Sequence_Piece PNTR next; + Int4 start; + struct struct_Seq_literal PNTR data; +} ID2SSequencePiece, PNTR ID2SSequencePiecePtr; + + +NLM_EXTERN ID2SSequencePiecePtr LIBCALL ID2SSequencePieceFree PROTO ((ID2SSequencePiecePtr )); +NLM_EXTERN ID2SSequencePiecePtr LIBCALL ID2SSequencePieceNew PROTO (( void )); +NLM_EXTERN ID2SSequencePiecePtr LIBCALL ID2SSequencePieceAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SSequencePieceAsnWrite PROTO (( ID2SSequencePiecePtr , AsnIoPtr, AsnTypePtr)); + + + +/************************************************** +* * ID2Interval * **************************************************/ diff --git a/network/id2arch/seqsplit.asn b/network/id2arch/seqsplit.asn index 0b047a7e..451170c8 100644 --- a/network/id2arch/seqsplit.asn +++ b/network/id2arch/seqsplit.asn @@ -1,4 +1,4 @@ ---$Revision: 1.4 $ +--$Revision: 1.6 $ --******************************************************************** -- -- Network Id server network access @@ -7,9 +7,9 @@ -- --********************************************************************* -- --- ID2.asn +-- seqsplit.asn -- --- messages for id server network access +-- representation of split sequences -- --********************************************************************* @@ -18,14 +18,17 @@ BEGIN EXPORTS ID2S-Chunk-Id, ID2S-Seq-annot-Info; -IMPORTS Seq-loc FROM NCBI-Seqloc - Seq-annot, Seq-descr, Seq-literal FROM NCBI-Sequence - Seq-align FROM NCBI-Seqalign; +IMPORTS Seq-id FROM NCBI-Seqloc + Bioseq, Seq-annot, Seq-descr, Seq-literal FROM NCBI-Sequence + Seq-align FROM NCBI-Seqalign; ---------------------------------------------------------------------------- -- Blob split info types ---------------------------------------------------------------------------- +---------------------------------------------------------------------------- +-- Chunks split description + ID2S-Split-Info ::= SEQUENCE { bioseqs-info SET OF ID2S-Bioseqs-Info OPTIONAL, @@ -35,21 +38,13 @@ ID2S-Split-Info ::= SEQUENCE { ID2S-Bioseqs-Info ::= SEQUENCE { info ID2S-Bioseq-Info, - bioseqs ID2-Id-Range + bioseqs ID2S-Bioseq-Ids } ID2S-Bioseq-Info ::= SEQUENCE { gap-count INTEGER OPTIONAL, - seq-map-has-ref BOOLEAN OPTIONAL, - sequence-split ID2S-Sequence-Split-Info OPTIONAL -} - - -ID2S-Sequence-Split-Info ::= SEQUENCE { - block-size INTEGER, - chunk-start ID2S-Chunk-Id, - chunk-blocks SEQUENCE OF INTEGER + seq-map-has-ref BOOLEAN OPTIONAL } @@ -59,20 +54,36 @@ ID2S-Chunk-Info ::= SEQUENCE { } +-- Description of information in this chunk +-- Place means id of Bioseq or Bioseq-set ID2S-Chunk-Content ::= CHOICE { + -- place of Seq-descrs seq-descr ID2S-Seq-descr-Info, + + -- locations and types of annotations seq-annot ID2S-Seq-annot-Info, + + -- place of assembly history seq-assembly ID2S-Seq-assembly-Info, + + -- place of sequence map seq-map ID2S-Seq-map-Info, + + -- place of sequence data seq-data ID2S-Seq-data-Info, - seq-annot-place ID2S-Seq-annot-place-Info + + -- place of Seq-annots + seq-annot-place ID2S-Seq-annot-place-Info, + + -- place of Bioseqs + bioseq-place SET OF ID2S-Bioseq-place-Info } ID2S-Seq-descr-Info ::= SEQUENCE { type-mask INTEGER, -- mask of Seq-descr types, - bioseqs SET OF ID2-Id-Range OPTIONAL, - bioseq-sets SET OF ID2-Id-Range OPTIONAL + bioseqs ID2S-Bioseq-Ids OPTIONAL, + bioseq-sets ID2S-Bioseq-set-Ids OPTIONAL } @@ -83,14 +94,14 @@ ID2S-Seq-annot-Info ::= SEQUENCE { align NULL OPTIONAL, graph NULL OPTIONAL, feat SET OF ID2S-Feat-type-Info OPTIONAL, - seq-loc ID2-Seq-loc OPTIONAL + seq-loc ID2S-Seq-loc OPTIONAL } ID2S-Seq-annot-place-Info ::= SEQUENCE { name VisibleString OPTIONAL, - bioseqs SET OF ID2-Id-Range OPTIONAL, - bioseq-sets SET OF ID2-Id-Range OPTIONAL + bioseqs ID2S-Bioseq-Ids OPTIONAL, + bioseq-sets ID2S-Bioseq-set-Ids OPTIONAL } @@ -101,14 +112,20 @@ ID2S-Feat-type-Info ::= SEQUENCE { ID2S-Seq-assembly-Info ::= SEQUENCE { - bioseqs SET OF ID2-Id-Range + bioseqs ID2S-Bioseq-Ids } -ID2S-Seq-map-Info ::= ID2-Seq-loc +ID2S-Seq-map-Info ::= ID2S-Seq-loc -ID2S-Seq-data-Info ::= ID2-Seq-loc +ID2S-Seq-data-Info ::= ID2S-Seq-loc + + +ID2S-Bioseq-place-Info ::= SEQUENCE { + bioseq-set INTEGER, + seq-ids ID2S-Bioseq-Ids +} ID2S-Chunk ::= SEQUENCE { @@ -117,15 +134,27 @@ ID2S-Chunk ::= SEQUENCE { ID2S-Chunk-Data ::= SEQUENCE { + -- place of data to insert id CHOICE { + -- Bioseq-set id bioseq-set INTEGER, - gi INTEGER + -- Bioseq id + gi INTEGER, + -- Bioseq id + seq-id Seq-id }, - descrs SET OF Seq-descr OPTIONAL, + -- Seq-descr, for Bioseq and Bioseq-set + descr Seq-descr OPTIONAL, + -- Seq-annot, for Bioseq and Bioseq-set annots SET OF Seq-annot OPTIONAL, + -- assembly history Seq-align, for Bioseq assembly SET OF Seq-align OPTIONAL, + -- sequence map, for Bioseq seq-map SEQUENCE OF ID2S-Sequence-Piece OPTIONAL, - seq-data SEQUENCE OF ID2S-Sequence-Piece OPTIONAL + -- sequence data, for Bioseq + seq-data SEQUENCE OF ID2S-Sequence-Piece OPTIONAL, + -- Bioseq, for Bioseq-set + bioseqs SET OF Bioseq OPTIONAL } @@ -143,38 +172,70 @@ ID2S-Sequence-Piece ::= SEQUENCE { ID2S-Chunk-Id ::= INTEGER -ID2-Id-Range ::= SEQUENCE { - start INTEGER, -- gi for Bioseq, local id for Bioseq-set - count INTEGER DEFAULT 1 +ID2S-Bioseq-set-Ids ::= SET OF INTEGER + + +ID2S-Bioseq-Ids ::= SET OF CHOICE { + gi INTEGER, + seq-id Seq-id, + gi-range ID2S-Gi-Range } -ID2-Seq-loc ::= CHOICE { - gi-whole INTEGER, - interval ID2-Interval, - packed-ints ID2-Packed-Seq-ints, - gi-whole-range ID2-Id-Range, - loc-set SET OF ID2-Seq-loc, - seq-loc Seq-loc +ID2S-Gi-Range ::= SEQUENCE { + start INTEGER, -- start gi in this gi range + count INTEGER DEFAULT 1 -- number of sequential gis } -ID2-Interval ::= SEQUENCE { +-- ID2S-Seq-loc is used to represent unordered and unstranded +-- set of intervals on set of sequences. +-- It's optimized for compact encoding of several common cases: +-- Seq-ids of type gi, +-- intervals covering whole sequences, +-- whole sequences with sequential gis, +-- set of intervals on the same sequence (Seq-id sharing). +ID2S-Seq-loc ::= CHOICE { + whole-gi INTEGER, -- whole sequence by gi + whole-seq-id Seq-id, -- whole sequence by Seq-id + whole-gi-range ID2S-Gi-Range, -- set of whole sequences by gis + gi-interval ID2S-Gi-Interval, -- interval on sequence by gi + seq-id-interval ID2S-Seq-id-Interval,-- interval on sequence by Seq-id + gi-ints ID2S-Gi-Ints, -- set of intervals on the same gi + seq-id-ints ID2S-Seq-id-Ints, -- set of intervals on the same id + loc-set SET OF ID2S-Seq-loc -- combination of locations +} + + +ID2S-Gi-Interval ::= SEQUENCE { gi INTEGER, start INTEGER, length INTEGER DEFAULT 1 } -ID2-Seq-range ::= SEQUENCE { +ID2S-Seq-id-Interval ::= SEQUENCE { + seq-id Seq-id, start INTEGER, length INTEGER DEFAULT 1 } -ID2-Packed-Seq-ints ::= SEQUENCE { +ID2S-Interval ::= SEQUENCE { + start INTEGER, + length INTEGER DEFAULT 1 +} + + +ID2S-Gi-Ints ::= SEQUENCE { gi INTEGER, - intervals SET OF ID2-Seq-range + ints SET OF ID2S-Interval +} + + +ID2S-Seq-id-Ints ::= SEQUENCE { + seq-id Seq-id, + ints SET OF ID2S-Interval } diff --git a/network/id2arch/seqsplit.h b/network/id2arch/seqsplit.h index 1a6dbde2..f68d3b98 100644 --- a/network/id2arch/seqsplit.h +++ b/network/id2arch/seqsplit.h @@ -9,16 +9,16 @@ #include <asn.h> #endif -static char * asnfilename = "seqsplit.h13"; +static char * asnfilename = "seqsplit.h15"; static AsnValxNode avnx[3] = { {3,NULL,1,0.0,NULL } , {3,NULL,1,0.0,NULL } , {3,NULL,1,0.0,NULL } }; -static AsnType atx[109] = { +static AsnType atx[123] = { {401, "ID2S-Chunk-Id" ,1,0,0,0,0,1,0,0,NULL,&atx[1],NULL,0,&atx[2]} , {302, "INTEGER" ,0,2,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , - {402, "ID2S-Seq-annot-Info" ,1,0,0,0,0,1,0,0,NULL,&atx[15],&atx[3],0,&atx[39]} , + {402, "ID2S-Seq-annot-Info" ,1,0,0,0,0,1,0,0,NULL,&atx[15],&atx[3],0,&atx[41]} , {0, "name" ,128,0,0,1,0,0,0,0,NULL,&atx[4],NULL,0,&atx[5]} , {323, "VisibleString" ,0,26,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , {0, "align" ,128,1,0,1,0,0,0,0,NULL,&atx[6],NULL,0,&atx[7]} , @@ -26,108 +26,122 @@ static AsnType atx[109] = { {0, "graph" ,128,2,0,1,0,0,0,0,NULL,&atx[6],NULL,0,&atx[8]} , {0, "feat" ,128,3,0,1,0,0,0,0,NULL,&atx[14],&atx[9],0,&atx[16]} , {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[10],NULL,0,NULL} , - {420, "ID2S-Feat-type-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[11],0,&atx[17]} , + {425, "ID2S-Feat-type-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[11],0,&atx[17]} , {0, "type" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[12]} , {0, "subtypes" ,128,1,0,1,0,0,0,0,NULL,&atx[14],&atx[13],0,NULL} , {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[1],NULL,0,NULL} , {314, "SET OF" ,0,17,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , {311, "SEQUENCE" ,0,16,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , {0, "seq-loc" ,128,4,0,1,0,0,0,0,NULL,&atx[17],NULL,0,NULL} , - {421, "ID2-Seq-loc" ,1,0,0,0,0,0,0,0,NULL,&atx[40],&atx[18],0,&atx[92]} , + {426, "ID2-Seq-loc" ,1,0,0,0,0,0,0,0,NULL,&atx[40],&atx[18],0,&atx[99]} , {0, "gi-whole" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[19]} , {0, "interval" ,128,1,0,0,0,0,0,0,NULL,&atx[20],NULL,0,&atx[24]} , - {424, "ID2-Interval" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[21],0,&atx[25]} , + {430, "ID2-Interval" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[21],0,&atx[25]} , {0, "gi" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[22]} , {0, "start" ,128,1,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[23]} , {0, "length" ,128,2,0,0,1,0,0,0,&avnx[0],&atx[1],NULL,0,NULL} , {0, "packed-ints" ,128,2,0,0,0,0,0,0,NULL,&atx[25],NULL,0,&atx[32]} , - {425, "ID2-Packed-Seq-ints" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[26],0,&atx[29]} , + {431, "ID2-Packed-Seq-ints" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[26],0,&atx[29]} , {0, "gi" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[27]} , {0, "intervals" ,128,1,0,0,0,0,0,0,NULL,&atx[14],&atx[28],0,NULL} , {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[29],NULL,0,NULL} , - {426, "ID2-Seq-range" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[30],0,NULL} , + {432, "ID2-Seq-range" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[30],0,NULL} , {0, "start" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[31]} , {0, "length" ,128,1,0,0,1,0,0,0,&avnx[1],&atx[1],NULL,0,NULL} , {0, "gi-whole-range" ,128,3,0,0,0,0,0,0,NULL,&atx[33],NULL,0,&atx[36]} , - {412, "ID2-Id-Range" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[34],0,&atx[55]} , + {414, "ID2-Id-Range" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[34],0,&atx[57]} , {0, "start" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[35]} , {0, "count" ,128,1,0,0,1,0,0,0,&avnx[2],&atx[1],NULL,0,NULL} , {0, "loc-set" ,128,4,0,0,0,0,0,0,NULL,&atx[14],&atx[37],0,&atx[38]} , {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[17],NULL,0,NULL} , {0, "seq-loc" ,128,5,0,0,0,0,0,0,NULL,&atx[39],NULL,0,NULL} , - {403, "Seq-loc" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[41]} , + {404, "Seq-loc" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[42]} , {315, "CHOICE" ,0,-1,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , - {404, "Seq-annot" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[42]} , - {405, "Seq-descr" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[43]} , - {406, "Seq-literal" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[44]} , - {407, "Seq-align" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[45]} , - {408, "ID2S-Split-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[46],0,&atx[48]} , - {0, "bioseqs-info" ,128,0,0,1,0,0,0,0,NULL,&atx[14],&atx[47],0,&atx[62]} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[48],NULL,0,NULL} , - {409, "ID2S-Bioseqs-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[49],0,&atx[64]} , - {0, "info" ,128,0,0,0,0,0,0,0,NULL,&atx[50],NULL,0,&atx[61]} , - {411, "ID2S-Bioseq-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[51],0,&atx[33]} , - {0, "gap-count" ,128,0,0,1,0,0,0,0,NULL,&atx[1],NULL,0,&atx[52]} , - {0, "seq-map-has-ref" ,128,1,0,1,0,0,0,0,NULL,&atx[53],NULL,0,&atx[54]} , + {403, "Seq-id" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[39]} , + {405, "Bioseq" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[43]} , + {406, "Seq-annot" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[44]} , + {407, "Seq-descr" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[45]} , + {408, "Seq-literal" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[46]} , + {409, "Seq-align" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[47]} , + {410, "ID2S-Split-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[48],0,&atx[50]} , + {0, "bioseqs-info" ,128,0,0,1,0,0,0,0,NULL,&atx[14],&atx[49],0,&atx[64]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[50],NULL,0,NULL} , + {411, "ID2S-Bioseqs-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[51],0,&atx[66]} , + {0, "info" ,128,0,0,0,0,0,0,0,NULL,&atx[52],NULL,0,&atx[63]} , + {413, "ID2S-Bioseq-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[53],0,&atx[33]} , + {0, "gap-count" ,128,0,0,1,0,0,0,0,NULL,&atx[1],NULL,0,&atx[54]} , + {0, "seq-map-has-ref" ,128,1,0,1,0,0,0,0,NULL,&atx[55],NULL,0,&atx[56]} , {301, "BOOLEAN" ,0,1,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , - {0, "sequence-split" ,128,2,0,1,0,0,0,0,NULL,&atx[55],NULL,0,NULL} , - {413, "ID2S-Sequence-Split-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[56],0,&atx[68]} , - {0, "block-size" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[57]} , - {0, "chunk-start" ,128,1,0,0,0,0,0,0,NULL,&atx[0],NULL,0,&atx[58]} , - {0, "chunk-blocks" ,128,2,0,0,0,0,0,0,NULL,&atx[60],&atx[59],0,NULL} , + {0, "sequence-split" ,128,2,0,1,0,0,0,0,NULL,&atx[57],NULL,0,NULL} , + {415, "ID2S-Sequence-Split-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[58],0,&atx[70]} , + {0, "block-size" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[59]} , + {0, "chunk-start" ,128,1,0,0,0,0,0,0,NULL,&atx[0],NULL,0,&atx[60]} , + {0, "chunk-blocks" ,128,2,0,0,0,0,0,0,NULL,&atx[62],&atx[61],0,NULL} , {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[1],NULL,0,NULL} , {312, "SEQUENCE OF" ,0,16,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , {0, "bioseqs" ,128,1,0,0,0,0,0,0,NULL,&atx[33],NULL,0,NULL} , - {0, "chunks" ,128,1,0,0,0,0,0,0,NULL,&atx[14],&atx[63],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[64],NULL,0,NULL} , - {410, "ID2S-Chunk-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[65],0,&atx[50]} , - {0, "id" ,128,0,0,0,0,0,0,0,NULL,&atx[0],NULL,0,&atx[66]} , - {0, "content" ,128,1,0,0,0,0,0,0,NULL,&atx[14],&atx[67],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[68],NULL,0,NULL} , - {414, "ID2S-Chunk-Content" ,1,0,0,0,0,0,0,0,NULL,&atx[40],&atx[69],0,&atx[70]} , - {0, "seq-descr" ,128,0,0,0,0,0,0,0,NULL,&atx[70],NULL,0,&atx[76]} , - {415, "ID2S-Seq-descr-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[71],0,&atx[78]} , - {0, "type-mask" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[72]} , - {0, "bioseqs" ,128,1,0,1,0,0,0,0,NULL,&atx[14],&atx[73],0,&atx[74]} , + {0, "chunks" ,128,1,0,0,0,0,0,0,NULL,&atx[14],&atx[65],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[66],NULL,0,NULL} , + {412, "ID2S-Chunk-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[67],0,&atx[52]} , + {0, "id" ,128,0,0,0,0,0,0,0,NULL,&atx[0],NULL,0,&atx[68]} , + {0, "content" ,128,1,0,0,0,0,0,0,NULL,&atx[14],&atx[69],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[70],NULL,0,NULL} , + {416, "ID2S-Chunk-Content" ,1,0,0,0,0,0,0,0,NULL,&atx[40],&atx[71],0,&atx[72]} , + {0, "seq-descr" ,128,0,0,0,0,0,0,0,NULL,&atx[72],NULL,0,&atx[80]} , + {417, "ID2S-Seq-descr-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[73],0,&atx[82]} , + {0, "type-mask" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[74]} , + {0, "bioseqs" ,128,1,0,1,0,0,0,0,NULL,&atx[75],NULL,0,&atx[77]} , + {423, "ID2-Bioseq-Ids" ,1,0,0,0,0,0,0,0,NULL,&atx[14],&atx[76],0,&atx[78]} , {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[33],NULL,0,NULL} , - {0, "bioseq-sets" ,128,2,0,1,0,0,0,0,NULL,&atx[14],&atx[75],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[33],NULL,0,NULL} , - {0, "seq-annot" ,128,1,0,0,0,0,0,0,NULL,&atx[2],NULL,0,&atx[77]} , - {0, "seq-assembly" ,128,2,0,0,0,0,0,0,NULL,&atx[78],NULL,0,&atx[81]} , - {416, "ID2S-Seq-assembly-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[79],0,&atx[82]} , - {0, "bioseqs" ,128,0,0,0,0,0,0,0,NULL,&atx[14],&atx[80],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[33],NULL,0,NULL} , - {0, "seq-map" ,128,3,0,0,0,0,0,0,NULL,&atx[82],NULL,0,&atx[83]} , - {417, "ID2S-Seq-map-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[17],NULL,0,&atx[84]} , - {0, "seq-data" ,128,4,0,0,0,0,0,0,NULL,&atx[84],NULL,0,&atx[85]} , - {418, "ID2S-Seq-data-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[17],NULL,0,&atx[86]} , - {0, "seq-annot-place" ,128,5,0,0,0,0,0,0,NULL,&atx[86],NULL,0,NULL} , - {419, "ID2S-Seq-annot-place-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[87],0,&atx[10]} , - {0, "name" ,128,0,0,1,0,0,0,0,NULL,&atx[4],NULL,0,&atx[88]} , - {0, "bioseqs" ,128,1,0,1,0,0,0,0,NULL,&atx[14],&atx[89],0,&atx[90]} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[33],NULL,0,NULL} , - {0, "bioseq-sets" ,128,2,0,1,0,0,0,0,NULL,&atx[14],&atx[91],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[33],NULL,0,NULL} , - {422, "ID2S-Chunk" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[93],0,&atx[95]} , - {0, "data" ,128,0,0,0,0,0,0,0,NULL,&atx[14],&atx[94],0,NULL} , + {0, "bioseq-sets" ,128,2,0,1,0,0,0,0,NULL,&atx[78],NULL,0,NULL} , + {424, "ID2-Bioseq-set-Ids" ,1,0,0,0,0,0,0,0,NULL,&atx[14],&atx[79],0,&atx[10]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[1],NULL,0,NULL} , + {0, "seq-annot" ,128,1,0,0,0,0,0,0,NULL,&atx[2],NULL,0,&atx[81]} , + {0, "seq-assembly" ,128,2,0,0,0,0,0,0,NULL,&atx[82],NULL,0,&atx[84]} , + {418, "ID2S-Seq-assembly-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[83],0,&atx[85]} , + {0, "bioseqs" ,128,0,0,0,0,0,0,0,NULL,&atx[75],NULL,0,NULL} , + {0, "seq-map" ,128,3,0,0,0,0,0,0,NULL,&atx[85],NULL,0,&atx[86]} , + {419, "ID2S-Seq-map-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[17],NULL,0,&atx[87]} , + {0, "seq-data" ,128,4,0,0,0,0,0,0,NULL,&atx[87],NULL,0,&atx[88]} , + {420, "ID2S-Seq-data-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[17],NULL,0,&atx[89]} , + {0, "seq-annot-place" ,128,5,0,0,0,0,0,0,NULL,&atx[89],NULL,0,&atx[93]} , + {421, "ID2S-Seq-annot-place-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[90],0,&atx[95]} , + {0, "name" ,128,0,0,1,0,0,0,0,NULL,&atx[4],NULL,0,&atx[91]} , + {0, "bioseqs" ,128,1,0,1,0,0,0,0,NULL,&atx[75],NULL,0,&atx[92]} , + {0, "bioseq-sets" ,128,2,0,1,0,0,0,0,NULL,&atx[78],NULL,0,NULL} , + {0, "bioseq-place" ,128,6,0,0,0,0,0,0,NULL,&atx[14],&atx[94],0,NULL} , {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[95],NULL,0,NULL} , - {423, "ID2S-Chunk-Data" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[96],0,&atx[20]} , - {0, "id" ,128,0,0,0,0,0,0,0,NULL,&atx[40],&atx[97],0,&atx[99]} , - {0, "bioseq-set" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[98]} , - {0, "gi" ,128,1,0,0,0,0,0,0,NULL,&atx[1],NULL,0,NULL} , - {0, "descrs" ,128,1,0,1,0,0,0,0,NULL,&atx[14],&atx[100],0,&atx[101]} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[42],NULL,0,NULL} , - {0, "annots" ,128,2,0,1,0,0,0,0,NULL,&atx[14],&atx[102],0,&atx[103]} , + {422, "ID2S-Bioseq-place-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[96],0,&atx[75]} , + {0, "bioseq-set" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[97]} , + {0, "seq-ids" ,128,1,0,0,0,0,0,0,NULL,&atx[14],&atx[98],0,NULL} , {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[41],NULL,0,NULL} , - {0, "assembly" ,128,3,0,1,0,0,0,0,NULL,&atx[14],&atx[104],0,&atx[105]} , + {427, "ID2S-Chunk" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[100],0,&atx[102]} , + {0, "data" ,128,0,0,0,0,0,0,0,NULL,&atx[14],&atx[101],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[102],NULL,0,NULL} , + {428, "ID2S-Chunk-Data" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[103],0,&atx[115]} , + {0, "id" ,128,0,0,0,0,0,0,0,NULL,&atx[40],&atx[104],0,&atx[107]} , + {0, "bioseq-set" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[105]} , + {0, "gi" ,128,1,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[106]} , + {0, "seq-id" ,128,2,0,0,0,0,0,0,NULL,&atx[41],NULL,0,NULL} , + {0, "descrs" ,128,1,0,1,0,0,0,0,NULL,&atx[14],&atx[108],0,&atx[109]} , {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[44],NULL,0,NULL} , - {0, "seq-map" ,128,4,0,1,0,0,0,0,NULL,&atx[60],&atx[106],0,&atx[107]} , + {0, "annots" ,128,2,0,1,0,0,0,0,NULL,&atx[14],&atx[110],0,&atx[111]} , {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[43],NULL,0,NULL} , - {0, "seq-data" ,128,5,0,1,0,0,0,0,NULL,&atx[60],&atx[108],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[43],NULL,0,NULL} }; + {0, "assembly" ,128,3,0,1,0,0,0,0,NULL,&atx[14],&atx[112],0,&atx[113]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[46],NULL,0,NULL} , + {0, "seq-map" ,128,4,0,1,0,0,0,0,NULL,&atx[62],&atx[114],0,&atx[119]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[115],NULL,0,NULL} , + {429, "ID2S-Sequence-Piece" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[116],0,&atx[20]} , + {0, "start" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[117]} , + {0, "data" ,128,1,0,0,0,0,0,0,NULL,&atx[62],&atx[118],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[45],NULL,0,NULL} , + {0, "seq-data" ,128,5,0,1,0,0,0,0,NULL,&atx[62],&atx[120],0,&atx[121]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[115],NULL,0,NULL} , + {0, "bioseqs" ,128,6,0,1,0,0,0,0,NULL,&atx[14],&atx[122],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[42],NULL,0,NULL} }; static AsnModule ampx[1] = { - { "NCBI-Seq-split" , "seqsplit.h13",&atx[0],NULL,NULL,0,0} }; + { "NCBI-Seq-split" , "seqsplit.h15",&atx[0],NULL,NULL,0,0} }; static AsnValxNodePtr avn = avnx; static AsnTypePtr at = atx; @@ -151,65 +165,73 @@ static AsnModulePtr amp = ampx; #define ID2S_SEQ_ANNOT_INFO_feat_E &at[9] #define ID2S_SEQ_ANNOT_INFO_seq_loc &at[16] -#define ID2S_SPLIT_INFO &at[45] -#define ID2S_SPLIT_INFO_bioseqs_info &at[46] -#define ID2S_SPLIT_INFO_bioseqs_info_E &at[47] -#define ID2S_SPLIT_INFO_chunks &at[62] -#define ID2S_SPLIT_INFO_chunks_E &at[63] +#define ID2S_SPLIT_INFO &at[47] +#define ID2S_SPLIT_INFO_bioseqs_info &at[48] +#define ID2S_SPLIT_INFO_bioseqs_info_E &at[49] +#define ID2S_SPLIT_INFO_chunks &at[64] +#define ID2S_SPLIT_INFO_chunks_E &at[65] -#define ID2S_BIOSEQS_INFO &at[48] -#define ID2S_BIOSEQS_INFO_info &at[49] -#define ID2S_BIOSEQS_INFO_bioseqs &at[61] +#define ID2S_BIOSEQS_INFO &at[50] +#define ID2S_BIOSEQS_INFO_info &at[51] +#define ID2S_BIOSEQS_INFO_bioseqs &at[63] -#define ID2S_CHUNK_INFO &at[64] -#define ID2S_CHUNK_INFO_id &at[65] -#define ID2S_CHUNK_INFO_content &at[66] -#define ID2S_CHUNK_INFO_content_E &at[67] +#define ID2S_CHUNK_INFO &at[66] +#define ID2S_CHUNK_INFO_id &at[67] +#define ID2S_CHUNK_INFO_content &at[68] +#define ID2S_CHUNK_INFO_content_E &at[69] -#define ID2S_BIOSEQ_INFO &at[50] -#define ID2S_BIOSEQ_INFO_gap_count &at[51] -#define BIOSEQ_INFO_seq_map_has_ref &at[52] -#define ID2S_BIOSEQ_INFO_sequence_split &at[54] +#define ID2S_BIOSEQ_INFO &at[52] +#define ID2S_BIOSEQ_INFO_gap_count &at[53] +#define BIOSEQ_INFO_seq_map_has_ref &at[54] +#define ID2S_BIOSEQ_INFO_sequence_split &at[56] #define ID2_ID_RANGE &at[33] #define ID2_ID_RANGE_start &at[34] #define ID2_ID_RANGE_count &at[35] -#define ID2S_SEQUENCE_SPLIT_INFO &at[55] -#define SEQUENCE_SPLIT_INFO_block_size &at[56] -#define SPLIT_INFO_chunk_start &at[57] -#define SPLIT_INFO_chunk_blocks &at[58] -#define SPLIT_INFO_chunk_blocks_E &at[59] - -#define ID2S_CHUNK_CONTENT &at[68] -#define ID2S_CHUNK_CONTENT_seq_descr &at[69] -#define ID2S_CHUNK_CONTENT_seq_annot &at[76] -#define ID2S_CHUNK_CONTENT_seq_assembly &at[77] -#define ID2S_CHUNK_CONTENT_seq_map &at[81] -#define ID2S_CHUNK_CONTENT_seq_data &at[83] -#define CHUNK_CONTENT_seq_annot_place &at[85] - -#define ID2S_SEQ_DESCR_INFO &at[70] -#define ID2S_SEQ_DESCR_INFO_type_mask &at[71] -#define ID2S_SEQ_DESCR_INFO_bioseqs &at[72] -#define ID2S_SEQ_DESCR_INFO_bioseqs_E &at[73] -#define ID2S_SEQ_DESCR_INFO_bioseq_sets &at[74] -#define SEQ_DESCR_INFO_bioseq_sets_E &at[75] - -#define ID2S_SEQ_ASSEMBLY_INFO &at[78] -#define ID2S_SEQ_ASSEMBLY_INFO_bioseqs &at[79] -#define SEQ_ASSEMBLY_INFO_bioseqs_E &at[80] - -#define ID2S_SEQ_MAP_INFO &at[82] - -#define ID2S_SEQ_DATA_INFO &at[84] - -#define ID2S_SEQ_ANNOT_PLACE_INFO &at[86] -#define ID2S_SEQ_ANNOT_PLACE_INFO_name &at[87] -#define SEQ_ANNOT_PLACE_INFO_bioseqs &at[88] -#define SEQ_ANNOT_PLACE_INFO_bioseqs_E &at[89] -#define ANNOT_PLACE_INFO_bioseq_sets &at[90] -#define ANNOT_PLACE_INFO_bioseq_sets_E &at[91] +#define ID2S_SEQUENCE_SPLIT_INFO &at[57] +#define SEQUENCE_SPLIT_INFO_block_size &at[58] +#define SPLIT_INFO_chunk_start &at[59] +#define SPLIT_INFO_chunk_blocks &at[60] +#define SPLIT_INFO_chunk_blocks_E &at[61] + +#define ID2S_CHUNK_CONTENT &at[70] +#define ID2S_CHUNK_CONTENT_seq_descr &at[71] +#define ID2S_CHUNK_CONTENT_seq_annot &at[80] +#define ID2S_CHUNK_CONTENT_seq_assembly &at[81] +#define ID2S_CHUNK_CONTENT_seq_map &at[84] +#define ID2S_CHUNK_CONTENT_seq_data &at[86] +#define CHUNK_CONTENT_seq_annot_place &at[88] +#define ID2S_CHUNK_CONTENT_bioseq_place &at[93] +#define CHUNK_CONTENT_bioseq_place_E &at[94] + +#define ID2S_SEQ_DESCR_INFO &at[72] +#define ID2S_SEQ_DESCR_INFO_type_mask &at[73] +#define ID2S_SEQ_DESCR_INFO_bioseqs &at[74] +#define ID2S_SEQ_DESCR_INFO_bioseq_sets &at[77] + +#define ID2S_SEQ_ASSEMBLY_INFO &at[82] +#define ID2S_SEQ_ASSEMBLY_INFO_bioseqs &at[83] + +#define ID2S_SEQ_MAP_INFO &at[85] + +#define ID2S_SEQ_DATA_INFO &at[87] + +#define ID2S_SEQ_ANNOT_PLACE_INFO &at[89] +#define ID2S_SEQ_ANNOT_PLACE_INFO_name &at[90] +#define SEQ_ANNOT_PLACE_INFO_bioseqs &at[91] +#define ANNOT_PLACE_INFO_bioseq_sets &at[92] + +#define ID2S_BIOSEQ_PLACE_INFO &at[95] +#define BIOSEQ_PLACE_INFO_bioseq_set &at[96] +#define ID2S_BIOSEQ_PLACE_INFO_seq_ids &at[97] +#define BIOSEQ_PLACE_INFO_seq_ids_E &at[98] + +#define ID2_BIOSEQ_IDS &at[75] +#define ID2_BIOSEQ_IDS_E &at[76] + +#define ID2_BIOSEQ_SET_IDS &at[78] +#define ID2_BIOSEQ_SET_IDS_E &at[79] #define ID2S_FEAT_TYPE_INFO &at[10] #define ID2S_FEAT_TYPE_INFO_type &at[11] @@ -225,24 +247,32 @@ static AsnModulePtr amp = ampx; #define ID2_SEQ_LOC_loc_set_E &at[37] #define ID2_SEQ_LOC_seq_loc &at[38] -#define ID2S_CHUNK &at[92] -#define ID2S_CHUNK_data &at[93] -#define ID2S_CHUNK_data_E &at[94] - -#define ID2S_CHUNK_DATA &at[95] -#define ID2S_CHUNK_DATA_id &at[96] -#define ID2S_CHUNK_DATA_id_bioseq_set &at[97] -#define ID2S_CHUNK_DATA_id_gi &at[98] -#define ID2S_CHUNK_DATA_descrs &at[99] -#define ID2S_CHUNK_DATA_descrs_E &at[100] -#define ID2S_CHUNK_DATA_annots &at[101] -#define ID2S_CHUNK_DATA_annots_E &at[102] -#define ID2S_CHUNK_DATA_assembly &at[103] -#define ID2S_CHUNK_DATA_assembly_E &at[104] -#define ID2S_CHUNK_DATA_seq_map &at[105] -#define ID2S_CHUNK_DATA_seq_map_E &at[106] -#define ID2S_CHUNK_DATA_seq_data &at[107] -#define ID2S_CHUNK_DATA_seq_data_E &at[108] +#define ID2S_CHUNK &at[99] +#define ID2S_CHUNK_data &at[100] +#define ID2S_CHUNK_data_E &at[101] + +#define ID2S_CHUNK_DATA &at[102] +#define ID2S_CHUNK_DATA_id &at[103] +#define ID2S_CHUNK_DATA_id_bioseq_set &at[104] +#define ID2S_CHUNK_DATA_id_gi &at[105] +#define ID2S_CHUNK_DATA_id_seq_id &at[106] +#define ID2S_CHUNK_DATA_descrs &at[107] +#define ID2S_CHUNK_DATA_descrs_E &at[108] +#define ID2S_CHUNK_DATA_annots &at[109] +#define ID2S_CHUNK_DATA_annots_E &at[110] +#define ID2S_CHUNK_DATA_assembly &at[111] +#define ID2S_CHUNK_DATA_assembly_E &at[112] +#define ID2S_CHUNK_DATA_seq_map &at[113] +#define ID2S_CHUNK_DATA_seq_map_E &at[114] +#define ID2S_CHUNK_DATA_seq_data &at[119] +#define ID2S_CHUNK_DATA_seq_data_E &at[120] +#define ID2S_CHUNK_DATA_bioseqs &at[121] +#define ID2S_CHUNK_DATA_bioseqs_E &at[122] + +#define ID2S_SEQUENCE_PIECE &at[115] +#define ID2S_SEQUENCE_PIECE_start &at[116] +#define ID2S_SEQUENCE_PIECE_data &at[117] +#define ID2S_SEQUENCE_PIECE_data_E &at[118] #define ID2_INTERVAL &at[20] #define ID2_INTERVAL_gi &at[21] diff --git a/network/medarch/client/mdrcherr.h b/network/medarch/client/mdrcherr.h index 69889082..e5332548 100644 --- a/network/medarch/client/mdrcherr.h +++ b/network/medarch/client/mdrcherr.h @@ -3,6 +3,9 @@ * * RCS Modification History: * $Log: mdrcherr.h,v $ +* Revision 6.2 2004/08/17 15:21:31 bazhin +* Added a few error messages to report PubMed id problems. +* * Revision 6.1 2003/10/01 13:07:50 bazhin * Added a couple of new warning messages ERR_REFERENCE_NoConsortAuthors * and ERR_REFERENCE_DiffConsortAuthors. The severity of message @@ -36,6 +39,10 @@ #define ERR_REFERENCE_MuidMissmatch 1,8 #define ERR_REFERENCE_NoConsortAuthors 1,9 #define ERR_REFERENCE_DiffConsortAuthors 1,10 +#define ERR_REFERENCE_PmidMissmatch 1,11 +#define ERR_REFERENCE_Multiple_pmid 1,12 +#define ERR_REFERENCE_FailedToGetPub 1,13 + #define ERR_PRINT 2,0 #define ERR_PRINT_Failed 2,1 diff --git a/network/medarch/client/medarch.msg b/network/medarch/client/medarch.msg index 9df68937..b583241b 100644 --- a/network/medarch/client/medarch.msg +++ b/network/medarch/client/medarch.msg @@ -10,6 +10,9 @@ $^ MedlineMatchIgnored, 7, SEV_ERROR $^ MuidMissmatch, 8, SEV_WARNING $^ NoConsortAuthors, 9, SEV_WARNING $^ DiffConsortAuthors, 10, SEV_WARNING +$^ PmidMismatch, 11, SEV_WARNING +$^ Multiple_pmid, 12, SEV_WARNING +$^ FailedToGetPub, 13, SEV_ERROR $$ PRINT, 2 $^ Failed, 1, SEV_WARNING diff --git a/network/medarch/client/medutil.c b/network/medarch/client/medutil.c index fc6b5199..efe601ae 100644 --- a/network/medarch/client/medutil.c +++ b/network/medarch/client/medutil.c @@ -28,7 +28,7 @@ * * Version Creation Date: 8/31/93 * -* $Revision: 6.14 $ +* $Revision: 6.15 $ * * File Description: Medline Utilities for MedArch * Assumes user calls MedArchInit and Fini @@ -44,6 +44,9 @@ * * RCS Modification History: * $Log: medutil.c,v $ +* Revision 6.15 2004/08/18 17:00:56 bazhin +* Fixed bug with medline lookup if both PubMed and Medline ids are present. +* * Revision 6.14 2004/03/19 18:32:03 bazhin * One more patch related to the previous one. * @@ -722,7 +725,7 @@ static Boolean if_inpress_set(CitArtPtr cap) } /**********************************************************/ -static void PropogateInPress(Boolean inpress, ValNodePtr vnp) +static void PropagateInPress(Boolean inpress, ValNodePtr vnp) { CitJourPtr jour; CitBookPtr book; @@ -749,491 +752,503 @@ static void PropogateInPress(Boolean inpress, ValNodePtr vnp) } } -/***************************************************************************** -* -* FixPubEquiv() -* -*****************************************************************************/ -ValNodePtr FixPubEquiv(ValNodePtr pube, FindPubOptionPtr fpop) +/**********************************************************/ +static ValNodePtr PubEquivAdd(ValNodePtr headvnp, ValNodePtr addvnp) { - ValNodePtr tmp, muidptr=NULL, pmidptr=NULL, citartptr=NULL, mepptr = NULL, - otherptr = NULL, tmp2, next, new; - Int2 muidctr = 0, pmidctr = 0, citartctr = 0, mepctr = 0, otherctr = 0; - Int4 muid = 0, oldmuid=0, pmid = 0, oldpmid=0; - CitArtPtr cit; - Boolean got; - Boolean inpress; + ValNodePtr vnp; - if (pube == NULL) return NULL; + if(headvnp == NULL) + return(addvnp); + for(vnp = headvnp; vnp->next != NULL;) + vnp = vnp->next; + vnp->next = addvnp; + return(headvnp); +} - for(got = FALSE, tmp = pube; tmp != NULL; tmp = tmp->next) - { - if(tmp->choice == PUB_Muid || tmp->choice == PUB_PMid) - { - got = TRUE; - break; - } - } +/**********************************************************/ +static ValNodePtr PubEquivPutBack(ValNodePtr headvnp, ValNodePtr addvnp) +{ + ValNodePtr vnp; - for (tmp = pube; tmp != NULL; tmp = next) - { - next = tmp->next; - tmp->next = NULL; - switch (tmp->choice) - { - case PUB_Muid: - muidctr++; - if (muidptr == NULL) - muidptr = tmp; - else - { - for (tmp2 = muidptr; tmp2->next != NULL; tmp2 = tmp2->next) - continue; - tmp2->next = tmp; - } - break; - case PUB_PMid: - pmidctr++; - if (pmidptr == NULL) - pmidptr = tmp; - else - { - for (tmp2 = pmidptr; tmp2->next != NULL; tmp2 = tmp2->next) - continue; - tmp2->next = tmp; - } - break; - case PUB_Article: - cit = tmp->data.ptrvalue; - if (cit->from == 2 || (in_press(cit) && got == FALSE)) { - otherctr++; - if (otherptr == NULL) - otherptr = tmp; - else - { - for (tmp2 = otherptr; tmp2->next != NULL; tmp2 = tmp2->next) - continue; - tmp2->next = tmp; - } - } else { - citartctr++; - if (citartptr == NULL) - citartptr = tmp; - else - { - for (tmp2 = citartptr; tmp2->next != NULL; - tmp2 = tmp2->next) - continue; - tmp2->next = tmp; - } - } - break; - case PUB_Medline: - mepctr++; - if (mepptr == NULL) - mepptr = tmp; - else - { - for (tmp2 = mepptr; tmp2->next != NULL; tmp2 = tmp2->next) - continue; - tmp2->next = tmp; - } - break; - default: - otherctr++; - if (otherptr == NULL) - otherptr = tmp; - else - { - for (tmp2 = otherptr; tmp2->next != NULL; tmp2 = tmp2->next) - continue; - tmp2->next = tmp; - } - break; - } - } + if(headvnp == NULL) + return(addvnp); + if(addvnp == NULL) + return(headvnp); - pube = otherptr; /* put back others */ - tmp2 = otherptr; - if (tmp2 != NULL) - { - for (tmp2 = otherptr; tmp2->next != NULL; tmp2 = tmp2->next) - continue; - } - - if ((muidctr != 0 || pmidctr != 0) && (! fpop->always_look)) /* got an muid */ - { - if (mepptr != NULL) - { - if (tmp2 == NULL) - { - tmp2 = mepptr; - pube = tmp2; - } - else - tmp2->next = mepptr; - - while (tmp2->next != NULL) - tmp2 = tmp2->next; - } - if (pmidptr != NULL) { - if (tmp2 == NULL) - { - tmp2 = pmidptr; - pube = tmp2; - } - else - tmp2->next = pmidptr; - - while (tmp2->next != NULL) - tmp2 = tmp2->next; - } - if (muidptr != NULL) - { - if (tmp2 == NULL) - { - tmp2 = muidptr; - pube = tmp2; - } - else - tmp2->next = muidptr; - - while (tmp2->next != NULL) - tmp2 = tmp2->next; - } - if (citartptr != NULL) - { - if (tmp2 == NULL) - { - tmp2 = citartptr; - pube = tmp2; - } - else - tmp2->next = citartptr; - } - return pube; /* no changes */ - } + for(vnp = addvnp; vnp->next != NULL;) + vnp = vnp->next; + vnp->next = headvnp; + return(addvnp); +} - if (mepctr != 0) /* have a medline entry, take it first */ - { - if (mepctr > 1) - { - ErrPostEx(SEV_WARNING, ERR_REFERENCE_Multiple_ref, "More than one Medline entry in Pub-equiv"); - mepptr->next = PubEquivFree(mepptr->next); - } - PubEquivFree(muidptr); /* ditch others */ - PubEquivFree(pmidptr); - PubEquivFree(citartptr); - tmp = SplitMedlineEntry((MedlineEntryPtr)(mepptr->data.ptrvalue)); - ValNodeFree(mepptr); - if (tmp2 == NULL) - pube = tmp; - else - tmp2->next = tmp; - return pube; - } +/**********************************************************/ +static ValNodePtr FixPubEquivAppend(ValNodePtr pube, ValNodePtr tmp2, + ValNodePtr tmp) +{ + if(tmp2 == NULL) + return(tmp); + tmp2->next = tmp; + return(pube); +} - if (pmidctr != 0) /* have a pmid */ - { - oldpmid = pmidptr->data.intvalue; - if (pmidctr > 1) /* more than one, just take the first */ - { - for (tmp = pmidptr->next; tmp != NULL; tmp = tmp->next) - { - if (tmp->data.intvalue != pmid) - { - ErrPostEx(SEV_WARNING, ERR_REFERENCE_Multiple_muid, "Two different pmids in Pub-equiv [%ld] [%ld]\n", - (long) oldpmid, (long) (tmp->data.intvalue)); - } - } - pmidptr->next = PubEquivFree(pmidptr->next); - } - } +/**********************************************************/ +static ValNodePtr FixPubEquivAppendPmid(ValNodePtr tmp, Int4 muid, + ValNodePtr pmidptr) +{ + Int4 oldpmid; + Int4 newpmid; - if (muidctr != 0) /* have an muid */ - { - oldmuid = muidptr->data.intvalue; - if (muidctr > 1) /* more than one, just take the first */ - { - for (tmp = muidptr->next; tmp != NULL; tmp = tmp->next) - { - if (tmp->data.intvalue != muid) - { - ErrPostEx(SEV_WARNING, ERR_REFERENCE_Multiple_muid, "Two different muids in Pub-equiv [%ld] [%ld]\n", - (long) oldmuid, (long) (tmp->data.intvalue)); - } - } - muidptr->next = PubEquivFree(muidptr->next); - } - } + oldpmid = (pmidptr == NULL) ? 0 : pmidptr->data.intvalue; - if (citartctr > 0) - { - if (citartctr > 1) /* ditch extras */ - { - ErrPostEx(SEV_WARNING, ERR_REFERENCE_Multiple_ref, "More than one Cit-art in Pub-equiv"); - citartptr->next = PubEquivFree(citartptr->next); - } + newpmid = MedArchMu2Pm(muid); + if(oldpmid < 1 && newpmid < 1) + return(tmp); - inpress = if_inpress_set(citartptr->data.ptrvalue); - fpop->lookups_attempted++; - muid = MedArchCitMatch(citartptr); - if (muid != 0) /* success */ - { - print_pub(citartptr, TRUE, FALSE, muid); - fpop->lookups_succeeded++; - if (oldmuid) /* already had an muid */ - { - if (oldmuid != muid) - { - ErrPostEx(SEV_ERROR, ERR_REFERENCE_MuidMissmatch, "OldMUID=%ld doesn't match lookup (%ld). Keeping lookup.", - (long)oldmuid, (long)muid); - } - } - if (fpop->replace_cit) - { - fpop->fetches_attempted++; - new = FetchPub(muid); - if (new != NULL) - { - fpop->fetches_succeeded++; + if(oldpmid > 0 && newpmid > 0 && oldpmid != newpmid) + ErrPostEx(SEV_ERROR, ERR_REFERENCE_PmidMissmatch, + "OldPMID=%ld doesn't match lookup (%ld). Keeping lookup.", + (long) oldpmid, (long) newpmid); - if (ten_authors(citartptr->data.ptrvalue, - new->data.ptrvalue)) - { - if (muidptr != NULL) - tmp = muidptr; - else - { - tmp = ValNodeNew(tmp2); - tmp->choice = PUB_Muid; - } - if (tmp2 == NULL) { - pube = tmp; - } else { - tmp2->next = tmp; - } - tmp->data.intvalue = muid; - tmp->next = new; - - PubFree(citartptr); - citartptr = new; - } else { - print_pub(citartptr, FALSE, TRUE, muid); - PubFree(new); - if (tmp2 == NULL) { - pube = citartptr; - } else { - tmp2->next = citartptr; - } - if (muidptr != NULL) - citartptr->next = muidptr; - } - } - else - { - ErrPostEx(SEV_ERROR, 0, 0, "Failed to get pub from MedArch server for muid = %ld. Input one is preserved.", muid); - if (muidptr != NULL) - tmp = muidptr; - else - { - tmp = ValNodeNew(tmp2); - tmp->choice = PUB_Muid; - } - if (tmp2 == NULL) - pube = tmp; - tmp->data.intvalue = muid; - tmp2 = tmp; - tmp->next = citartptr; - MedlineToISO(citartptr); - } - } - else - { - if (muidptr != NULL) - tmp = muidptr; - else - { - tmp = ValNodeNew(tmp2); - tmp->choice = PUB_Muid; - } - if (tmp2 == NULL) - pube = tmp; - tmp->data.intvalue = muid; - tmp2 = tmp; - tmp->next = citartptr; - MedlineToISO(citartptr); - } - PropogateInPress(inpress, citartptr); - return pube; - } + if(pmidptr != NULL) + tmp->next = pmidptr; + else + { + tmp->next = ValNodeNew(NULL); + tmp->next->choice = PUB_PMid; + } - /* muid lookup failed */ + tmp = tmp->next; + tmp->data.intvalue = (newpmid > 0) ? newpmid : oldpmid; - pmid = MedArchCitMatchPmId(citartptr); - if (pmid != 0) /* success */ - { - print_pub(citartptr, TRUE, FALSE, pmid); - fpop->lookups_succeeded++; - if (oldpmid) /* already had an muid */ - { - if (oldpmid != pmid) - { - ErrPostEx(SEV_ERROR, ERR_REFERENCE_MuidMissmatch, "OldPMID=%ld doesn't match lookup (%ld). Keeping lookup.", - (long)oldpmid, (long)pmid); - } - } - if (fpop->replace_cit) - { - fpop->fetches_attempted++; - new = FetchPubPmId(pmid); - if (new != NULL) - { - fpop->fetches_succeeded++; + return(tmp); +} - if (ten_authors(citartptr->data.ptrvalue, - new->data.ptrvalue)) - { - if (pmidptr != NULL) - tmp = pmidptr; - else - { - tmp = ValNodeNew(tmp2); - tmp->choice = PUB_PMid; - } - if (tmp2 == NULL) { - pube = tmp; - } else { - tmp2->next = tmp; - } - tmp->data.intvalue = pmid; - tmp->next = new; - - PubFree(citartptr); - citartptr = new; - } else { - print_pub(citartptr, FALSE, TRUE, pmid); - PubFree(new); - if (tmp2 == NULL) { - pube = citartptr; - } else { - tmp2->next = citartptr; - } - if (pmidptr != NULL) - citartptr->next = pmidptr; - } - } - else - { - ErrPostEx(SEV_ERROR, 0, 0, "Failed to get pub from MedArch server for pmid = %ld. Input one is preserved.", pmid); - if (pmidptr != NULL) - tmp = pmidptr; - else - { - tmp = ValNodeNew(tmp2); - tmp->choice = PUB_PMid; - } - if (tmp2 == NULL) - pube = tmp; - tmp->data.intvalue = pmid; - tmp2 = tmp; - tmp->next = citartptr; - MedlineToISO(citartptr); - } - } - else - { - if (pmidptr != NULL) - tmp = pmidptr; - else - { - tmp = ValNodeNew(tmp2); - tmp->choice = PUB_PMid; - } - if (tmp2 == NULL) - pube = tmp; - tmp->data.intvalue = pmid; - tmp2 = tmp; - tmp->next = citartptr; - MedlineToISO(citartptr); - } - PropogateInPress(inpress, citartptr); - return pube; - } +/**********************************************************/ +static ValNodePtr FixPubEquivAppendMuid(ValNodePtr tmp, Int4 pmid, + ValNodePtr muidptr) +{ + Int4 oldmuid; + Int4 newmuid; - print_pub(citartptr, FALSE, FALSE, oldmuid); - if (tmp2 == NULL) - pube = citartptr; - else - tmp2->next = citartptr; - if (muidptr != NULL) /* ditch the mismatched muid */ - PubFree(muidptr); - PropogateInPress(inpress, citartptr); - return pube; + oldmuid = (muidptr == NULL) ? 0 : muidptr->data.intvalue; - } - - if (oldpmid != 0) /* have a pmid but no cit-art */ - { - fpop->fetches_attempted++; - tmp = MedArchGetPubPmId(oldpmid); - if (tmp == NULL) - { - ErrPostEx(SEV_WARNING, ERR_REFERENCE_No_reference, "Cant find article for pmid [%ld]", (long) oldpmid); - } - else - { - fpop->fetches_succeeded++; - if (fpop->replace_cit) - { - tmp = MedlineToISO(tmp); - if (tmp2 == NULL) - pube = tmp; - else - tmp2->next = tmp; - tmp2 = tmp; - } else { - PubFree(tmp); - } - } - if (tmp2 == NULL) - pube = pmidptr; - else - tmp2->next = pmidptr; - } + newmuid = MedArchPm2Mu(pmid); + if(oldmuid < 1 && newmuid < 1) + return(tmp); - if (oldmuid != 0) /* have an muid but no cit-art */ - { - fpop->fetches_attempted++; - tmp = MedArchGetPub(oldmuid); - if (tmp == NULL) - { - ErrPostEx(SEV_WARNING, ERR_REFERENCE_No_reference, "Cant find article for muid [%ld]", (long) oldmuid); - } - else - { - fpop->fetches_succeeded++; - if (fpop->replace_cit) - { - tmp = MedlineToISO(tmp); - if (tmp2 == NULL) - pube = tmp; - else - tmp2->next = tmp; - tmp2 = tmp; - } else { - PubFree(tmp); - } - } - if (tmp2 == NULL) - pube = muidptr; - else - tmp2->next = muidptr; - } + if(oldmuid > 0 && newmuid > 0 && oldmuid != newmuid) + ErrPostEx(SEV_ERROR, ERR_REFERENCE_MuidMissmatch, + "OldMUID=%ld doesn't match lookup (%ld). Keeping lookup.", + (long) oldmuid, (long) newmuid); + + if(muidptr != NULL) + tmp->next = muidptr; + else + { + tmp->next = ValNodeNew(NULL); + tmp->next->choice = PUB_Muid; + } - return pube; + tmp = tmp->next; + tmp->data.intvalue = (newmuid > 0) ? newmuid : oldmuid; + + return(tmp); } +/**********************************************************/ +ValNodePtr FixPubEquiv(ValNodePtr pube, FindPubOptionPtr fpop) +{ + ValNodePtr tmp; + ValNodePtr muidptr = NULL; + ValNodePtr pmidptr = NULL; + ValNodePtr citartptr = NULL; + ValNodePtr mepptr = NULL; + ValNodePtr otherptr = NULL; + ValNodePtr tmp2; + ValNodePtr next; + ValNodePtr new; + Int4 muid = 0; + Int4 oldmuid = 0; + Int4 pmid = 0; + Int4 oldpmid = 0; + CitArtPtr cit; + Boolean got; + Boolean inpress; + + if(pube == NULL) + return(NULL); + + for(got = FALSE, tmp = pube; tmp != NULL; tmp = tmp->next) + { + if(tmp->choice == PUB_Muid || tmp->choice == PUB_PMid) + { + got = TRUE; + break; + } + } + + for(tmp = pube; tmp != NULL; tmp = next) + { + next = tmp->next; + tmp->next = NULL; + if(tmp->choice == PUB_Muid) + muidptr = PubEquivAdd(muidptr, tmp); + else if(tmp->choice == PUB_PMid) + pmidptr = PubEquivAdd(pmidptr, tmp); + else if(tmp->choice == PUB_Article) + { + cit = tmp->data.ptrvalue; + if(cit->from == 2 || (in_press(cit) != FALSE && got == FALSE)) + otherptr = PubEquivAdd(otherptr, tmp); + else + citartptr = PubEquivAdd(citartptr, tmp); + } + else if(tmp->choice == PUB_Medline) + mepptr = PubEquivAdd(mepptr, tmp); + else + otherptr = PubEquivAdd(otherptr, tmp); + } + + if((muidptr != NULL || pmidptr != NULL) && /* got a muid or pmid */ + fpop->always_look == FALSE) + { + pube = PubEquivPutBack(NULL, citartptr); + pube = PubEquivPutBack(pube, muidptr); + pube = PubEquivPutBack(pube, pmidptr); + pube = PubEquivPutBack(pube, mepptr); + pube = PubEquivPutBack(pube, otherptr); + return(pube); /* no changes */ + } + + pube = otherptr; /* put back others */ + tmp2 = otherptr; + if(tmp2 != NULL) + while(tmp2->next != NULL) + tmp2 = tmp2->next; + + if(mepptr != NULL) /* have a medline entry, + take it first */ + { + if(mepptr->next != NULL) + { + ErrPostEx(SEV_WARNING, ERR_REFERENCE_Multiple_ref, + "More than one Medline entry in Pub-equiv"); + mepptr->next = PubEquivFree(mepptr->next); + } + PubEquivFree(muidptr); /* ditch others */ + PubEquivFree(pmidptr); + PubEquivFree(citartptr); + tmp = SplitMedlineEntry((MedlineEntryPtr) mepptr->data.ptrvalue); + ValNodeFree(mepptr); + pube = FixPubEquivAppend(pube, tmp2, tmp); + return(pube); + } + + if(pmidptr != NULL) /* have a pmid */ + { + oldpmid = pmidptr->data.intvalue; + if(pmidptr->next != NULL) /* more than one, just take + the first */ + { + for(tmp = pmidptr->next; tmp != NULL; tmp = tmp->next) + if(tmp->data.intvalue != pmid) + ErrPostEx(SEV_WARNING, ERR_REFERENCE_Multiple_pmid, + "Two different pmids in Pub-equiv [%ld] [%ld]", + (long) oldpmid, (long) tmp->data.intvalue); + pmidptr->next = PubEquivFree(pmidptr->next); + } + } + + if(muidptr != NULL) /* have an muid */ + { + oldmuid = muidptr->data.intvalue; + if(muidptr->next != NULL) /* more than one, just take + the first */ + { + for(tmp = muidptr->next; tmp != NULL; tmp = tmp->next) + if(tmp->data.intvalue != muid) + ErrPostEx(SEV_WARNING, ERR_REFERENCE_Multiple_muid, + "Two different muids in Pub-equiv [%ld] [%ld]", + (long) oldmuid, (long) tmp->data.intvalue); + muidptr->next = PubEquivFree(muidptr->next); + } + } + + if(citartptr != NULL) + { + if(citartptr->next != NULL) /* ditch extras */ + { + ErrPostEx(SEV_WARNING, ERR_REFERENCE_Multiple_ref, + "More than one Cit-art in Pub-equiv"); + citartptr->next = PubEquivFree(citartptr->next); + } + + inpress = if_inpress_set(citartptr->data.ptrvalue); + fpop->lookups_attempted++; + muid = MedArchCitMatch(citartptr); + if(muid != 0) /* success */ + { + print_pub(citartptr, TRUE, FALSE, muid); + fpop->lookups_succeeded++; + if(oldmuid > 0 && oldmuid != muid) /* already had an muid */ + ErrPostEx(SEV_ERROR, ERR_REFERENCE_MuidMissmatch, + "OldMUID=%ld doesn't match lookup (%ld). Keeping lookup.", + (long) oldmuid, (long) muid); + if(fpop->replace_cit != FALSE) + { + fpop->fetches_attempted++; + new = FetchPub(muid); + if(new != NULL) + { + fpop->fetches_succeeded++; + + if(ten_authors(citartptr->data.ptrvalue, + new->data.ptrvalue) != FALSE) + { + if(muidptr != NULL) + tmp = muidptr; + else + { + tmp = ValNodeNew(tmp2); + tmp->choice = PUB_Muid; + } + tmp->data.intvalue = muid; + pube = FixPubEquivAppend(pube, tmp2, tmp); + tmp = FixPubEquivAppendPmid(tmp, muid, pmidptr); + tmp->next = new; + + PubFree(citartptr); + citartptr = new; + } + else + { + if(muidptr != NULL) + tmp = muidptr; + else + { + tmp = ValNodeNew(tmp2); + tmp->choice = PUB_Muid; + } + tmp->data.intvalue = muid; + pube = FixPubEquivAppend(pube, tmp2, tmp); + tmp = FixPubEquivAppendPmid(tmp, muid, pmidptr); + + print_pub(citartptr, FALSE, TRUE, muid); + PubFree(new); + tmp->next = citartptr; + } + } + else + { + ErrPostEx(SEV_ERROR, ERR_REFERENCE_FailedToGetPub, + "Failed to get pub from MedArch server for muid = %ld. Input one is preserved.", + muid); + if(muidptr != NULL) + tmp = muidptr; + else + { + tmp = ValNodeNew(tmp2); + tmp->choice = PUB_Muid; + } + if(tmp2 == NULL) + pube = tmp; + tmp->data.intvalue = muid; + tmp = FixPubEquivAppendPmid(tmp, muid, pmidptr); +/* tmp2 = tmp;*/ + tmp->next = citartptr; + MedlineToISO(citartptr); + } + } + else + { + if(muidptr != NULL) + tmp = muidptr; + else + { + tmp = ValNodeNew(tmp2); + tmp->choice = PUB_Muid; + } + if(tmp2 == NULL) + pube = tmp; + tmp->data.intvalue = muid; + tmp = FixPubEquivAppendPmid(tmp, muid, pmidptr); +/* tmp2 = tmp;*/ + tmp->next = citartptr; + MedlineToISO(citartptr); + } + PropagateInPress(inpress, citartptr); + return(pube); + } + + /* muid lookup failed + */ + pmid = MedArchCitMatchPmId(citartptr); + if(pmid != 0) /* success */ + { + print_pub(citartptr, TRUE, FALSE, pmid); + fpop->lookups_succeeded++; + if(oldpmid > 0 && oldpmid != pmid) /* already had a pmid */ + ErrPostEx(SEV_ERROR, ERR_REFERENCE_PmidMissmatch, + "OldPMID=%ld doesn't match lookup (%ld). Keeping lookup.", + (long) oldpmid, (long) pmid); + + if(fpop->replace_cit != FALSE) + { + fpop->fetches_attempted++; + new = FetchPubPmId(pmid); + if(new != NULL) + { + fpop->fetches_succeeded++; + + if(ten_authors(citartptr->data.ptrvalue, + new->data.ptrvalue) != FALSE) + { + if(pmidptr != NULL) + tmp = pmidptr; + else + { + tmp = ValNodeNew(tmp2); + tmp->choice = PUB_PMid; + } + tmp->data.intvalue = pmid; + pube = FixPubEquivAppend(pube, tmp2, tmp); + tmp = FixPubEquivAppendMuid(tmp, pmid, muidptr); + tmp->next = new; + + PubFree(citartptr); + citartptr = new; + } + else + { + if(pmidptr != NULL) + tmp = pmidptr; + else + { + tmp = ValNodeNew(tmp2); + tmp->choice = PUB_PMid; + } + tmp->data.intvalue = pmid; + pube = FixPubEquivAppend(pube, tmp2, tmp); + tmp = FixPubEquivAppendMuid(tmp, pmid, muidptr); + + print_pub(citartptr, FALSE, TRUE, pmid); + PubFree(new); + tmp->next = citartptr; + } + } + else + { + ErrPostEx(SEV_ERROR, ERR_REFERENCE_FailedToGetPub, + "Failed to get pub from MedArch server for pmid = %ld. Input one is preserved.", + pmid); + if(pmidptr != NULL) + tmp = pmidptr; + else + { + tmp = ValNodeNew(tmp2); + tmp->choice = PUB_PMid; + } + if(tmp2 == NULL) + pube = tmp; + tmp->data.intvalue = pmid; +/* tmp2 = tmp;*/ + tmp = FixPubEquivAppendMuid(tmp, pmid, muidptr); + tmp->next = citartptr; + MedlineToISO(citartptr); + } + } + else + { + if(pmidptr != NULL) + tmp = pmidptr; + else + { + tmp = ValNodeNew(tmp2); + tmp->choice = PUB_PMid; + } + if(tmp2 == NULL) + pube = tmp; + tmp->data.intvalue = pmid; +/* tmp2 = tmp;*/ + tmp = FixPubEquivAppendMuid(tmp, pmid, muidptr); + tmp->next = citartptr; + MedlineToISO(citartptr); + } + PropagateInPress(inpress, citartptr); + return(pube); + } + + print_pub(citartptr, FALSE, FALSE, oldmuid); + pube = FixPubEquivAppend(pube, tmp2, citartptr); + if(muidptr != NULL) /* ditch the mismatched muid */ + PubFree(muidptr); + if(pmidptr != NULL) /* ditch the mismatched pmid */ + PubFree(pmidptr); + PropagateInPress(inpress, citartptr); + return(pube); + } + + if(oldpmid != 0) /* have a pmid but no cit-art */ + { + fpop->fetches_attempted++; + tmp = MedArchGetPubPmId(oldpmid); + if(tmp != NULL) + { + fpop->fetches_succeeded++; + if(fpop->replace_cit != FALSE) + { + tmp = MedlineToISO(tmp); + pube = FixPubEquivAppend(pube, tmp2, tmp); + tmp2 = tmp; + } + else + PubFree(tmp); + pube = FixPubEquivAppend(pube, tmp2, pmidptr); + FixPubEquivAppendMuid(pmidptr, oldpmid, muidptr); + return(pube); + } + ErrPostEx(SEV_WARNING, ERR_REFERENCE_No_reference, + "Cant find article for pmid [%ld]", (long) oldpmid); +/* pube = FixPubEquivAppend(pube, tmp2, pmidptr);*/ + } + + if(oldmuid != 0) /* have a muid but no cit-art */ + { + fpop->fetches_attempted++; + tmp = MedArchGetPub(oldmuid); + if(tmp != NULL) + { + fpop->fetches_succeeded++; + if(fpop->replace_cit != FALSE) + { + tmp = MedlineToISO(tmp); + pube = FixPubEquivAppend(pube, tmp2, tmp); + tmp2 = tmp; + } + else + PubFree(tmp); + pube = FixPubEquivAppend(pube, tmp2, muidptr); + FixPubEquivAppendPmid(muidptr, oldmuid, pmidptr); + return(pube); + } + ErrPostEx(SEV_WARNING, ERR_REFERENCE_No_reference, + "Cant find article for muid [%ld]", (long) oldmuid); +/* pube = FixPubEquivAppend(pube, tmp2, muidptr);*/ + } + + if(oldpmid > 0) + { + pube = FixPubEquivAppend(pube, tmp2, pmidptr); + FixPubEquivAppendMuid(pmidptr, oldpmid, muidptr); + } + else if(oldmuid > 0) + { + pube = FixPubEquivAppend(pube, tmp2, muidptr); + FixPubEquivAppendPmid(muidptr, oldmuid, pmidptr); + } + + return(pube); +} /***************************************************************************** * diff --git a/network/nsclilib/ni_service.c b/network/nsclilib/ni_service.c index ed78575b..9cade6b4 100644 --- a/network/nsclilib/ni_service.c +++ b/network/nsclilib/ni_service.c @@ -1,4 +1,4 @@ -/* $RCSfile: ni_service.c,v $ $Revision: 6.18 $ $Date: 2004/02/23 17:00:39 $ +/* $RCSfile: ni_service.c,v $ $Revision: 6.19 $ $Date: 2004/07/12 16:34:05 $ * ========================================================================== * * PUBLIC DOMAIN NOTICE @@ -30,6 +30,10 @@ * * -------------------------------------------------------------------------- * $Log: ni_service.c,v $ + * Revision 6.19 2004/07/12 16:34:05 lavr + * Add "SRV_CONN_MODE" for alternate FIREWALL switching + * (Thanks to Svetlana Karamycheva for reporting this..) + * * Revision 6.18 2004/02/23 17:00:39 lavr * Fix n_written variable name typo * @@ -105,6 +109,7 @@ #define SRV_SECTION "NET_SERV" +#define ENV_CONN_MODE "SRV_CONN_MODE" #define ENV_ENGINE_HOST "SRV_ENGINE_HOST" #define ENV_ENGINE_PORT "SRV_ENGINE_PORT" #define ENV_ENGINE_URL "SRV_ENGINE_URL" @@ -196,6 +201,12 @@ static NI_HandPtr s_GenericGetService /* Now override default parameters with legacy parameters * of older WWW service dispatcher -- should go obsolete soon... */ + /* alternate firewall mode request */ + NI_GetEnvParam(configFile, SRV_SECTION, ENV_CONN_MODE, + str, sizeof(str), ""); + if (*str && StringICmp(str, "FIREWALL") == 0) + net_info->firewall = 1/*true*/; + /* alternate dispatcher's host name & port */ NI_GetEnvParam(configFile, SRV_SECTION, ENV_ENGINE_HOST, net_info->host, sizeof(net_info->host), def_info->host); @@ -248,6 +259,7 @@ static NI_HandPtr s_GenericGetService if ((val = atoi(str)) != 0) net_info->max_try = val; + /* alternate debug printout request */ NI_GetEnvParam(configFile, SRV_SECTION, ENV_DEBUG_PRINTOUT, str, sizeof(str), ""); if (*str && (StringICmp(str, "1" ) == 0 || diff --git a/network/nsclilib/ni_www.c b/network/nsclilib/ni_www.c index a451d963..1b2855c0 100644 --- a/network/nsclilib/ni_www.c +++ b/network/nsclilib/ni_www.c @@ -1,4 +1,4 @@ -/* $Id: ni_www.c,v 4.26 2000/09/28 17:53:24 vakatov Exp $ +/* $Id: ni_www.c,v 4.27 2004/09/28 15:17:32 lavr Exp $ * ========================================================================== * * PUBLIC DOMAIN NOTICE @@ -31,6 +31,9 @@ * * -------------------------------------------------------------------------- * $Log: ni_www.c,v $ +* Revision 4.27 2004/09/28 15:17:32 lavr +* Retire LB_DIRECT unconditionally +* * Revision 4.26 2000/09/28 17:53:24 vakatov * NI_WWW_SetNcbidPort() -- yet another fix * @@ -110,6 +113,9 @@ #include <ncbicli.h> #ifdef LB_DIRECT +# undef LB_DIRECT +#endif +#ifdef LB_DIRECT # include <lbapi.h> # include <ncbithr.h> #endif diff --git a/network/taxon1/common/taxutil.c b/network/taxon1/common/taxutil.c index b92c9b14..d57c63e2 100644 --- a/network/taxon1/common/taxutil.c +++ b/network/taxon1/common/taxutil.c @@ -357,13 +357,19 @@ OrgRefPtr replace_org_err(OrgRefPtr orp, Boolean replace) ****************************************************************************/ OrgRefPtr replace_org(OrgRefPtr orp, Boolean replace) { + CharPtr common = NULL; OrgRefPtr new; Taxon1DataPtr tax; if (orp == NULL) { return NULL; } + common = orp->common; + if (StringDoesHaveText (orp->taxname) && StringDoesHaveText (orp->common)) { + orp->common = NULL; + } tax = tax1_lookup(orp, 1); + orp->common = common; if (tax && tax->org) { if (replace) { new = AsnIoMemCopy(tax->org, (AsnReadFunc) OrgRefAsnRead, diff --git a/network/taxon1/taxon2/tc2proc.c b/network/taxon1/taxon2/tc2proc.c index 0b2ca9f1..bd2f26c0 100644 --- a/network/taxon1/taxon2/tc2proc.c +++ b/network/taxon1/taxon2/tc2proc.c @@ -1,5 +1,5 @@ /*----------------*/ -/* $Id: tc2proc.c,v 1.34 2004/02/25 19:21:21 soussov Exp $ */ +/* $Id: tc2proc.c,v 1.35 2004/10/06 20:34:26 soussov Exp $ */ /*----------------*/ #include <stdlib.h> @@ -904,9 +904,11 @@ static OrgModPtr bldOrgMod(TreeCursorPtr cursor) else if(rank == tax_getRankId("forma")) { orgMdf->subtype= 25; /* forma */ } +#if 0 else if((parent != NULL) && (prank == SubspeciesRank)) { orgMdf->subtype= 2; /* strain */ } +#endif else { orgMdf->subtype= 0; /* other */ } diff --git a/network/wwwblast/Src/wblast2.c b/network/wwwblast/Src/wblast2.c index 61da2167..264f8fda 100644 --- a/network/wwwblast/Src/wblast2.c +++ b/network/wwwblast/Src/wblast2.c @@ -1,4 +1,4 @@ -/* $Id: wblast2.c,v 1.9 2004/05/14 17:25:07 dondosha Exp $ +/* $Id: wblast2.c,v 1.14 2004/10/12 20:49:55 dondosha Exp $ * =========================================================================== * * PUBLIC DOMAIN NOTICE @@ -27,12 +27,27 @@ * * Initial Creation Date: 10/23/2000 * -* $Revision: 1.9 $ +* $Revision: 1.14 $ * * File Description: * BLAST 2 Sequences CGI program * * $Log: wblast2.c,v $ +* Revision 1.14 2004/10/12 20:49:55 dondosha +* Correction due to change in SummaryReturn structure name and contents +* +* Revision 1.13 2004/08/16 19:39:35 dondosha +* Use CreateMaskByteStore function from txalign.h; fixed bug in masking filtered locations for translated queries +* +* Revision 1.12 2004/08/09 15:40:51 dondosha +* Propagated change in progotype for BLAST_TwoSeqLocSets +* +* Revision 1.11 2004/06/28 16:11:17 dondosha +* Fixed constant name +* +* Revision 1.10 2004/06/24 21:17:07 dondosha +* Boolean argument in ScoreAndEvalueToBuffers changed to Uint1 +* * Revision 1.9 2004/05/14 17:25:07 dondosha * Allow use of new BLAST engine * @@ -182,6 +197,8 @@ #include <tofasta.h> #include <wwwblast.h> #include <id1arch.h> +#include <txalign.h> + /* For rlimit stuff. */ #if defined(OS_UNIX) #include <sys/resource.h> @@ -198,11 +215,7 @@ #include <qblastnet.h> #endif -#if 1 -#define USE_NEW_BLAST -#endif - -#ifdef USE_NEW_BLAST +#ifndef USE_OLD_BLAST #include <algo/blast/api/twoseq_api.h> #endif @@ -578,7 +591,7 @@ static void Blast2SeqMainPage(CharPtr warning, CharPtr seq1, CharPtr seq2, CharP printf("</tr></table>\n"); } else { printf("<CENTER><TABLE CELLSPACING=2 CELLPADDING=2 WIDTH=100%%>\n"); - printf("<TR ALIGN=CENTER BaGCOLOR=#8dc7cc BGCOLOR=#0000ff><TD><B><I>\n"); + printf("<TR ALIGN=CENTER BGCOLOR=#8dc7cc BGCOLOR=#0000ff><TD><B><I>\n"); printf("<A HREF=http://www.ncbi.nlm.nih.gov/><font color=#ffffff>NCBI</font></A></I></B></TD>\n"); printf("<TD><B><I>\n"); printf("<A HREF=http://www.ncbi.nlm.nih.gov/Entrez><font color=#ffffff>Entrez</font></A>\n"); @@ -1052,109 +1065,27 @@ static Boolean sum_for_DenseSeg(DenseSegPtr dsp, AlignSumPtr asp) return TRUE; } -/* static functions from txalign.c needed for SEG masking */ -static void MaskWithLowComplexity(ByteStorePtr bsp, SeqLocPtr maskloc, Uint1 mol) -{ - SeqLocPtr slp = NULL; - Int4 start, stop; - Uint1 res = 'N'; - - - if(mol == Seq_mol_aa) - res = 'X'; - - while(maskloc) - { - slp = NULL; - while((slp = SeqLocFindNext(maskloc, slp))!=NULL) - { - start = SeqLocStart(slp); - stop = SeqLocStop(slp); - BSSeek(bsp, start, SEEK_SET); - for(; start <=stop; ++start) - BSPutByte(bsp, (Int2)res); - } - maskloc = maskloc->next; - } -} - -static ByteStorePtr create_byte_store_from_bsp (BioseqPtr bsp) +/** Frees the part of the byte store list that has not been used for replacement + * of Bioseq data. + */ +static void +ByteStoreListFreeUnused (ValNodePtr bs_list, Uint1 frame_to_skip) { - SeqPortPtr spp; - Uint1 code; - ByteStorePtr b_store; - Uint1 residue; - - if(bsp == NULL) - return NULL; - if(bsp->mol == Seq_mol_aa) - code = Seq_code_iupacaa; - else - code = Seq_code_iupacna; - - spp = SeqPortNew(bsp, 0, bsp->length-1, Seq_strand_plus, code); - b_store = BSNew(bsp->length +1); - BSSeek(b_store, 0, SEEK_SET); - while((residue = SeqPortGetResidue(spp)) != SEQPORT_EOF) - BSPutByte(b_store, (Int2)residue); - SeqPortFree(spp); - return b_store; -} - -static ValNodePtr CreateMaskByteStore (ValNodePtr mask_list) -{ - BioseqPtr bsp; - SeqLocPtr slp; - SeqIdPtr sip; - ValNodePtr list, curr; - ByteStorePtr b_store, c_store; - Uint1 mol; - - list = NULL; - b_store = NULL; - while(mask_list) - { - curr = ValNodeNew(list); - curr->choice = mask_list->choice; - if(list == NULL) - list = curr; - slp = mask_list->data.ptrvalue; - if(slp != NULL) - { - if(b_store == NULL) - { - sip = SeqLocId(slp); - if(sip != NULL) - { - bsp = BioseqLockById(sip); - if(bsp != NULL) - { - b_store = create_byte_store_from_bsp (bsp); - mol = bsp->mol; - BioseqUnlock(bsp); - } - } - } - if(b_store != NULL) - { - if(mask_list->next == NULL) - { - c_store = b_store; - b_store = NULL; - } - else - c_store = BSDup(b_store); - MaskWithLowComplexity(c_store, slp, mol); - curr->data.ptrvalue = c_store; - } - } - - mask_list = mask_list->next; - } - - if(b_store != NULL) - BSFree(b_store); - return list; + ByteStorePtr bsp; + ValNodePtr bs_next = NULL; + Boolean skip_done = FALSE; + + for( ; bs_list; bs_list = bs_next) { + bs_next = bs_list->next; + if (skip_done || bs_list->choice != frame_to_skip) { + bsp = (ByteStorePtr) bs_list->data.ptrvalue; + if(bsp != NULL) + BSFree(bsp); + } else { + skip_done = TRUE; + } + MemFree(bs_list); + } } /*******************************************************/ @@ -1167,12 +1098,14 @@ static void PrintOutScore(SeqAlignPtr sap, Boolean is_aa, Int4Ptr PNTR matrix, V Char eval_buff[10], bit_score_buff[10]; AlignSumPtr asp; Int2 percent_identical, percent_positive; - ValNodePtr bs_list; - BioseqPtr q_bsp; - Int4 frame; - Uint1 code; - Uint1 repr; - ByteStorePtr seq_data; + ValNodePtr bs_list; + BioseqPtr q_bsp; + Int4 frame; + Uint1 code=0; + Uint1 repr=0; + ByteStorePtr seq_data=NULL; + Boolean local_matrix = FALSE; + Boolean seq_data_replaced = FALSE; printf("<pre>\n"); GetScoreAndEvalue(sap, &score, &bit_score, &evalue, &number); @@ -1181,7 +1114,7 @@ static void PrintOutScore(SeqAlignPtr sap, Boolean is_aa, Int4Ptr PNTR matrix, V before e. */ eval_buff_ptr = eval_buff; ScoreAndEvalueToBuffers(bit_score, evalue, bit_score_buff, - &eval_buff_ptr, TRUE); + &eval_buff_ptr, TX_KNOCK_OFF_ALLOWED); if (number == 1) { printf("Score = %s bits (%ld), Expect = %s<BR>", @@ -1192,46 +1125,58 @@ static void PrintOutScore(SeqAlignPtr sap, Boolean is_aa, Int4Ptr PNTR matrix, V } asp = MemNew(sizeof(AlignSum)); asp->matrix = NULL; - if (is_aa) { - if (matrix != NULL) - asp->matrix = matrix; - else - asp->matrix = load_default_matrix(); + if (is_aa) { + if (matrix != NULL) + asp->matrix = matrix; + else { + asp->matrix = load_default_matrix(); + local_matrix = TRUE; + } } asp->is_aa = is_aa; asp->totlen = 0; asp->positive = 0; asp->identical = 0; asp->gaps = 0; - asp->master_sip = SeqIdDup(TxGetQueryIdFromSeqAlign(sap)); - asp->target_sip = TxGetSubjectIdFromSeqAlign(sap); - - if (mask_loc) { /* Mask the query sequence */ - bs_list = CreateMaskByteStore (mask_loc); - q_bsp = BioseqLockById(asp->master_sip); - if (ISA_na(q_bsp->mol) && sap->segtype == SAS_STD) { - StdSegPtr ssp = (StdSegPtr) sap->segs; - frame = SeqLocStart(ssp->loc); - if (SeqLocStrand(ssp->loc) == Seq_strand_minus) { - frame += SeqLocLen(ssp->loc); - frame = -(1+(q_bsp->length - frame)%3); - } else { - frame = (1+frame%3); - } - } else - frame = 0; - repr = q_bsp->repr; - seq_data = q_bsp->seq_data; - code = q_bsp->seq_data_type; - if (!replace_bytestore_data(q_bsp, bs_list, (Uint1)frame)) { - q_bsp->repr = repr; - q_bsp->seq_data = seq_data; - q_bsp->seq_data_type = code; - } - BioseqUnlock(q_bsp); - } - - find_score_in_align(sap, 1, asp); + asp->master_sip = SeqIdDup(TxGetQueryIdFromSeqAlign(sap)); + asp->target_sip = TxGetSubjectIdFromSeqAlign(sap); + + if (mask_loc) { /* Mask the query sequence */ + bs_list = CreateMaskByteStore (mask_loc); + q_bsp = BioseqLockById(asp->master_sip); + if (ISA_na(q_bsp->mol) && sap->segtype == SAS_STD) { + StdSegPtr ssp = (StdSegPtr) sap->segs; + frame = SeqLocStart(ssp->loc); + if (SeqLocStrand(ssp->loc) == Seq_strand_minus) { + frame += SeqLocLen(ssp->loc); + frame = -(1+(q_bsp->length - frame)%3); + } else { + frame = (1+frame%3); + } + } else + frame = 0; + repr = q_bsp->repr; + seq_data = q_bsp->seq_data; + code = q_bsp->seq_data_type; + seq_data_replaced = replace_bytestore_data(q_bsp, bs_list, (Uint1)frame); + if (!seq_data_replaced) { + q_bsp->repr = repr; + q_bsp->seq_data = seq_data; + q_bsp->seq_data_type = code; + } + BioseqUnlock(q_bsp); + ByteStoreListFreeUnused(bs_list, (Uint1)frame); + } + + find_score_in_align(sap, 1, asp); + + /* Restore the unmasked sequence data. */ + if (seq_data_replaced) { + q_bsp = BioseqLockById(asp->master_sip); + q_bsp->repr = repr; + q_bsp->seq_data = seq_data; + q_bsp->seq_data_type = code; + } if (asp && asp->totlen > 0) { Char sign1, sign2; @@ -1273,8 +1218,11 @@ static void PrintOutScore(SeqAlignPtr sap, Boolean is_aa, Int4Ptr PNTR matrix, V printf("<BR><BR>"); } printf("</pre>\n"); - SeqIdFree(asp->master_sip); - MemFree(asp); + + SeqIdFree(asp->master_sip); + if (local_matrix) + free_default_matrix(asp->matrix); + MemFree(asp); } static Int2 CreateRectAlign(SeqAlignPtr sap, PrymPtr PNTR rect, PrymPtr PNTR rectY, FloatHi scalex, FloatHi scaley, Int4 l1, Int4 l2, Int2 color, Int4 from, Int4 ffrom, Int4 to, Int4 tto) @@ -1721,6 +1669,7 @@ static BioseqPtr FindSeqByAccession(CharPtr accver, Int2 id_num, Boolean is_na) if (gi > 0) { ValNodeAddInt(&sip, SEQID_GI, gi); bsp = BioseqLockById(sip); + SeqIdFree(sip); } if (bsp == NULL) @@ -1982,12 +1931,14 @@ static void* ConnectionThreadRun(void *p) if (run_status != WBLAST2_DONE) /* Sleep 4 seconds */ poll(NULL, 0, 4000); } - + + MemFree(fds); + return NULL; } #endif -#ifdef USE_NEW_BLAST +#ifndef USE_OLD_BLAST static void BLASTOptions2SummaryOptions(BLAST_OptionsBlk* options, Char* progname, BLAST_SummaryOptions* s_options) @@ -2031,9 +1982,8 @@ static void BLASTOptions2SummaryOptions(BLAST_OptionsBlk* options, s_options->gap_x_dropoff = options->gap_x_dropoff; s_options->db_length = options->db_length; s_options->word_threshold = options->threshold_second; - /* If window size is set to 0, enforce single hit method for initial - words */ - if (options->window_size == 0) + + if (!options->multiple_hits_only) s_options->init_seed_method = eOneHit; } #endif @@ -2076,7 +2026,6 @@ Int2 Main(void) static PrymPtr PNTR rectY; SeqLocPtr slp1=NULL, slp2=NULL, slp, sl, qslp = NULL; Uint1 align_type; - ValNodePtr other_returns, mask, mask_head; CharPtr buffer = NULL; BLAST_KarlinBlkPtr ka_params=NULL, ka_gap_params=NULL; @@ -2100,9 +2049,11 @@ Int2 Main(void) int pid, time_start, results_size = 0; #endif -#ifdef USE_NEW_BLAST +#ifndef USE_OLD_BLAST BLAST_SummaryOptions* s_options = NULL; - BLAST_SummaryReturn* s_return = NULL; + Blast_SummaryReturn* s_return = NULL; + Boolean mask_at_hash; + EBlastProgramType program_number; #endif #ifdef RLIMIT_CPU @@ -2462,10 +2413,14 @@ Int2 Main(void) StringCpy(options->matrix, mbuf); - /* one-pass non-multiple hits search with low threshold */ - options->two_pass_method = FALSE; - options->multiple_hits_only = FALSE; - options->threshold_second = 9; + /* Use one-pass initial word search with low threshold, except for + tblastx. Also do not use multiple hits approach for finding initial + seeds. */ + options->two_pass_method = FALSE; + if (StrCmp(progname, "tblastx")) { + options->threshold_second = 9; + options->multiple_hits_only = FALSE; + } } else { if (gopen == -1) gopen = (is_megablast) ? 0 : 5; @@ -2597,13 +2552,24 @@ Int2 Main(void) logmsg(0); #endif -#ifndef USE_NEW_BLAST +#ifndef USE_OLD_BLAST + BLAST_SummaryOptionsInit(&s_options); + BLASTOptions2SummaryOptions(options, progname, s_options); + BLAST_TwoSeqLocSets(s_options, slp1, slp2, NULL, &seqalign, &mask, &mask_at_hash, + &s_return); + if (mask_at_hash) { + /* If masking was done for lookup table only, do not use mask locations + for formatting. */ + while (mask) { + SeqLocSetFree(mask->data.ptrvalue); + mask = mask->next; + } + } + + BLAST_SummaryOptionsFree(s_options); +#else seqalign = BlastTwoSequencesByLocEx(slp1, slp2, progname, options, &other_returns, NULL); -#else - BLAST_SummaryOptionsInit(&s_options); - BLASTOptions2SummaryOptions(options, progname, s_options); - BLAST_TwoSeqLocSets(s_options, slp1, slp2, &seqalign, &mask, &s_return); #endif run_status = WBLAST2_FORMAT; /* seqalign = BlastTwoSequencesEx(query_bsp, subject_bsp, progname, @@ -2633,7 +2599,7 @@ Int2 Main(void) return 0; } -#ifndef USE_NEW_BLAST +#ifdef USE_OLD_BLAST mask = NULL; for (vnp=other_returns; vnp; vnp = vnp->next) { switch (vnp->choice) { @@ -3023,7 +2989,22 @@ Int2 Main(void) if (txmatrix) txmatrix = TxMatrixDestruct(txmatrix); dbinfo = TxDfDbInfoDestruct(dbinfo); -#ifndef USE_NEW_BLAST +#ifndef USE_OLD_BLAST + if (s_return->ka_params) { + PrintKAParameters(s_return->ka_params->Lambda, s_return->ka_params->K, + s_return->ka_params->H, 70, stdout, FALSE); + } + if (s_return->ka_params_gap) { + PrintKAParameters(s_return->ka_params_gap->Lambda, + s_return->ka_params_gap->K, + s_return->ka_params_gap->H, 70, stdout, TRUE); + } + BlastProgram2Number(progname, &program_number); + buffer = Blast_GetParametersBuffer(program_number, s_return); + PrintTildeSepLines(buffer, 70, stdout); + sfree(buffer); + Blast_SummaryReturnFree(s_return); +#else if (ka_params) { PrintKAParameters(ka_params->Lambda, ka_params->K, ka_params->H, 70, stdout, FALSE); @@ -3037,25 +3018,14 @@ Int2 Main(void) PrintTildeSepLines(buffer, 70, stdout); MemFree(buffer); free_buff(); +#endif mask_head = mask; while (mask) { SeqLocSetFree(mask->data.ptrvalue); mask = mask->next; } ValNodeFree(mask_head); -#else - if (s_return->ka_params) { - PrintKAParameters(s_return->ka_params->Lambda, s_return->ka_params->K, - s_return->ka_params->H, 70, stdout, FALSE); - } - if (s_return->ka_params_gap) { - PrintKAParameters(s_return->ka_params_gap->Lambda, - s_return->ka_params_gap->K, - s_return->ka_params_gap->H, 70, stdout, TRUE); - } - PrintTildeSepLines(s_return->params_buffer, 70, stdout); - -#endif + CreateTailHTML(); run_status = WBLAST2_DONE; options = BLASTOptionDelete(options); diff --git a/network/wwwblast/Src/wwwblast.h b/network/wwwblast/Src/wwwblast.h index 7df7f90c..657dca15 100644 --- a/network/wwwblast/Src/wwwblast.h +++ b/network/wwwblast/Src/wwwblast.h @@ -1,4 +1,4 @@ -/* $Id: wwwblast.h,v 1.2 2003/05/13 22:00:37 dondosha Exp $ +/* $Id: wwwblast.h,v 1.3 2004/06/30 21:06:21 madden Exp $ * =========================================================================== * * PUBLIC DOMAIN NOTICE @@ -29,12 +29,15 @@ * * Initial Creation Date: 03/15/2000 * -* $Revision: 1.2 $ +* $Revision: 1.3 $ * * File Description: * Definitions for standalone WWW Blast CGI program. * * $Log: wwwblast.h,v $ +* Revision 1.3 2004/06/30 21:06:21 madden +* Add include for blfmtutl.h +* * Revision 1.2 2003/05/13 22:00:37 dondosha * More changes to make alternative links work * @@ -85,6 +88,7 @@ #include <ddvcreate.h> #include <objblst3.h> #include <mblast.h> +#include <blfmtutl.h> #ifdef NCBI_CLIENT_SERVER #include <netblap3.h> |