NCBI C Toolkit Cross Reference

C/access/qblastapi.h


  1 /*   qblastapi.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:  qblastapi.h
 27 *
 28 * Author:  Jonathan Kans
 29 *
 30 * Version Creation Date:   6/28/00
 31 *
 32 * $Revision: 1.11 $
 33 *
 34 * File Description: 
 35 *
 36 * Modifications:  
 37 * --------------------------------------------------------------------------
 38 *
 39 * $Log: qblastapi.h,v $
 40 * Revision 1.11  2003/11/03 20:51:04  madden
 41 * add BLASTGetBOByRIDEx
 42 *
 43 * Revision 1.10  2003/01/15 22:04:50  madden
 44 * Moved BLASTGetSeqAnnotByRIDEx from internal
 45 *
 46 * Revision 1.9  2003/01/02 15:06:48  boemker
 47 * Wrote BLASTGetQueryBioseqByRIDEx that extends behavior of
 48 * BLASTGetQueryBioseqByRID by returning the Bioseq for a particular query
 49 * (rather than always returning the Bioseq for the first query.  Modified
 50 * BLASTGetQueryBioseqByRID to use BLASTGetQueryBioseqByRIDEx.  Wrote
 51 * BLASTGetQuerySummary to return information about a query.
 52 *
 53 * Revision 1.8  2001/02/21 22:07:34  lavr
 54 * Changes for use new CONN interface
 55 *
 56 * Revision 1.7  2000/12/06 17:53:46  madden
 57 * Add prototype for QBBioseqToFasta
 58 *
 59 * Revision 1.6  2000/11/07 21:57:18  shavirin
 60 * Added definition of the new function BLASTGetQueryBioseqByRID()
 61 * Added few connection -oriented defines in the header.
 62 *
 63 * Revision 1.5  2000/07/19 15:17:15  shavirin
 64 * Added loging for this file.
 65 *
 66 * 
 67 * ==========================================================================
 68 */
 69 
 70 #ifndef _QBLASTAPI_
 71 #define _QBLASTAPI_
 72 
 73 #include <ncbi.h>
 74 #include <asn.h>
 75 #include <objseq.h>
 76 #include <urlquery.h>
 77 
 78 #undef NLM_EXTERN
 79 #ifdef NLM_IMPORT
 80 #define NLM_EXTERN NLM_IMPORT
 81 #else
 82 #define NLM_EXTERN extern
 83 #endif
 84 
 85 
 86 #ifdef __cplusplus
 87 extern "C" {
 88 #endif
 89 
 90 
 91 typedef void (LIBCALLBACK *QBlastAnnounceProc) (
 92   Nlm_CharPtr requestID,
 93   Nlm_CharPtr seqID,
 94   Nlm_Int2 estimatedSeconds
 95 );
 96 
 97 typedef Nlm_Boolean (LIBCALLBACK *QBlastResultProc) (
 98   Nlm_CharPtr filename,
 99   Nlm_VoidPtr userdata,
100   Nlm_CharPtr requestID,
101   Nlm_CharPtr seqID,
102   Nlm_Boolean success
103 );
104 
105 /* Opaque handle type.  Variable must be kept by application and initialized
106  * to NULL.
107  */
108 struct QBQueueTag;
109 typedef struct QBQueueTag* QBQUEUE;  /* queue handle */
110 
111 /* low-level connection functions */
112 
113 NLM_EXTERN CONN QBlastOpenConnection (
114   void
115 );
116 
117 NLM_EXTERN EIO_Status QBlastWaitForReply (
118   CONN conn
119 );
120 
121 /*
122  QBlastAsynchronousRequest open a connection, send a FASTA
123  request, obtains a request ID, and after the expected
124  time starts checking for results every 5 seconds
125 */
126 
127 NLM_EXTERN Boolean QBlastAsynchronousRequest (
128   CharPtr database,
129   CharPtr program,
130   BioseqPtr bsp,
131   QBQUEUE* queue,
132   QBlastResultProc resultproc,
133   QBlastAnnounceProc announceproc,
134   VoidPtr userdata
135 );
136 
137 /*
138  QBlastCheckQueue should be called several times a
139  second with a timer.  It calls QUERY_CheckQueue to
140  poll connection, which calls completion routine when
141  result is available, cleaning up connection afterwards.
142 */
143 
144 NLM_EXTERN Int4 QBlastCheckQueue (
145   QBQUEUE* queue
146 );
147 
148 /*
149  QBlastCheckRequest allows resumption of checking for
150  a result if the program was cancelled before the result
151  was ready.
152 */
153 
154 NLM_EXTERN Boolean QBlastCheckRequest (
155   CharPtr rid,
156   QBQUEUE* queue,
157   QBlastResultProc resultproc,
158   QBlastAnnounceProc announceproc,
159   VoidPtr userdata
160 );
161 
162 /*
163   Forces all connections to be closed, removes all queries from queue.
164 */
165 NLM_EXTERN void QBlastCloseQueue (
166   QBQUEUE* queue
167 );
168 
169 /*
170   Prints a summary of active queries.
171 */
172 NLM_EXTERN Int4 PrintQBlastQueue (
173   QBQUEUE* queue,
174   FILE *fp
175 );
176 
177 
178 /* produce fasta for qblast queries. */
179 Boolean QBBioseqToFasta (BioseqPtr bsp, FILE *fp, Boolean is_na);
180 
181 /* 
182    Function to get SeqAnnot for RID. We suppose, that search already
183    finished and results are exists on the Qblast repository 
184 */
185 NLM_EXTERN SeqAnnotPtr BLASTGetSeqAnnotByRID(CharPtr RID);
186 
187 /*
188         Returns a SeqAnnot for a given RID.
189 
190         If host_machine and host_path are set to NULL and host_port to zero
191         default server will be used.
192 
193         if query_number is set to zero all will be returned, otherwise the
194         one-based offset query will be returned.
195  */
196 NLM_EXTERN SeqAnnotPtr BLASTGetSeqAnnotByRIDEx(CharPtr RID,
197                                                Nlm_CharPtr host_machine,
198                                                Nlm_Uint2 host_port,
199                                                Nlm_CharPtr host_path,
200                                                Int4 query_number);
201 
202 
203 /* 
204    Function to get Query Bioseq for RID. We suppose, that search already
205    finished and results are exists on the Qblast repository 
206 */
207 NLM_EXTERN BioseqPtr BLASTGetQueryBioseqByRID(CharPtr RID);
208 NLM_EXTERN BioseqPtr BLASTGetQueryBioseqByRIDEx(CharPtr RID, int query_num);
209 
210 NLM_EXTERN Nlm_Boolean BLASTGetQuerySummary(CharPtr RID, Int4 query_number,
211     CharPtr *defline, Int4Ptr query_length);
212 
213 /* Function to get BlastObject for RID. We suppose, that search already
214    finished and results are exists on the Qblast repository. Blast Object
215    ASN.1 will be returned as CharPtr buffer
216 */
217 NLM_EXTERN CharPtr BLASTGetBOByRID(CharPtr RID);
218 NLM_EXTERN CharPtr BLASTGetBOByRIDEx(CharPtr RID, Nlm_CharPtr host_machine, Nlm_Uint2 host_port, Nlm_CharPtr host_path);
219 
220 #ifdef __cplusplus
221 }
222 #endif
223 
224 #undef NLM_EXTERN
225 #ifdef NLM_EXPORT
226 #define NLM_EXTERN NLM_EXPORT
227 #else
228 #define NLM_EXTERN
229 #endif
230 
231 #endif /* _QBLASTAPI_ */
232 
233 

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.