NCBI C++ ToolKit
blast_seqinfosrc.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef ALGO_BLAST_API__BLAST_SEQINFOSRC__HPP
2 #define ALGO_BLAST_API__BLAST_SEQINFOSRC__HPP
3 
4 /* $Id: blast_seqinfosrc.hpp 78040 2017-05-22 15:48:20Z zaretska $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Author: Ilya Dondoshansky
30  *
31  */
32 
33 /** @file blast_seqinfosrc.hpp
34  * Defines interface for retrieving sequence identifiers.
35  */
36 
37 #include <corelib/ncbiobj.hpp>
40 #include <list>
41 
42 /** @addtogroup AlgoBlast
43  *
44  * @{
45  */
46 
48 
50  class CSeq_id;
51  class CSeq_loc;
53 
54 BEGIN_SCOPE(blast)
55 
56 /// Abstract base class to encapsulate retrieval of sequence identifiers.
57 /// Used for processing of results coming directly from the BLAST
58 /// core engine, e.g. on-the-fly tabular output.
59 class IBlastSeqInfoSrc : public CObject {
60 public:
61  virtual ~IBlastSeqInfoSrc() {}
62 
63  /// Method to retrieve a sequence identifier given its ordinal number.
64  /// @param index the ordinal number to retrieve [in]
65  virtual list< CRef<objects::CSeq_id> > GetId(Uint4 index) const = 0;
66 
67  /// Method to retrieve the sequence location given its ordinal number.
68  /// @param index the ordinal number to retrieve [in]
69  virtual CConstRef<objects::CSeq_loc> GetSeqLoc(Uint4 index) const = 0;
70 
71  /// Method to retrieve a sequence length given its ordinal number.
72  /// @param index the ordinal number to retrieve [in]
73  virtual Uint4 GetLength(Uint4 index) const = 0;
74 
75  /// Returns the size of the underlying container of sequences
76  virtual size_t Size() const = 0;
77 
78  /// Returns true if the subject is restricted by a GI list.
79  virtual bool HasGiList() const = 0;
80 
81  /// Retrieves the subject masks for the corresponding index
82  /// @param index the ordinal number to retrieve [in]
83  /// @param target_range range for which to return masks for. Empty ranges
84  /// indicate that no masks should be retrieved, whole ranges mean that
85  /// masks for the whole sequence should be retrieved [in]
86  /// @param retval the masks will be returned through this parameter [out]
87  /// @return true if there were masks returned in retval, otherwise false.
88  virtual bool GetMasks(Uint4 index,
89  const TSeqRange& target_range,
90  TMaskedSubjRegions& retval) const = 0;
91 
92  /// Retrieves the subject masks for the corresponding index
93  /// @param index the ordinal number to retrieve [in]
94  /// @param target_ranges ranges for which to return masks for. Empty ranges
95  /// indicate that no masks should be retrieved, whole ranges mean that
96  /// masks for the whole sequence should be retrieved [in]
97  /// @param retval the masks will be returned through this parameter [out]
98  /// @return true if there were masks returned in retval, otherwise false.
99  virtual bool GetMasks(Uint4 index,
100  const vector<TSeqRange>& target_ranges,
101  TMaskedSubjRegions& retval) const = 0;
102 
103  /// Return true if the implementation can return anything besides a seq-loc
104  /// for the entire sequence. If in doubt, the implementation must
105  /// return true.
106  virtual bool CanReturnPartialSequence() const = 0;
107 
108 };
109 
110 END_SCOPE(blast)
112 
113 /* @} */
114 
115 #endif /* ALGO_BLAST_API__BLAST_SEQINFOSRC_HPP */
Contains C++ wrapper classes to structures in algo/blast/core as well as some auxiliary functions to ...
Defines to provide correct exporting from BLAST DLL in Windows.
CObject –.
Definition: ncbiobj.hpp:180
Abstract base class to encapsulate retrieval of sequence identifiers.
Collection of masked regions for a single query sequence.
Definition: seqlocinfo.hpp:113
virtual list< CRef< objects::CSeq_id > > GetId(Uint4 index) const =0
Method to retrieve a sequence identifier given its ordinal number.
virtual CConstRef< objects::CSeq_loc > GetSeqLoc(Uint4 index) const =0
Method to retrieve the sequence location given its ordinal number.
virtual Uint4 GetLength(Uint4 index) const =0
Method to retrieve a sequence length given its ordinal number.
virtual bool GetMasks(Uint4 index, const vector< TSeqRange > &target_ranges, TMaskedSubjRegions &retval) const =0
Retrieves the subject masks for the corresponding index.
virtual size_t Size() const =0
Returns the size of the underlying container of sequences.
virtual bool CanReturnPartialSequence() const =0
Return true if the implementation can return anything besides a seq-loc for the entire sequence.
virtual ~IBlastSeqInfoSrc()
virtual bool HasGiList() const =0
Returns true if the subject is restricted by a GI list.
virtual bool GetMasks(Uint4 index, const TSeqRange &target_range, TMaskedSubjRegions &retval) const =0
Retrieves the subject masks for the corresponding index.
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Modified on Sun Mar 03 03:12:39 2024 by modify_doxy.py rev. 669887