A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/blast__databases_8cpp_source.html below:

NCBI C++ ToolKit: src/gui/objutils/blast_databases.cpp Source File

80  static

vector<string>

dummy

;

105  while

(!istr.eof()) {

109  if

(str_line.empty())

111  string

db_name, db_string;

116  if

(db_string.size() > 1 && db_string[0] ==

'n'

&& (db_string[1] ==

't'

|| db_string[1] ==

'r'

)) {

118

mru_dbs.push_back(db_name);

133  if

(notn->

GetJobID

() != m_JobId)

return

;

155

CNetBlastLoadDBListJob(

const string

& dir,

const string

& dbtree);

156

~CNetBlastLoadDBListJob() {}

158  typedef

unordered_map<string, string> TDbMap;

162  virtual

EJobState

Run

();

172  void

x_SaveBlastDataBases(

const string

&

md5

);

202  ERR_POST

(

"CBLASTDatabases::Load() - Failed to start BLAST DBs loading job"

);

212

CNetBlastLoadDBListJob::CNetBlastLoadDBListJob(

const string

& dir,

const string

& dbtree)

213

: m_Dir(dir), m_DBTreePath(dbtree)

232 string

CNetBlastLoadDBListJob::GetDescr()

const 234  return "Load BLAST DB list job"

;

244

ex_md5_req->Add(

string

(

"REQUEST"

),

string

(

"INFO/BLAST-DBS-EX-MD5DIGEST"

) );

245

protocol_info_reply =

client

.AskGet_protocol_info( *ex_md5_req );

248  if

(!md5_param.

Empty

() && md5_param->GetValue().IsString())

249  md5

= md5_param->GetValue().GetString();

254  string

err_msg, logMsg =

"Exception in CNetBlastLoadDBListJob: "

;

264  CFile

md5file(md5path);

265  if

(md5file.Exists()) {

270  LOG_POST

(

Error

<<

"CNetBlastLoadDBListJob. Failed to load blast databases checksum: "

<< e.

GetMsg

());

278  if

(!cached_md5.empty() && cached_md5 ==

md5

) {

281  if

(nuclFile.Exists() && protFile.Exists())

290

x_CategorizeDBs(dbs);

297

x_SaveBlastDataBases(

md5

);

301

err_msg = logMsg + e.

GetMsg

();

302

}

catch

(

const

std::exception& e) {

303

err_msg = logMsg + e.what();

309  if

(!err_msg.empty()) {

318 static void s_SaveDbMap

(

const string

& path,

const

CNetBlastLoadDBListJob::TDbMap& dbmap)

322  ITERATE

(CNetBlastLoadDBListJob::TDbMap, it, dbmap) {

323  string first

= it->first, second = it->second;

330 void

CNetBlastLoadDBListJob::x_SaveBlastDataBases(

const string

&

md5

)

332  if

(

md5

.empty() || m_NucDbMap.empty())

334  LOG_POST

(

Info

<<

"Net BLAST Data Source - saving blast databases..."

);

343  LOG_POST

(

Info

<<

"Net BLAST Data Source - finished saving blast databases"

);

345  LOG_POST

(

Info

<<

"Net BLAST Data Source - failed to save databases - "

<< e.

GetMsg

());

364

fields.push_back(*it);

374  LOG_POST

(

Info

<<

"CNetBlastLoadDBListJob.s_GetDBTree()"

<<

": "

<<

sw

.

Elapsed

() <<

" seconds"

);

381

list<CConstRef<CUser_field> > fields;

390  typedef

unordered_map<string, pair<bool, string> > TValidDbNames;

391

TValidDbNames valid_db_names(db_data.size());

401  const string

& db_name =

info

.GetDatabase().GetName();

407  string label

, db_name, desc;

412  label

=

f

.GetLabel().GetStr();

413

db_name =

f

.GetField(

"Db"

).GetData().GetStr();

416

desc.append(

f

.GetField(

"Descr"

).GetData().GetStr());

418

TValidDbNames::const_iterator dbname_iter = valid_db_names.find(db_name);

420  if

(dbname_iter == valid_db_names.end()) {

426

categorized_dbs.

insert

(db_name);

427

TDbMap& db = dbname_iter->second.first ? m_ProtDbMap : m_NucDbMap;

444 

string::size_type pos = db_desc.find_first_not_of(

"\"'"

);

445  if

(pos != string::npos) {

446

db_desc.erase(0, pos);

448

pos = db_desc.find_last_not_of(

"\"'"

);

449  if

(pos != string::npos) {

451  if

(pos < db_desc.size()) {

467  string

name, visible_name;

468  string

db_desc, tax_label;

469  string

org_name_label =

"organism_label"

;

472  string

visual_priority_label =

"interface_priority"

;

477

m_NucDbMap.reserve(db_data.size());

496  const string

& db_name =

info

.GetDatabase().GetName();

498  if

(!(db_name ==

"nr"

|| db_name ==

"nt"

))

500

db_desc =

info

.GetDescription();

503

visible_name = db_name;

504  if

( ! db_desc.empty() && db_name.find(db_desc) == string::npos) {

505

name +=

" ("

+ db_desc +

")"

;

506  string

db_desc_trimmed(db_desc);

507

visible_name +=

" ("

+ db_desc_trimmed +

")"

;

509

visible_name =

string

(

" "

) + visible_name;

511  if

(db_name ==

"nr"

) {

514

TDbMap& db =

prot

? m_ProtDbMap : m_NucDbMap;

522

x_AddCategorizedDBs(dbs, categorized_dbs);

525  string

db_desc_trimmed;

537  const string

& db_name =

info

->GetDatabase().GetName();

539  if

(db_name ==

"nr"

|| db_name ==

"nt"

)

541  if

(categorized_dbs.

find

(db_name) != categorized_dbs.

end

())

544

db_desc =

info

->GetDescription();

547

visible_name = db_name;

550  if

( ! db_desc.empty() && db_name.find(db_desc) == string::npos) {

552

name.append(db_desc);

554

db_desc_trimmed = db_desc;

555

visible_name.append(

" ("

);

556

visible_name.append(db_desc_trimmed);

557

visible_name.append(

")"

);

562

TDbMap& db = m_NucDbMap;

564  if

(tax_id == 9606 || tax_id == 10090) {

572

vector<string> word_split_vec;

576  if

( (*it)->CanGetExtended() ) {

578

list< CRef< CBlast4_parameter > >::const_iterator pit = ext.

Get

().begin();

579  for

(; pit != ext.

Get

().end(); pit++) {

580

prop_name = (*pit)->GetName();

581  if

(prop_name == org_name_label) {

582  if

( (*pit)->CanGetValue() ){

588  if

(prop_name == visual_priority_label) {

589  if

( (*pit)->CanGetValue() ){

593  if

(vp > 0 && s.empty()) {

605  if

( tax_label.empty() ){

606  ERR_POST

(

Warning

<<

"BLAST database without tax name:"

<< visible_name);

607

tax_label = tax_cache.

GetLabel

(tax_id);

638  if

(tax_label.empty()) {

642  if

(word_split_vec.size() > 2) {

643

s.append(word_split_vec[0]);

645

s.append(word_split_vec[1]);

651

s.append(

"( taxid: "

);

654

s.append(visible_name);

673  ERR_POST

(

Info

<<

"x_CategorizeBD() takes "

<< watch.AsSmartString() );

DEFINE_STATIC_MUTEX(s_Mutex)

void s_GetDBTree(const string &file, list< CConstRef< CUser_field > > &fields)

static const char * kBlastDbDataProt

static void s_SaveDbMap(const string &path, const CNetBlastLoadDBListJob::TDbMap &dbmap)

static void s_GetBlastDbMd5(CBlast4Client &client, string &md5)

static const CCompressStream::EMethod kDbDataCompressMethod

static const char * kBlastDbDataNucl

static const char * kBlastDbDataMD5

static void sPrepareDBDescr(string &db_desc)

User-defined methods of the data storage class.

CAppJobError Default implementation for IAppJobError - encapsulates a text error message.

CAppJobNotification Notification send by CAppJobEventTranslator.

void x_UpdateDbMap(bool nuc)

void x_OnJobNotification(CEvent *evt)

static CBLASTDatabases & GetInstance()

vector< string > m_Prot_DefMRU_DBs

const TDbMap & GetDbMap(bool nuc)

void Load(const char *path, const char *dbtree)

vector< string > m_Nuc_DefMRU_DBs

const vector< string > & GetDefaultMRU_DBs(bool nuc_db)

std::unordered_map< string, string > TDbMap

CBlast4_database_info –.

CBlast4_get_databases_ex_request –.

CBlast4_get_protocol_info_request –.

CEvent - generic event implementation TODO TODO - Attachments.

Base class to build jobs with cancel functionality.

static CTaxonCache & GetInstance()

string GetLabel(int tax_id)

iterator_bool insert(const value_type &val)

const_iterator find(const key_type &key) const

const_iterator end() const

std::ofstream out("events_result.xml")

main entry point for tests

static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)

static void md5(const char *src, const char *out)

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

#define NON_CONST_ITERATE(Type, Var, Cont)

Non constant version of ITERATE macro.

EMethod

Compression/decompression methods.

#define ERR_POST(message)

Error posting with file, line number information but without error codes.

#define LOG_POST(message)

This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...

void Error(CExceptionArgs_Base &args)

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

const string & GetMsg(void) const

Get message string.

void Warning(CExceptionArgs_Base &args)

string ReportAll(TDiagPostFlags flags=eDPF_Exception) const

Report all exceptions.

void Info(CExceptionArgs_Base &args)

static string ConcatPath(const string &first, const string &second)

Concatenate two parts of the path for the current OS.

virtual CConstIRef< IAppJobProgress > GetProgress()=0

return progress object, the function shall be synchronized internally.

static CAppJobDispatcher & GetInstance()

virtual CConstIRef< IAppJobError > GetError()=0

Returns IAppJobError object describing internal error that caused the Job to fail.

virtual CRef< CObject > GetResult()=0

Returns the Job Result.

EJobState

Job states (describe FSM)

TJobID StartJob(IAppJob &job, const string &engine_name, IEngineParams *params=NULL)

Starts a Job on the specified engine in "passive mode" - no notifications or progress reports will be...

virtual string GetDescr() const =0

Returns a human readable description of the Job (optional)

#define ON_EVENT(type, id, handler)

virtual EJobState Run()=0

Function that does all the useful work, called by the Engine.

#define END_EVENT_MAP()

Ends definition of Command Map.

#define BEGIN_EVENT_MAP(thisClass, baseClass)

Begins definition of Command Map for CEventHandler-derived class.

TJobState GetState() const

#define MSerial_AsnText

I/O stream manipulators –.

void Reset(void)

Reset reference object.

bool Empty(void) const THROWS_NONE

Check if CRef is empty – not pointing to any object, which means having a null value.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

CNcbiIstream & NcbiGetlineEOL(CNcbiIstream &is, string &str, string::size_type *count=NULL)

Read from "is" to "str" the next line (taking into account platform specifics of End-of-Line)

IO_PREFIX::ofstream CNcbiOfstream

Portable alias for ofstream.

IO_PREFIX::ifstream CNcbiIfstream

Portable alias for ifstream.

static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)

Split a string using specified delimiters.

static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)

Truncate whitespace in a string (in-place)

static string IntToString(int value, TNumToStringFlags flags=0, int base=10)

Convert int to string.

static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)

Split a string into two pieces using the specified delimiters.

static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)

Replace occurrences of a substring within a string.

@ fSplit_Tokenize

All delimiters are merged and trimmed, to get non-empty tokens only.

@ eTrunc_End

Truncate trailing whitespace only.

void Run(void)

Enter the main loop.

double Elapsed(void) const

Return time elapsed since first Start() or last Restart() call (in seconds).

void Start(void)

Start the timer.

@ eStart

Start timer immediately after creating.

static const char label[]

bool IsInteger(void) const

Check if variant Integer is selected.

TInteger GetInteger(void) const

Get the variant data.

const Tdata & Get(void) const

Get the member data.

const TString & GetString(void) const

Get the variant data.

list< CRef< CBlast4_database_info > > Tdata

bool IsString(void) const

Check if variant String is selected.

@ eBlast4_residue_type_protein

const TData & GetData(void) const

Get the Data member data.

const TFields & GetFields(void) const

Get the variant data.

vector< CRef< CUser_field > > TFields

double value_type

The numeric datatype used by the parser.

Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...

std::istream & in(std::istream &in_, double &x_)

@ eCanceled

Request canceled.

Declares the CRemoteBlast class.

static CNamedPipeClient * client

C++ I/O stream wrappers to compress/decompress data on-the-fly.


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