NCBI C Toolkit Cross Reference

C/access/tax3api.h


  1 /*   tax3api.h
  2 * ===========================================================================
  3 *
  4 *                            PUBLIC DOMAIN NOTICE
  5 *            National Center for Biotechnology Information (NCBI)
  6 *
  7 *  This software/database is a "United States Government Work" under the
  8 *  terms of the United States Copyright Act.  It was written as part of
  9 *  the author's official duties as a United States Government employee and
 10 *  thus cannot be copyrighted.  This software/database is freely available
 11 *  to the public for use. The National Library of Medicine and the U.S.
 12 *  Government do not place any restriction on its use or reproduction.
 13 *  We would, however, appreciate having the NCBI and the author cited in
 14 *  any work or product based on this material
 15 *
 16 *  Although all reasonable efforts have been taken to ensure the accuracy
 17 *  and reliability of the software and data, the NLM and the U.S.
 18 *  Government do not and cannot warrant the performance or results that
 19 *  may be obtained by using this software or data. The NLM and the U.S.
 20 *  Government disclaim all warranties, express or implied, including
 21 *  warranties of performance, merchantability or fitness for any particular
 22 *  purpose.
 23 *
 24 * ===========================================================================
 25 *
 26 * File Name:  tax3api.h
 27 *
 28 * Author:  Jonathan Kans
 29 *
 30 * Version Creation Date:   7/8/04
 31 *
 32 * $Revision: 1.19 $
 33 *
 34 * File Description: 
 35 *
 36 * Modifications:  
 37 * --------------------------------------------------------------------------
 38 * Date     Name        Description of modification
 39 * -------  ----------  -----------------------------------------------------
 40 *
 41 *
 42 * ==========================================================================
 43 */
 44 
 45 
 46 #ifndef _TAX3API_
 47 #define _TAX3API_
 48 
 49 #include <ncbi.h>
 50 #include <asn.h>
 51 #include <objtax3.h>
 52 #include <urlquery.h>
 53 #include <objfeat.h>
 54 
 55 #undef NLM_EXTERN
 56 #ifdef NLM_IMPORT
 57 #define NLM_EXTERN NLM_IMPORT
 58 #else
 59 #define NLM_EXTERN extern
 60 #endif
 61 
 62 
 63 #ifdef __cplusplus
 64 extern "C" {
 65 #endif
 66 
 67 
 68 /* low-level connection functions */
 69 
 70 NLM_EXTERN CONN Tax3OpenConnection (
 71   void
 72 );
 73 
 74 NLM_EXTERN Taxon3ReplyPtr Tax3WaitForReply (
 75   CONN conn
 76 );
 77 
 78 /*
 79  Tax3SynchronousQuery opens connection, sends an
 80  ASN.1 request, and waits for a reply, cleaning
 81  up the connection afterwards.
 82 */
 83 
 84 NLM_EXTERN Taxon3ReplyPtr Tax3SynchronousQuery (
 85   Taxon3RequestPtr t3rq
 86 );
 87 
 88 /*
 89  Tax3AsynchronousQuery opens connection, send request,
 90  and queues completion routine using urlquery queueing
 91  mechanism.
 92 
 93  Tax3CheckQueue should be called several times a second with
 94  a timer.  It calls QUERY_CheckQueue to poll connection,
 95  which calls completion routine when result is available,
 96  cleaning up connection afterwards.
 97 
 98  Tax3ReadReply take conns and status parameters from completion
 99  routine and reads Taxon3ReplyPtr.
100 */
101 
102 NLM_EXTERN Boolean Tax3AsynchronousQuery (
103   Taxon3RequestPtr t3rq,
104   QUEUE* queue,
105   QueryResultProc resultproc,
106   VoidPtr userdata
107 );
108 
109 NLM_EXTERN Int4 Tax3CheckQueue (
110   QUEUE* queue
111 );
112 
113 NLM_EXTERN Taxon3ReplyPtr Tax3ReadReply (
114   CONN conn,
115   EIO_Status status
116 );
117 
118 
119 /* request creation function */
120 
121 NLM_EXTERN Taxon3RequestPtr CreateTaxon3Request (
122   Int4 taxid,
123   CharPtr name,
124   OrgRefPtr orp
125 );
126 
127 NLM_EXTERN Taxon3RequestPtr CreateMultiTaxon3Request (ValNodePtr org_list);
128 
129 NLM_EXTERN OrgRefPtr Taxon3GetOrg (OrgRefPtr orp);
130 NLM_EXTERN ValNodePtr Taxon3GetOrgRefList (ValNodePtr org_list);
131 NLM_EXTERN void Tax3MergeSourceDescr (SeqEntryPtr sep, Pointer data, Int4 index, Int2 indent);
132 NLM_EXTERN Int4 Taxon3GetTaxIdByOrgRef (OrgRefPtr orp);
133 NLM_EXTERN OrgRefPtr Taxon3GetOrgRefByName (CharPtr orgname);
134 NLM_EXTERN Int4 Taxon3GetTaxIdByName (CharPtr orgname);
135 NLM_EXTERN void Taxon3ReplaceOrgInSeqEntry (SeqEntryPtr sep, Boolean keep_syn);
136 
137 NLM_EXTERN void Taxon3CheckOrgInSeqEntry (SeqEntryPtr sep, ValNodePtr PNTR not_found, ValNodePtr PNTR bad_match);
138 NLM_EXTERN void CheckTaxNamesAgainstTaxDatabase (ValNodePtr PNTR discrepancy_list, ValNodePtr sep_list);
139 
140 typedef enum {
141   eReturnedOrgFlag_normal = 3,
142   eReturnedOrgFlag_misspelled = 4,
143   eReturnedOrgFlag_ambiguous = 5,
144   eReturnedOrgFlag_error
145 } EReturnedOrgFlag;
146 
147 typedef enum {
148   eSpecificHostFix_unrecognized = 0,
149   eSpecificHostFix_spelling,
150   eSpecificHostFix_capitalization,
151   eSpecificHostFix_truncation,
152   eSpecificHostFix_replacement,
153   eSpecificHostFix_ambiguous
154 } ESpecificHostFix;
155 
156 NLM_EXTERN void 
157 Taxon3ValidateSpecificHostsInSeqEntry 
158 (SeqEntryPtr sep,
159  ValNodePtr PNTR misspelled_list,
160  ValNodePtr PNTR bad_caps_list,
161  ValNodePtr PNTR ambiguous_list,
162  ValNodePtr PNTR unrecognized_list);
163 
164 typedef struct specifichostfix {
165   ValNodePtr feat_or_desc;
166   CharPtr    bad_specific_host;
167   CharPtr    old_taxname;
168   CharPtr    new_taxname;
169   Uint1      fix_type;
170 } SpecificHostFixData, PNTR SpecificHostFixPtr;
171 
172 extern ValNodePtr SpecificHostFixListFree (ValNodePtr vnp);
173 extern Boolean ApplyOneSpecificHostFix (SpecificHostFixPtr s);
174 /* returns ValNodePtr list of SpecificHostFixPtr */
175 NLM_EXTERN ValNodePtr Taxon3GetSpecificHostFixesInSeqEntry (SeqEntryPtr sep, Boolean caps, Boolean paren);
176 
177 NLM_EXTERN ValNodePtr GetOrganismTaxLookupFailuresInSeqEntry (SeqEntryPtr sep);
178 
179 typedef struct taxfixitem {
180   Uint1 data_choice;
181   Pointer data;
182   OrgRefPtr response_org;
183   CharPtr taxname;
184   CharPtr suggested_fix;
185   CharPtr rank;
186 } TaxFixItemData, PNTR TaxFixItemPtr;
187 
188 NLM_EXTERN TaxFixItemPtr TaxFixItemNew (void);
189 NLM_EXTERN TaxFixItemPtr TaxFixItemCopy (TaxFixItemPtr orig);
190 NLM_EXTERN TaxFixItemPtr TaxFixItemFree (TaxFixItemPtr t);
191 NLM_EXTERN ValNodePtr LIBCALLBACK TaxFixItemListFree (ValNodePtr vnp);
192 NLM_EXTERN ValNodePtr Taxon3GetTaxFixList (ValNodePtr biop_list);
193 
194 
195 
196 #ifdef __cplusplus
197 }
198 #endif
199 
200 #undef NLM_EXTERN
201 #ifdef NLM_EXPORT
202 #define NLM_EXTERN NLM_EXPORT
203 #else
204 #define NLM_EXTERN
205 #endif
206 
207 #endif /* _TAX3API_ */
208 
209 

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.