(vector<string> & dblist,
charprot_nucl, vector<string> & vdb_list);
216 void x_AppendSubNode(
const string& node,
charprot_nucl,
boolisVDB);
254 static void s_Tokenize(
const string& dbnames, vector<string> & db_list)
256vector <CSeqDB_Substring>
tmp;
259 for(
unsigned int i=0;
i<
tmp.size();
i++) {
261 tmp[
i].GetString(
t);
263db_list.push_back(
t);
267 static string s_Join(
constvector<string> & list,
unsigned intmax_size)
273join_str.reserve(max_size + 1);
274 for(
unsigned int i=0;
i< list.size();
i++)
279join_str += list[
i];
283join_str.resize(join_str.size() -1);
290: m_ThisName (
"-"),
292m_ExpandLinks(expand_links),
294m_VerifyVDBs(verify_vdbs)
296vector<string> name_list;
297vector<string> vdb_list;
298 if(name_str.empty()) {
317 for(
i= 0;
i< dblist.size();
i++) {
318 _TRACE(
"Input File :"+ dblist[
i]);
325 _TRACE(
"Local db path db :"+ resolved_path);
331 _TRACE(
"Local alias db :"+ resolved_path);
340 _TRACE(
"Blast Alias File :"+ resolved_path);
347 _TRACE(
"Blast db :"+ resolved_path);
350 _TRACE(
"VDBs :"+ resolved_path);
351vdblist.push_back(dblist[
i]);
360 for(
i=0;
i< vdblist.size();
i++) {
363 stringvdb = vdblist[
i];
369 _TRACE(
"VDB Local Alias File :"+ resolved_path);
377 if(local_file.
Exists()) {
381 _TRACE(
"VDB Local File :"+ resolved_path);
390 _TRACE(
"VDB Alias File :"+ resolved_path);
399 file.DereferenceLink();
402 _TRACE(
"VDB File (blast config) :"+ resolved_path);
470 const char* spacep = p;
472 while((spacep < ep) && ((*spacep !=
' ') && (*spacep !=
'\t')))
478 while((spacep < ep) && ((*spacep ==
' ') || (*spacep ==
'\t')))
482 while((spacep < ep) && ((ep[-1] ==
' ') || (ep[-1] ==
'\t')))
487 for(
size_t i= 0;
i<
value.size();
i++) {
488 if(
value[
i] ==
'\t') {
517bp = (
char*) aliasFile.
Map();
522ep = bp + aliasFile.
GetSize();
526 stringname_s, value_s;
530 while((p < ep) && (*p ==
' ')) {
534 const char* eolp = p;
566m_DBPath(m_ThisName.FindDirName()),
567m_ExpandLinks(expand_links),
569m_VerifyVDBs(verify_vdbs)
575vector<string> db_list;
576vector<string> vdb_list;
578 if(vdb_alias && !db_list.empty()) {
584 if(!vdb_list.empty()) {
599vector<string> & node_vdbs = (*node)->GetNodeVDBs();
600vdbs.
insert( node_vdbs.begin(), node_vdbs.end());
601vector<string> & node_db_list = (*node)->GetNodeDBList();
602db_alias.
insert(node_db_list.begin(), node_db_list.end());
603vector<string> & node_vdb_list = (*node)->GetNodeVDBList();
604vdb_alias.
insert(node_vdb_list.begin(), node_vdb_list.end());
615(*node)->GetExpandedPaths( vdbs, db_alias, vdb_alias);
622vector<string> & paths,
623vector<string> * db_alias_list ,
624vector<string> * vdb_alias_list,
629 charprot_nucl = (isProtein) ?
'p':
'n';
638paths.insert(paths.begin(), vdbs.
begin(), vdbs.
end());
642paths.insert(paths.begin(), vdbs.
begin(), vdbs.
end());
643paths.insert(paths.end(), vdb_alias.
begin(), vdb_alias.
end());
644paths.insert(paths.end(), db_alias.
begin(), db_alias.
end());
647 if(db_alias_list !=
NULL) {
648db_alias_list->clear();
649db_alias_list->insert(db_alias_list->begin(),db_alias.
begin(), db_alias.
end());
651 if(vdb_alias_list !=
NULL) {
652vdb_alias_list->clear();
653vdb_alias_list->insert(vdb_alias_list->begin(),vdb_alias.
begin(), vdb_alias.
end());
660vector<string> & vdb_list,
661 string& blastdb_list,
664 charprot_nucl = (isProtein) ?
'p':
'n';
668 CVDBAliasNodenode(input_list, prot_nucl,
true, verify_vdbs);
673vdb_list.insert(vdb_list.begin(), vdbs.
begin(), vdbs.
end());
CSeqDB_Substring GetDirNameSub() const
Get the directory name as a substring.
const string & GetPathS() const
Get the path as a string.
CVDBAliasNode(const string &name_list, char prot_nucl, bool expand_link, bool verify_vdbs)
Public Constructor.
void GetExpandedPaths(set< string > &vdbs, set< string > &db_alias, set< string > &vdb_alias)
map< string, string > TVarList
Type of set used for KEY/VALUE pairs within each node.
void x_ExpandAliases(char prot_nucl)
Expand a node of the alias node tree recursively.
vector< string > m_DBList
Alias Files from DBLIST.
CSeqDB_DirName m_DBPath
The common prefix for the DB paths.
void x_ReadLine(const char *bp, const char *ep, string &name_s, string &value_s)
Read one line of the alias file.
vector< string > & GetNodeVDBs()
vector< string > m_VDBNames
Set of vdb names associated with this node.
vector< CRef< CVDBAliasNode > > TSubNodeList
Type used to store the set of subnodes for this node.
CVDBAliasNode(const CVDBAliasNode &)
Disable copy constructor.
void x_ReadValues(const string &fn)
Read the alias file.
TVarList m_Values
List of KEY/VALUE pairs from this alias file.
vector< string > m_VDBList
Alias file from VDBLIST.
bool m_ExpandLinks
Do not expand link when resolving paths.
CSeqDB_Path m_ThisName
Filename of this alias file.
vector< string > & GetNodeDBList()
vector< string > & GetNodeVDBList()
void x_ResolveDBList(vector< string > &dblist, char prot_nucl, vector< string > &vdb_list)
Check for and resolve path for blast alias file(s)
void x_ResolveVDBList(const vector< string > &vdblist, char prot_nucl)
Resolve path for vdbs and vdb alias file(s)
void x_AppendSubNode(const string &node, char prot_nucl, bool isVDB)
Append a subnode to this alias node.
void GetNodePaths(set< string > &vdbs, set< string > &db_alias, set< string > &vdb_alias)
CVDBAliasNode & operator=(const CVDBAliasNode &)
Disable copy operator.
TSubNodeList m_SubNodes
List of subnodes contained by this node.
static void FindVDBPaths(const string &dbname, bool isProtein, vector< string > &paths, vector< string > *db_alias_list=NULL, vector< string > *vdb_alias_list=NULL, bool recursive=true, bool expand_links=true, bool verify_dbs=true)
Get the list of vdb names.
static void ProcessMixedDBsList(const string &input_list, bool isProtein, vector< string > &vdb_list, string &blastdb_list, bool verify_vdbs)
Process a list with mixed blast dbs and vdbs Expand all alais file to find and return vdbs with full ...
static void CheckVDBs(const vector< string > &vdbs)
Function to check a list of dbs if they can be opened Throw an exception if any of the db cannot be o...
iterator_bool insert(const value_type &val)
const_iterator begin() const
const_iterator end() const
The NCBI C++ standard methods for dealing with std::string.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
size_t GetSize(void) const
Get length of the mapped region.
void * Map(TOffsetType offset=0, size_t length=0)
Map file.
void DereferenceLink(ENormalizePath normalize=eNormalizePath)
Dereference a link.
static char GetPathSeparator(void)
Get path separator symbol specific for the current platform.
const string & GetPath(void) const
Get entry path.
virtual bool Exists(void) const
Check existence of file.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
char * dbname(DBPROCESS *dbproc)
Get name of current database.
const GenericPointer< typename T::ValueType > T2 value
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
Defines exception class and several constants for SeqDB.
string SeqDB_ResolveDbPath(const string &filename)
Resolve a file path using SeqDB's path algorithms.
string SeqDB_ResolveDbPathNoExtension(const string &filename, char dbtype='-')
Resolve a file path using SeqDB's path algorithms.
File access objects for CSeqDB.
void SeqDB_SplitQuoted(const string &dbname, vector< CSeqDB_Substring > &dbs, bool keep_quote=false)
Combine and quote list of database names.
void SeqDB_CombinePath(const CSeqDB_Substring &path, const CSeqDB_Substring &file, const CSeqDB_Substring *extn, string &outp)
Combine a filesystem path and file name.
#define SEQDB_ISEOL(x)
Macro for EOL chars.
void s_SeqDB_QuickAssign(string &dst, const char *bp, const char *ep)
Higher Performance String Assignment.
void SeqDB_ConvertOSPath(string &dbs)
Change path delimiters to platform preferred kind in-place.
static string s_Join(const vector< string > &list, unsigned int max_size)
static void s_Tokenize(const string &dbnames, vector< string > &db_list)
static void s_SeqDB_ReadLine(const char *bp, const char *ep, string &name, string &value)
Parse a name-value pair.
Defines database alias file access classes.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4