1 #ifndef OBJTOOLS_READERS_SEQDB__SEQDBALIAS_HPP
2 #define OBJTOOLS_READERS_SEQDB__SEQDBALIAS_HPP
131 m_NodeNames.resize(4);
145 for(
unsigned i=0;
i<m_Count;
i++) {
146 if (m_NodeNames[
i] == name) {
187 if (m_NodeNames.size() == m_Count) {
188 m_NodeNames.resize(m_NodeNames.size() * 2);
191 m_NodeNames[m_Count++].Assign(name.
GetPathS());
290 if (x_FindBlastDBPath(
dbname.GetPathS(),
295 resolved.
Assign(resolved_str);
322 if (x_FindBlastDBPath(
dbname.GetBasePathS(),
327 resolved.
Assign(resolved_str);
351 bool x_FindBlastDBPath(
const string &
dbname,
378 void x_ReadAliasSetFile(
const CSeqDB_Path & group_fname,
454 const string & name_list,
470 void FindVolumePaths(vector<string> & vols, vector<string> * alias,
bool recursive)
const;
706 void CompleteAliasFileValues(
const CSeqDBVolSet & volset);
720 void ComputeMasks(
bool & has_filters);
728 void GetMaskList(vector <string> & mask_list);
904 void x_Tokenize(
const string & dbnames);
1006 const string & name_list,
1008 bool expand_links =
true);
1021 return m_VolumeNames;
1036 vols = m_VolumeNames;
1038 *alias = m_AliasNames;
1042 m_Node->FindVolumePaths(vols, alias, recursive);
1179 bool NeedTotalsScan(
const CSeqDBVolSet & volset)
const;
1191 return m_HasFilters;
1230 void GetAliasFileValues(TAliasFileValues & afv,
1241 return (m_Node->HasGiMask());
1252 m_Node->GetMaskList(mask_list);
1280 m_Node->ComputeMasks(m_HasFilters);
CSeqDBAliasSets m_AliasSets
Combined alias files.
int m_MembBit
Membership bit.
bool HasGiMask() const
Is the top node alias file associated with Gi based masks?
TSeqDBAliasFileValues TAliasFileValues
Import type to allow shorter name.
bool m_HasTitle
True if we have the database title.
bool m_HasFilters
Are there filters for this database?
vector< string > m_AliasNames
The cached output of the topmost node's FindVolumePaths(recursive).
Int4 m_MinLength
Shortest sequence length.
void x_ComputeMasks()
Compute filtering options for all volumes.
bool m_IsProtein
True if this is a protein database.
void GetMaskList(vector< string > &mask_list)
Get Gi-based Mask Names From Alias Files.
Int8 m_TotalLength
Total length.
Int8 m_NumOIDs
Number of OIDs.
Int8 m_NumSeqs
Number of sequences.
int m_NumSeqsStats
Number of sequences for statistics purposes.
CRef< CSeqDB_FilterTree > m_TopTree
Filter tree representing all alias file filtering.
int m_NeedTotalsScan
1 if we need a totals scan, 0 if not, -1 if not known.
void FindVolumePaths(vector< string > &vols, vector< string > *alias, bool recursive) const
Find the base names of volumes.
CSeqDBAliasFile(const CSeqDBAliasFile &)
Disable copy constructor.
int m_OidMaskType
Oid Mask Type.
bool HasFilters()
Check if any volume filtering exists.
Int8 m_VolumeLength
Total length ignoring filtering.
const vector< string > & GetVolumeNames() const
Get the list of volume names.
string m_Title
Database title.
CRef< CSeqDBAliasNode > m_Node
This is the alias node tree's "artificial" topmost node, which aggregates the user provided database ...
vector< string > m_VolumeNames
The cached output of the topmost node's FindVolumePaths(recursive).
Int8 m_TotalLengthStats
Total length for statistics purposes.
TVolNames m_VolNames
Set of volume names associated with this node.
vector< bool > m_SkipLocal
Should we skip local DB search for this DBLIST?
map< string, string > TVarList
Type of set used for KEY/VALUE pairs within each node.
vector< CRef< CSeqDB_AliasMask > > m_NodeMasks
Mask objects for this node.
vector< CSeqDB_BasePath > TVolNames
Type used to store a set of volume names for each node.
bool m_HasGiMask
Do we have Gi masks for the top node? (only applicable to the top node)
bool HasGiMask() const
Is the top node alias file associated with Gi based masks?
CSeqDBAliasNode(const CSeqDBAliasNode &)
Disable copy constructor.
CSeqDB_DirName m_DBPath
The common prefix for the DB paths.
vector< CSeqDB_BasePath > m_DBList
Tokenized version of DBLIST.
CSeqDBAtlas & m_Atlas
The memory management layer for this SeqDB instance.
TVarList m_Values
List of KEY/VALUE pairs from this alias file.
TSeqDBAliasFileValues TAliasFileValues
Import type to allow shorter name.
TSubNodeList m_SubNodes
List of subnodes contained by this node.
vector< CRef< CSeqDBAliasNode > > TSubNodeList
Type used to store the set of subnodes for this node.
bool m_ExpandLinks
Do not expand link when resolving paths.
void SetMasks(CSeqDBVolSet &volset)
Set filtering options for all volumes.
CSeqDBAliasSets & m_AliasSets
Combined alias files.
CSeqDB_Path m_ThisName
Filename of this alias file.
bool FindBlastDBPath(const CSeqDB_Path &dbname, CSeqDB_Path &resolved)
Find a file given a partial path and name.
bool FindBlastDBPath(const CSeqDB_BasePath &dbname, char dbtype, CSeqDB_BasePath &resolved)
Find a file given a partial path and name.
map< string, string > TAliasGroup
Aggregated alias file - maps filename to file contents.
CSeqDBAliasSets(const CSeqDBAliasSets &)
Disable copy constructor.
CSeqDBAtlas & m_Atlas
Reference to the memory management layer.
map< string, TAliasGroup > TAliasGroupMap
Full index filename to aggregated alias file.
CSeqDBAliasSets(CSeqDBAtlas &atlas)
Constructor.
map< string, string > m_PathLookup
Caches results of FindBlastDBPath.
TAliasGroupMap m_Groups
Alias groups.
bool Exists(const CSeqDB_Path &name)
Check whether the stack contains the specified string.
void Push(const CSeqDB_Path &name)
Push a new string onto to the stack.
vector< CSeqDB_Path > m_NodeNames
List of node names.
CSeqDBAliasStack()
Constructor.
CSeqDBAliasStack(const CSeqDBAliasStack &)
Disable copy constructor.
void Pop()
Remove the top element of the stack.
unsigned Size()
Return the number of in-use elements.
unsigned m_Count
Number of in-use node names.
CSeqDBAliasExplorer class.
virtual bool Explore(const TVarList &values)=0
This will be called with the map of key/value pairs associated with this alias file.
map< string, string > TVarList
Type of set used for KEY/VALUE pairs within each node.
virtual void Accumulate(const CSeqDBVol &volumes)=0
This will be called with each CVolume that is in the alias file tree structure (in order of traversal...
virtual ~CSeqDB_AliasExplorer()
Destructor.
virtual void AddString(const string &)=0
This will be called with the value associated with this key in the alias file.
virtual void Accumulate(const CSeqDBVol &)=0
This will be called with each CVolume that is in the alias file tree structure (in order of traversal...
virtual const char * GetFileKey() const =0
Override to provide the alias file KEY name for the type of summary data you want to gather,...
virtual ~CSeqDB_AliasWalker()
Destructor.
void Assign(const CSeqDB_Substring &sub)
Assign the value from a substring.
Tree of nodes describing filtering of database sequences.
const string & GetPathS() const
Get the path as a string.
void Assign(const string &path)
Assigns the provided value to this path.
static unsigned char depth[2 *(256+1+29)+1]
NCBI_XOBJUTIL_EXPORT string GetTitle(const CBioseq_Handle &hnd, TGetTitleFlags flags=0)
int32_t Int4
4-byte (32-bit) signed integer
int64_t Int8
8-byte (64-bit) signed integer
uint64_t Uint8
8-byte (64-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
char * dbname(DBPROCESS *dbproc)
Get name of current database.
static const char * x_ReadLine(const char *path, char *line, size_t size)
Defines BLAST database access classes.
Defines exception class and several constants for SeqDB.
File access objects for CSeqDB.
This file defines several SeqDB utility functions related to byte order and file system portability.
The SeqDB oid filtering layer.
Defines database volume access classes.
Manages a set of database volumes.