NCBI C++ ToolKit
seqdbexpert.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: seqdbexpert.cpp 78040 2017-05-22 15:48:20Z zaretska $
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  * Author: Kevin Bealer
27  *
28  */
29 
30 /// @file seqdbexpert.cpp
31 /// Implementation for the CSeqDBExpert class.
32 #include <ncbi_pch.hpp>
34 #include "seqdbimpl.hpp"
35 
37 
39  ESeqType seqtype,
40  CSeqDBGiList * gi_list)
41  : CSeqDB(dbname, seqtype, gi_list)
42 {
43 }
44 
46  ESeqType seqtype,
47  int oid_begin,
48  int oid_end,
49  bool use_mmap,
50  CSeqDBGiList * gi_list)
51  : CSeqDB(dbname, seqtype, oid_begin, oid_end, use_mmap, gi_list)
52 {
53 }
54 
56  : CSeqDB()
57 {
58 }
59 
61 {
62 }
63 
65  const char ** buf,
66  int * seq_length,
67  int * ambig_length) const
68 {
69 
70  m_Impl->GetRawSeqAndAmbig(oid, buf, seq_length, ambig_length);
71 
72 }
73 
75  TGi * high_id,
76  int * count)
77 {
78 
79  m_Impl->GetGiBounds(low_id, high_id, count);
80 
81 }
82 
83 void CSeqDBExpert::GetPigBounds(int * low_id,
84  int * high_id,
85  int * count)
86 {
87 
88  m_Impl->GetPigBounds(low_id, high_id, count);
89 
90 }
91 
92 void CSeqDBExpert::GetStringBounds(string * low_id,
93  string * high_id,
94  int * count)
95 {
96 
97  m_Impl->GetStringBounds(low_id, high_id, count);
98 
99 }
100 
102 {
103 
104 }
105 
107 {
108 
109  unsigned h = m_Impl->GetSequenceHash(oid);
110 
111 
112  return h;
113 }
114 
115 void CSeqDBExpert::HashToOids(unsigned hash, vector<int> & oids)
116 {
117 
118  m_Impl->HashToOids(hash, oids);
119 
120 }
121 
123 
void GetRawSeqAndAmbig(int oid, const char **buffer, int *seq_length, int *ambig_length) const
Raw Sequence and Ambiguity Data.
Definition: seqdbexpert.cpp:64
CSeqDBExpert()
Null Constructor.
Definition: seqdbexpert.cpp:55
void GetPigBounds(int *low_id, int *high_id, int *count)
Get PIG Bounds.
Definition: seqdbexpert.cpp:83
void Verify()
Verify internal SeqDB data structures for consistency.
unsigned GetSequenceHash(int oid)
Get the sequence hash for a given OID.
void HashToOids(unsigned hash, vector< int > &oids)
Get the OIDs for a given sequence hash.
void GetGiBounds(TGi *low_id, TGi *high_id, int *count)
Get GI Bounds.
Definition: seqdbexpert.cpp:74
void GetStringBounds(string *low_id, string *high_id, int *count)
Get String Bounds.
Definition: seqdbexpert.cpp:92
~CSeqDBExpert()
Destructor.
Definition: seqdbexpert.cpp:60
CSeqDBGiList.
void GetRawSeqAndAmbig(int oid, const char **buffer, int *seq_length, int *ambig_length) const
Raw Sequence and Ambiguity Data.
Definition: seqdbimpl.cpp:1672
void GetStringBounds(string *low_id, string *high_id, int *count)
Get String Bounds.
Definition: seqdbimpl.cpp:1806
unsigned GetSequenceHash(int oid)
Get the sequence hash for a given OID.
Definition: seqdbimpl.cpp:1865
void GetPigBounds(int *low_id, int *high_id, int *count)
Get PIG Bounds.
Definition: seqdbimpl.cpp:1775
void GetGiBounds(TGi *low_id, TGi *high_id, int *count)
Get GI Bounds.
Definition: seqdbimpl.cpp:1743
void HashToOids(unsigned hash, vector< int > &oids)
Get the OIDs for a given sequence hash.
Definition: seqdbimpl.cpp:1881
CSeqDB.
Definition: seqdb.hpp:161
ESeqType
Sequence types (eUnknown tries protein, then nucleotide).
Definition: seqdb.hpp:173
class CSeqDBImpl * m_Impl
Implementation details are hidden. (See seqdbimpl.hpp).
Definition: seqdb.hpp:1529
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Definition: dblib.c:6929
char * buf
Defines `expert' version of CSeqDB interfaces.
The top level of the private implementation layer for SeqDB.
Definition: _hash_fun.h:40
Modified on Wed Jun 19 17:03:23 2024 by modify_doxy.py rev. 669887