= tool_name +
" - submitting sequences to NCBI Net BLAST";
88 static const char* kLogMsg =
"CNetBlastSubmittingJob::Run() - exception in x_Run() ";
89 static stringkErrorMsg =
"Unhandled exception in CNetBlastSubmittingJob::Run()";
90 static const char* kBlastError =
"BLAST returned error(s) in CNetBlastSubmittingJob::Run() :";
103}
catch(std::exception& ee) {
104err_msg = kLogMsg +
GetDescr() +
". "+ ee.what();
109 if( !err_msg.empty() ){
110 strings = kErrorMsg + err_msg;
115 strings = kBlastError;
133 static const char* kFailedToSubmit =
"Failed to submit BLAST search for ";
161descr->MarkDeleted(
false);
163descr->Submit(*bset);
164 stringrid = descr->GetRID();
170 stringerr =
"Failed to create a bioseq for item "+
str;
171err +=
" The item has not been submitted.";
179 catch(std::exception& e) {
180 stringerr =
string(kFailedToSubmit) +
str+
". "+ e.
what();
265 const string& tool_name,
268m_WaitPeriodIndex(0),
269m_Descriptors(descriptors)
287 static const char* kLogMsg =
"CNetBlastMonitoringJob::Run() - exception in x_Run() ";
288 static stringkErrorMsg =
"Unhandled exception in CNetBlastMonitoringJob::Run()";
289 static const char* kBlastError =
"BLAST returned error(s) in CNetBlastMonitoringJob::Run() :";
304}
catch(std::exception& ee) {
305err_msg = kLogMsg +
GetDescr() +
". "+ ee.what();
311 if( !err_msg.empty() ){
312 strings = kErrorMsg + err_msg;
317 strings = kBlastError;
339vector<string> retrieve_ids;
353 switch(descr->GetState()) {
355retrieve_ids.push_back(descr->GetRID());
361 m_Errors.push_back(descr->GetErrors());
370 strings =
"RID "+ descr->GetRID() +
" is invalid or expired";
386 if( ! retrieve_ids.empty() && !
IsCanceled() ){
414task->Init_RetrieveRID(RIDs);
471 static longperiods[] = { 1, 1, 1, 2, 3, 4, 6, 10, 20, 30, 60 };
472 static const intmax_index =
sizeof(periods) /
sizeof(
long) - 1;
483 constvector<string>* RIDs,
492 m_Descr=
"NCBI Net BLAST - retrieving results";
498 for(
size_t i= 0;
i< RIDs.size();
i++) {
499 const string& rid = RIDs[
i];
502descr->MarkDeleted(
false);
529 stringrid = descr.
GetRID();
545 strings =
"BLAST Search for RID "+ rid +
" produced no results";
551 strings =
"RID "+ rid +
" is still pending";
562 strings =
"RID "+ descr.
GetRID() +
" is invalid or expired";
580scope.
Reset(
newobjects::CScope(*obj_mgr));
581scope->AddDefaults();
static CRef< CScope > m_Scope
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CAppJobError Default implementation for IAppJobError - encapsulates a text error message.
CAppJobProgress Default implementation for IAppJobProgress - the class encapsulates a text message an...
CAppTaskService - Application Task Service.
CBLASTParams - save user-specified parameters and preferences.
CProjectSelectOptions - describes how new Project Items shall be added to a workspace.
IServiceLocator - an abstract mechanism for locating services.
static const char * str(char *buf, int n)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#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)
const string & GetMsg(void) const
Get message string.
string ReportAll(TDiagPostFlags flags=eDPF_Exception) const
Report all exceptions.
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
void Info(CExceptionArgs_Base &args)
CIRef< T > GetServiceByType()
retrieves a typed reference to a service, the name of C++ type is used as the name of the service.
void AddTask(IAppTask &task)
Add a task to the queue.
void GetErrors(vector< string > &errors) const
EJobState x_Run()
this functions performs real work every call to this function does pools each job once,...
void DeleteJobDescriptors(TJobDescrVec &descriptors)
virtual CRef< CObject > GetResult()
Returns the Job Result.
CRef< CNetBLASTUIDataSource > m_NetBlastDS
virtual CTimeSpan GetWaitPeriod()
returns a period of time after which the task shall be executed again
vector< CRef< CNetBlastJobDescriptor > > TDescriptors
void x_StartRetrivingTask(const vector< string > &RIDs)
virtual string GetDescr() const
Returns a human readable description of the Job (optional)
TConstScopedObjects & GetSeqLocs()
CRef< CNetBlastJobDescriptor > FindJobDescriptor(const string &rid)
virtual EJobState Run()
Function that does all the useful work, called by the Engine.
void x_SetStatusText(const string &text)
vector< CRef< CNetBlastJobDescriptor > > TDescriptors
vector< string > m_Errors
TConstScopedObjects m_SeqLocs
virtual CRef< CObject > GetResult()
Returns the Job Result.
CRef< blast::CRemoteBlast > GetRemoteBlast()
CNetBlastLoadingJob(CNetBLASTUIDataSource &ds, const vector< string > *RIDs=NULL, CScope *scope=NULL)
CNetBlastLoadingJob.
virtual CConstIRef< IAppJobError > GetError()
Returns IAppJobError object describing internal error that caused the Job to fail.
virtual void x_CreateProjectItems()
iterates on the given RIDs and creates Project Items or accumulates error
CNetBlastMonitoringJob(CNetBLASTUIDataSource &ds, IServiceLocator *srv_locator, const string &tool_name, TDescriptors &descriptors)
CNetBlastSubmittingJob.
CNetBlastSubmittingJob(string tool_name, const CBLASTParams ¶ms, CNetBLASTUIDataSource &ds)
CNetBlastSubmittingJob.
virtual CConstIRef< IAppJobError > GetError()
Returns IAppJobError object describing internal error that caused the Job to fail.
CRef< objects::CSeq_align_set > Retrieve()
virtual void SetLoadingOptions(CSelectProjectOptions &options)
void x_Run()
this fucntions performs real work
virtual CConstIRef< IAppJobProgress > GetProgress()
return progress object, the function shall be synchronized internally.
string m_Descr
mutex to sync our internals
vector< CRef< CNetBlastJobDescriptor > > m_Descriptors
CSelectProjectOptions m_LoadingOptions
void GetDescriptors(TDescriptors &descriptors)
vector< string > m_Errors
string m_ToolName
mutex to sync our internals
void x_CreateProjectItemsFromBlastResult(objects::CSeq_align_set &results, CRef< blast::CRemoteBlast > RemoteBlast)
TDescriptors m_Descriptors
virtual string GetDescr() const
Returns a human readable description of the Job (optional)
void SetRIDs(CNetBLASTUIDataSource &ds, const vector< string > &RIDs)
CRef< CAppJobError > m_Error
TDescriptors m_Descriptors
CRef< CNetBlastJobDescriptor > CreateJobDescriptor(const CBLASTParams ¶ms)
void GetErrors(vector< string > &errors) const
virtual CConstIRef< IAppJobProgress > GetProgress()
return progress object, the function shall be synchronized internally.
vector< string > m_Errors
CRef< CAppJobError > m_Error
IServiceLocator * m_SrvLocator
void x_SetStatusText(const string &text)
virtual EJobState Run()
Function that does all the useful work, called by the Engine.
void x_AddError(const string &error)
static void GetLabel(const CObject &obj, string *label, ELabelType type=eDefault)
string m_Descr
mutex to sync our internals
virtual bool IsCanceled() const override
EJobState
Job states (describe FSM)
static void AddProjectItemsFromRID(CRef< objects::CScope > scope, CSeq_align_set &results, bool isFindComp, CRef< blast::CRemoteBlast > RemoteBlast, const set< string > &filter, CDataLoadingAppJob &job, SRIDStatInfo &RIDStatInfo)
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
TSeq & SetSeq(void)
Select the variant.
TSeq_set & SetSeq_set(void)
Assign a value to Seq_set data member.
CRef< objects::CBioseq > SeqLocToBioseq(const objects::CSeq_loc &loc, objects::CScope &scope)
static void text(MDB_val *v)
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
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