1 /*  explore.h
2 * ===========================================================================
3 *
4 *                            PUBLIC DOMAIN NOTICE
5 *               National Center for Biotechnology Information
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 have not placed any restriction on its use or reproduction.
13 *
14 *  Although all reasonable efforts have been taken to ensure the accuracy
15 *  and reliability of the software and data, the NLM and the U.S.
16 *  Government do not and cannot warrant the performance or results that
17 *  may be obtained by using this software or data. The NLM and the U.S.
18 *  Government disclaim all warranties, express or implied, including
19 *  warranties of performance, merchantability or fitness for any particular
20 *  purpose.
21 *
22 *  Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * File Name:  explore.h
27 *
28 * Author:  Jonathan Kans, Jinghui Zhang, James Ostell
29 *
30 * Version Creation Date: 6/30/98
31 *
32 * $Revision: 6.59 $
33 *
34 * File Description:  Reengineered and optimized exploration functions
35 *                      to be used for future code
36 *
37 * Modifications:
38 * --------------------------------------------------------------------------
39 * Date	   Name        Description of modification
40 * -------  ----------  -----------------------------------------------------
41 *
42 * ==========================================================================
43 */
44 
45 #ifndef _NCBI_Explore_
46 #define _NCBI_Explore_
47 
48 #ifndef _NCBI_Seqset_
49 #include <objsset.h>
50 #endif
51 
52 #undef NLM_EXTERN
53 #ifdef NLM_IMPORT
54 #define NLM_EXTERN NLM_IMPORT
55 #else
56 #define NLM_EXTERN extern
57 #endif
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
63 /*****************************************************************************
64 *
65 *   SeqMgrBioseqContext, SeqMgrSegmentContext, SeqMgrDescContext and SeqMgrFeatContext
66 *     are data structures supporting the collection of bioseqs, parts of segmented
67 *     bioseqs, descriptors, and features, respectively
68 *
69 *****************************************************************************/
70 
71 typedef struct seqmgrbioseqcontext {
72   Uint2         entityID;
73   Uint4         itemID;
74   BioseqPtr     bsp;
75   SeqEntryPtr   sep;
76   BioseqSetPtr  bssp;
77   Int4          numsegs;
78   Pointer       userdata;
79                           /* the following fields are for internal use only */
80   Pointer       omdp;
81   Uint4         index;
82 } SeqMgrBioseqContext, PNTR SeqMgrBioseqContextPtr;
83 
84 typedef struct seqmgrsegmentcontext {
85   Uint2         entityID;
86   Uint4         itemID;
87   SeqLocPtr     slp;
88   BioseqPtr     parent;
89   Int4          cumOffset;
90   Int4          from;
91   Int4          to;
92   Uint1         strand;
93   Pointer       userdata;
94                           /* the following fields are for internal use only */
95   Pointer       omdp;
96   Uint4         index;
97 } SeqMgrSegmentContext, PNTR SeqMgrSegmentContextPtr;
98 
99 typedef struct seqmgrdesccontext {
100   Uint2         entityID;
101   Uint4         itemID;
102   ValNodePtr    sdp;
103   SeqEntryPtr   sep;
104   Uint2         level;
105   Uint1         seqdesctype;
106   Pointer       userdata;
107                           /* the following fields are for internal use only */
108   Pointer       omdp;
109   Uint4         index;
110 } SeqMgrDescContext, PNTR SeqMgrDescContextPtr;
111 
112 typedef struct seqmgrfeatcontext {
113   Uint2         entityID;
114   Uint4         itemID;
115   SeqFeatPtr    sfp;
116   SeqAnnotPtr   sap;
117   BioseqPtr     bsp;
118   CharPtr       label;
119   Int4          left;
120   Int4          right;
121   Int4          dnaStop;
122   Boolean       partialL;
123   Boolean       partialR;
124   Boolean       external;
125   Boolean       farloc;
126   Boolean       bad_order;
127   Boolean       mixed_strand;
128   Uint1         strand;
129   Uint1         seqfeattype;
130   Uint1         featdeftype;
131   Int2          numivals;
132   Int4Ptr       ivals;
133   Pointer       userdata;
134                           /* the following fields are for internal use only */
135   Boolean       ts_image;
136   Pointer       omdp;
137   Uint4         index;
138 } SeqMgrFeatContext, PNTR SeqMgrFeatContextPtr;
139 
140 typedef struct seqmgrandcontext {
141   Uint2         entityID;
142   Uint4         itemID;
143   AnnotDescPtr  adp;
144   Uint1         annotdesctype;
145   Pointer       userdata;
146                           /* the following fields are for internal use only */
147   Pointer       omdp;
148   Uint4         index;
149 } SeqMgrAndContext, PNTR SeqMgrAndContextPtr;
150 
151 /*****************************************************************************
152 *
153 *   SeqMgrIndexFeatures builds indices of sorted features for all bioseqs in an
154 *     entity, makes explicit connections from a protein bioseq to its best protein
155 *     feature and to the CDS feature encoding it, can be called given an entityID
156 *     or a BioseqPtr or SeqEntryPtr, and returns the entityID
157 *
158 *****************************************************************************/
159 
160 NLM_EXTERN Uint2 LIBCALL SeqMgrIndexFeatures (
161   Uint2 entityID,
162   Pointer ptr
163 );
164 
165 
166 /*****************************************************************************
167 *
168 *   To find the best protein feature for a CDS, first call SeqMgrGetProtXref.
169 *     If it is NULL, call SeqMgrGetBestProteinFeature.
170 *   SeqMgrGetBestProteinFeature and SeqMgrGetCDSgivenProduct take a protein
171 *     bioseq to get the best protein feature or encoding CDS
172 *   SeqMgrGetRNAgivenProduct takes an mRNA (cDNA) bioseq and gets the encoding
173 *     mRNA feature on the genomic bioseq
174 *   SeqMgrGetPROTgivenProduct takes an protein bioseq and gets the encoding
175 *     processed protein feature on a precursor protein bioseq
176 *
177 *****************************************************************************/
178 
179 NLM_EXTERN ProtRefPtr LIBCALL SeqMgrGetProtXref (
180   SeqFeatPtr sfp
181 );
182 
183 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetBestProteinFeature (
184   BioseqPtr bsp,
185   SeqMgrFeatContext PNTR context
186 );
187 
188 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetCDSgivenProduct (
189   BioseqPtr bsp,
190   SeqMgrFeatContext PNTR context
191 );
192 
193 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetRNAgivenProduct (
194   BioseqPtr bsp,
195   SeqMgrFeatContext PNTR context
196 );
197 
198 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetPROTgivenProduct (
199   BioseqPtr bsp,
200   SeqMgrFeatContext PNTR context
201 );
202 
203 /*****************************************************************************
204 *
205 *   To find the best gene feature, first call SeqMgrGetGeneXref, and if it is not
206 *     NULL call SeqMgrGeneIsSuppressed, otherwise call SeqMgrGetOverlappingGene,
207 *     passing sfp->location
208 *   If desired, place a SeqMgrFeatContext data structure on the stack, and pass
209 *     in &context as the second parameter to SeqMgrGetOverlappingGene
210 *
211 *****************************************************************************/
212 
213 NLM_EXTERN GeneRefPtr LIBCALL SeqMgrGetGeneXref (
214   SeqFeatPtr sfp
215 );
216 
217 NLM_EXTERN GeneRefPtr LIBCALL SeqMgrGetGeneXrefEx (
218   SeqFeatPtr sfp,
219   ObjectIdPtr PNTR oipP
220 );
221 
222 NLM_EXTERN Boolean LIBCALL SeqMgrGeneIsSuppressed (
223   GeneRefPtr grp
224 );
225 
226 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetOverlappingGene (
227   SeqLocPtr slp,
228   SeqMgrFeatContext PNTR context
229 );
230 
231 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetOverlappingOperon (
232   SeqLocPtr slp,
233   SeqMgrFeatContext PNTR context
234 );
235 
236 /*****************************************************************************
237 *
238 *   SeqMgrGetOverlappingXXX returns the overlapping mRNA/CDS/publication/biosource
239 *     feature
240 *   If desired, place a SeqMgrFeatContext data structure on the stack, and pass
241 *     in &context as the second parameter
242 *
243 *****************************************************************************/
244 
245 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetOverlappingmRNA (
246   SeqLocPtr slp,
247   SeqMgrFeatContext PNTR context
248 );
249 
250 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetLocationSupersetmRNA (
251   SeqLocPtr slp,
252   SeqMgrFeatContext PNTR context
253 );
254 
255 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetOverlappingCDS (
256   SeqLocPtr slp,
257   SeqMgrFeatContext PNTR context
258 );
259 
260 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetOverlappingPub (
261   SeqLocPtr slp,
262   SeqMgrFeatContext PNTR context
263 );
264 
265 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetOverlappingSource (
266   SeqLocPtr slp,
267   SeqMgrFeatContext PNTR context
268 );
269 
270 /*****************************************************************************
271 *
272 *   Replacements for BioseqContext functions using bioseq feature indices, returning
273 *     the next (sorted) feature or (bioseq to highest set) descriptor pointer
274 *   The SeqMgrDescContext or SeqMgrFeatContext data structures should be on the
275 *     calling function's stack, and are passed as &context to the context function.
276 *   Passing NULL for curr in the first call initializes the context structure, and
277 *     the functions return NULL at the end of the list
278 *   If the choice parameters are 0, every feature or descriptor is returned
279 *   It is expected that these calls would be flanked by BioseqLock and BioseqUnlock,
280 *     so object manager reload could ensure that pointers are valid within the loop,
281 *     since the pointers are what drive these functions
282 *   The Explore functions below offer more flexibility than these Context functions
283 *
284 *****************************************************************************/
285 
286 NLM_EXTERN ValNodePtr LIBCALL SeqMgrGetNextDescriptor (
287   BioseqPtr bsp,
288   ValNodePtr curr,
289   Uint1 seqDescChoice,
290   SeqMgrDescContext PNTR context
291 );
292 
293 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetNextFeature (
294   BioseqPtr bsp,
295   SeqFeatPtr curr,
296   Uint1 seqFeatChoice,
297   Uint1 featDefChoice,
298   SeqMgrFeatContext PNTR context
299 );
300 
301 NLM_EXTERN AnnotDescPtr LIBCALL SeqMgrGetNextAnnotDesc (
302   BioseqPtr bsp,
303   AnnotDescPtr curr,
304   Uint1 annotDescChoice,
305   SeqMgrAndContext PNTR context
306 );
307 
308 /*****************************************************************************
309 *
310 *   Callback types for SeqMgrExploreBioseqs, SeqMgrExploreSegments,
311 *     SeqMgrExploreDescriptors, and SeqMgrExploreFeatures
312 *
313 *****************************************************************************/
314 
315 typedef Boolean (LIBCALLBACK *SeqMgrBioseqExploreProc) (
316   BioseqPtr bsp,
317   SeqMgrBioseqContextPtr context
318 );
319 
320 typedef Boolean (LIBCALLBACK *SeqMgrSegmentExploreProc) (
321   SeqLocPtr slp,
322   SeqMgrSegmentContextPtr context
323 );
324 
325 typedef Boolean (LIBCALLBACK *SeqMgrDescExploreProc) (
326   ValNodePtr sdp,
327   SeqMgrDescContextPtr context
328 );
329 
330 typedef Boolean (LIBCALLBACK *SeqMgrFeatExploreProc) (
331   SeqFeatPtr sfp,
332   SeqMgrFeatContextPtr context
333 );
334 
335 /*****************************************************************************
336 *
337 *   SeqMgrExploreBioseqs, SeqMgrExploreSegments, SeqMgrExploreDescriptors, and
338 *     SeqMgrExploreFeatures use the bioseq feature indices to quickly present
339 *     desired items to the user-supplied callback function, stopping if the callback
340 *     returns FALSE
341 *   In contrast to the SeqMgrGetNext functions, the SeqMgrExplore function callbacks
342 *     pass a pointer to the SeqMgr[Bioseq/Segment/Desc/Feat]Context data structures
343 *     held by the explore function, not on the calling function's stack
344 *   If the filter parameters are NULL, every feature or descriptor is returned,
345 *     otherwise the array lengths should be SEQDESCR_MAX, SEQFEAT_MAX, and
346 *     FEATDEF_MAX, and the elements are from the Seq_descr_, SEQFEAT_, and FEATDEF_
347 *     lists
348 *   It is expected that these calls would be flanked by BioseqLock and BioseqUnlock,
349 *     so object manager reload could ensure that pointers are valid within the loop,
350 *     but these explore functions can work on cached-out records
351 *   All of these functions return the number of times the callback was called
352 *
353 *****************************************************************************/
354 
355 NLM_EXTERN Int4 LIBCALL SeqMgrExploreBioseqs (
356   Uint2 entityID,
357   Pointer ptr,
358   Pointer userdata,
359   SeqMgrBioseqExploreProc userfunc,
360   Boolean nucs,
361   Boolean prots,
362   Boolean parts
363 );
364 
365 NLM_EXTERN Int4 LIBCALL SeqMgrExploreSegments (
366   BioseqPtr bsp,
367   Pointer userdata,
368   SeqMgrSegmentExploreProc userfunc
369 );
370 
371 NLM_EXTERN Int4 LIBCALL SeqMgrExploreDescriptors (
372   BioseqPtr bsp,
373   Pointer userdata,
374   SeqMgrDescExploreProc userfunc,
375   BoolPtr seqDescFilter
376 );
377 
378 NLM_EXTERN Int4 LIBCALL SeqMgrExploreFeatures (
379   BioseqPtr bsp,
380   Pointer userdata,
381   SeqMgrFeatExploreProc userfunc,
382   SeqLocPtr locationFilter,
383   BoolPtr seqFeatFilter,
384   BoolPtr featDefFilter
385 );
386 
387 /*****************************************************************************
388 *
389 *   SeqMgrGetFeatureByLabel returns a feature with the desired label
390 *   If desired, place a SeqMgrFeatContext data structure on the stack, and pass
391 *     in &context as the last parameter
392 *   SeqMgrGetNextFeatureByLabel works like SeqMgrGetNextFeature, except that
393 *     the order is by alphabetized label, not by chromosomal position
394 *
395 *****************************************************************************/
396 
397 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetFeatureByLabel (
398   BioseqPtr bsp,
399   CharPtr label,
400   Uint1 seqFeatChoice,
401   Uint1 featDefChoice,
402   SeqMgrFeatContext PNTR context
403 );
404 
405 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetNextFeatureByLabel (
406   BioseqPtr bsp,
407   SeqFeatPtr curr,
408   Uint1 seqFeatChoice,
409   Uint1 featDefChoice,
410   SeqMgrFeatContext PNTR context
411 );
412 
413 /*****************************************************************************
414 *
415 *   SeqMgrGetGeneByLocusTag returns a gene feature with the desired locus_tag
416 *   If desired, place a SeqMgrFeatContext data structure on the stack, and pass
417 *     in &context as the last parameter
418 *   SeqMgrGetNextGeneByLocusTag works like SeqMgrGetNextFeatureByLabel, except
419 *     that it returns only genes ordered by locus_tag
420 *   SeqMgrGetFeatureByFeatID returns a feature based on SeqFeatXref.id or
421 *     feature ID string
422 *
423 *****************************************************************************/
424 
425 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetGeneByLocusTag (
426   BioseqPtr bsp,
427   CharPtr locusTag,
428   SeqMgrFeatContext PNTR context
429 );
430 
431 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetNextGeneByLocusTag (
432   BioseqPtr bsp,
433   SeqFeatPtr curr,
434   SeqMgrFeatContext PNTR context
435 );
436 
437 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetFeatureByFeatID (
438   Uint2 entityID,
439   BioseqPtr bsp,
440   CharPtr featid,
441   SeqFeatXrefPtr xref,
442   SeqMgrFeatContext PNTR context
443 );
444 
445 /*****************************************************************************
446 *
447 *   SeqMgrGetDesiredDescriptor and SeqMgrGetDesiredFeature return a descriptor
448 *     or feature given either an itemID, a position index, or the feature or
449 *     descriptor pointer itself, using whichever parameter is not 0 (or NULL)
450 *   In order to obtain index information associated with the desired descriptor
451 *     or feature, place a SeqMgrDescContext or SeqMgrFeatContext data structure
452 *     on the stack, and pass in &context as the last parameter
453 *
454 *****************************************************************************/
455 
456 NLM_EXTERN ValNodePtr LIBCALL SeqMgrGetDesiredDescriptor (
457   Uint2 entityID,
458   BioseqPtr bsp,
459   Uint4 itemID,
460   Uint4 index,
461   ValNodePtr sdp,
462   SeqMgrDescContext PNTR context
463 );
464 
465 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetDesiredFeature (
466   Uint2 entityID,
467   BioseqPtr bsp,
468   Uint4 itemID,
469   Uint4 index,
470   SeqFeatPtr sfp,
471   SeqMgrFeatContext PNTR context
472 );
473 
474 NLM_EXTERN AnnotDescPtr LIBCALL SeqMgrGetDesiredAnnotDesc (
475   Uint2 entityID,
476   BioseqPtr bsp,
477   Uint4 itemID,
478   SeqMgrAndContext PNTR context
479 );
480 
481 /*****************************************************************************
482 *
483 *   SeqMgrVisitDescriptors and SeqMgrVisitFeatures visit all descriptors or
484 *     features in an entity in order of itemID, which is assigned by order of
485 *     packaging within the record
486 *   Both of these functions return the number of times the callback was called
487 *
488 *****************************************************************************/
489 
490 NLM_EXTERN Int2 LIBCALL SeqMgrVisitDescriptors (
491   Uint2 entityID,
492   Pointer userdata,
493   SeqMgrDescExploreProc userfunc,
494   BoolPtr seqDescFilter
495 );
496 
497 NLM_EXTERN Int2 LIBCALL SeqMgrVisitFeatures (
498   Uint2 entityID,
499   Pointer userdata,
500   SeqMgrFeatExploreProc userfunc,
501   BoolPtr seqFeatFilter,
502   BoolPtr featDefFilter
503 );
504 
505 /*****************************************************************************
506 *
507 *   BioseqFindFromSeqLoc finds the segmented bioseq if location is join on parts,
508 *     and does so even if some of the intervals are far accessions.
509 *
510 *****************************************************************************/
511 
512 NLM_EXTERN BioseqPtr BioseqFindFromSeqLoc (
513   SeqLocPtr loc
514 );
515 
516 /*****************************************************************************
517 *
518 *   SeqMgrGetParentOfPart returns the segmented bioseq parent of a part bioseq,
519 *     and fills in the context structure.
520 *
521 *****************************************************************************/
522 
523 NLM_EXTERN BioseqPtr LIBCALL SeqMgrGetParentOfPart (
524   BioseqPtr bsp,
525   SeqMgrSegmentContext PNTR context
526 );
527 
528 /*****************************************************************************
529 *
530 *   SeqMgrGetBioseqContext fills in the context structure for any bioseq.
531 *
532 *****************************************************************************/
533 
534 NLM_EXTERN Boolean LIBCALL SeqMgrGetBioseqContext (
535   BioseqPtr bsp,
536   SeqMgrBioseqContext PNTR context
537 );
538 
539 /*****************************************************************************
540 *
541 *   SeqMgrBuildFeatureIndex builds a sorted array index for any feature type
542 *     (gene, mRNA, CDS, publication, and biosource have built-in arrays)
543 *   SeqMgrGetOverlappingFeature uses the array, or a feature subtype (chocies
544 *     are FEATDEF_GENE, FEATDEF_CDS, FEATDEF_mRNA, FEATDEF_PUB, or FEATDEF_BIOSRC)
545 *     to find feature overlap, requiring either that the location be completely
546 *     contained within the feature range, or merely that it be overlapped by the
547 *     feature, and returns the position in the index
548 *   SeqMgrGetFeatureInIndex gets an arbitrary feature indexed by the array
549 *   SeqMgrGetAllOverlappingFeatures returns all features that overlap with the
550 *     indicated overlap specificity
551 *   TestFeatOverlap checks to see if feature A is in feature B with the
552 *     indicated overlap specificity, -1 return value on failure
553 *
554 *****************************************************************************/
555 
556 #define SIMPLE_OVERLAP   0 /* any overlap of extremes */
557 #define CONTAINED_WITHIN 1 /* contained within extremes */
558 #define LOCATION_SUBSET  2 /* SeqLocAinB must be satisfied, no boundary checking */
559 #define CHECK_INTERVALS  3 /* SeqLocAinB plus internal exon-intron boundaries must match */
560 #define INTERVAL_OVERLAP 4 /* at least one pair of intervals must overlap */
561 #define COMMON_INTERVAL  5 /* at least one pair of intervals must match */
562 #define RANGE_MATCH      6 /* the left and right ends must match exactly */
563 
564 NLM_EXTERN VoidPtr LIBCALL SeqMgrBuildFeatureIndex (
565   BioseqPtr bsp,
566   Int4Ptr num,
567   Uint1 seqFeatChoice,
568   Uint1 featDefChoice
569 );
570 
571 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetOverlappingFeature (
572   SeqLocPtr slp,
573   Uint2 subtype,
574   VoidPtr featarray,
575   Int4 numfeats,
576   Int4Ptr position,
577   Int2 overlapType,
578   SeqMgrFeatContext PNTR context
579 );
580 
581 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetOverlappingFeatureEx (
582   SeqLocPtr slp,
583   Uint2 subtype,
584   VoidPtr featarray,
585   Int4 numfeats,
586   Int4Ptr position,
587   Int2 overlapType,
588   SeqMgrFeatContext PNTR context,
589   Boolean special
590 );
591 
592 NLM_EXTERN SeqFeatPtr LIBCALL SeqMgrGetFeatureInIndex (
593   BioseqPtr bsp,
594   VoidPtr featarray,
595   Int4 numfeats,
596   Uint4 index,
597   SeqMgrFeatContext PNTR context
598 );
599 
600 NLM_EXTERN Int2 LIBCALL SeqMgrGetAllOverlappingFeatures (
601   SeqLocPtr slp,
602   Uint2 subtype,
603   VoidPtr featarray,
604   Int4 numfeats,
605   Int2 overlapType,
606   Pointer userdata,
607   SeqMgrFeatExploreProc userfunc
608 );
609 
610 NLM_EXTERN Int4 TestFeatOverlap (
611   SeqFeatPtr sfpA,
612   SeqFeatPtr sfpB,
613   Int2 overlapType
614 );
615 
616 /* the following functions are not frequently called by applications */
617 
618 /*****************************************************************************
619 *
620 *   SeqMgrFeaturesAreIndexed returns the last time feature indices were built,
621 *     with 0 meaning that indices are not present on the entity
622 *
623 *****************************************************************************/
624 
625 NLM_EXTERN time_t LIBCALL SeqMgrFeaturesAreIndexed (
626   Uint2 entityID
627 );
628 
629 /*****************************************************************************
630 *
631 *   SeqMgrClearFeatureIndexes clears feature indices for an entity given an
632 *     entityID or a BioseqPtr or SeqEntryPtr
633 *
634 *****************************************************************************/
635 
636 NLM_EXTERN Boolean LIBCALL SeqMgrClearFeatureIndexes (
637   Uint2 entityID,
638   Pointer ptr
639 );
640 
641 /*****************************************************************************
642 *
643 *   SeqMgrIndexFeaturesEx allows indexing on opposite strand for upside-down Web views
644 *
645 *****************************************************************************/
646 
647 NLM_EXTERN Uint2 LIBCALL SeqMgrIndexFeaturesEx (
648   Uint2 entityID,
649   Pointer ptr,
650   Boolean flip,
651   Boolean dorevfeats
652 );
653 
654 /*****************************************************************************
655 *
656 *   SeqMgrIndexFeaturesExEx allows indexing of remotely fetched features
657 *
658 *****************************************************************************/
659 
660 NLM_EXTERN Uint2 LIBCALL SeqMgrIndexFeaturesExEx (
661   Uint2 entityID,
662   Pointer ptr,
663   Boolean flip,
664   Boolean dorevfeats,
665   ValNodePtr extra
666 );
667 
668 /*****************************************************************************
669 *
670 *   If indexed with dorevfeats TRUE, SeqMgrExploreFeaturesRev presents features
671 *     in reverse order, used for asn2gb master style on far genomic contigs that
672 *     point to the minus strand of a component
673 *
674 *****************************************************************************/
675 
676 NLM_EXTERN Int4 LIBCALL SeqMgrExploreFeaturesRev (
677   BioseqPtr bsp,
678   Pointer userdata,
679   SeqMgrFeatExploreProc userfunc,
680   SeqLocPtr locationFilter,
681   BoolPtr seqFeatFilter,
682   BoolPtr featDefFilter
683 );
684 
685 /* performs search using both featuresByLabel and genesByLocusTag */
686 NLM_EXTERN SeqFeatPtr FindNthGeneOnBspByLabelOrLocusTag
687 (BioseqPtr              bsp,
688  CharPtr                label,
689  Int4                   n,
690  Int4 PNTR              last_found,
691  SeqMgrFeatContext PNTR context);
692 
693 
694 
695 #ifdef __cplusplus
696 }
697 #endif
698 
699 #undef NLM_EXTERN
700 #ifdef NLM_EXPORT
701 #define NLM_EXTERN NLM_EXPORT
702 #else
703 #define NLM_EXTERN
704 #endif
705 
706 #endif /* _NCBI_Explore_ */
707 
708