NCBI C++ ToolKit
Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
CSplignApp Class Reference

Search Toolkit Book for CSplignApp

#include "splign_app.hpp"
(Private to src/app/splign.)

+ Inheritance diagram for CSplignApp:
+ Collaboration diagram for CSplignApp:

Public Member Functions

 CSplignApp (void)
 
virtual void Init ()
 Initialize the application. More...
 
virtual int Run ()
 Run the application. More...
 
- Public Member Functions inherited from CNcbiApplication
 CNcbiApplication (const SBuildInfo &build_info=SBuildInfo())
 Constructor. More...
 
virtual ~CNcbiApplication (void)
 Destructor. More...
 
int AppMain (int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)
 Main function (entry point) for the NCBI application. More...
 
virtual int DryRun (void)
 Test run the application. More...
 
virtual void Exit (void)
 Cleanup on application exit. More...
 
const CNcbiArgumentsGetArguments (void) const
 Get the application's cached unprocessed command-line arguments. More...
 
virtual const CArgsGetArgs (void) const
 Get parsed command line arguments. More...
 
const CNcbiEnvironmentGetEnvironment (void) const
 Get the application's cached environment. More...
 
CNcbiEnvironmentSetEnvironment (void)
 Get a non-const copy of the application's cached environment. More...
 
void SetEnvironment (const string &name, const string &value)
 Set a specified environment variable by name. More...
 
bool HasLoadedConfig (void) const
 Check if the config file has been loaded. More...
 
bool FinishedLoadingConfig (void) const
 Check if the application has finished loading config file (successfully or not). More...
 
const CNcbiRegistryGetConfig (void) const
 Get the application's cached configuration parameters (read-only). More...
 
CNcbiRegistryGetConfig (void)
 
const stringGetConfigPath (void) const
 Get the full path to the configuration file (if any) we ended up using. More...
 
bool ReloadConfig (CMetaRegistry::TFlags flags=CMetaRegistry::fReloadIfChanged, IRegistry::TFlags reg_flags=IRegistry::fWithNcbirc)
 Reload the configuration file. More...
 
SIZE_TYPE FlushDiag (CNcbiOstream *os, bool close_diag=false)
 Flush the in-memory diagnostic stream (for "eDS_ToMemory" case only). More...
 
const stringGetProgramDisplayName (void) const
 Get the application's "display" name. More...
 
const stringGetProgramExecutablePath (EFollowLinks follow_links=eIgnoreLinks) const
 Get the application's executable path. More...
 
CVersionInfo GetVersion (void) const
 Get the program version information. More...
 
const CVersionGetFullVersion (void) const
 Get the program version information. More...
 
bool IsDryRun (void) const
 Check if it is a test run. More...
 
virtual bool SetupDiag_AppSpecific (void)
 Setup application specific diagnostic stream. More...
 
template<class TFunc >
void AddOnExitAction (TFunc func)
 Add callback to be executed from CNcbiApplication destructor. More...
 

Protected Types

typedef CSplign::THit THit
 
typedef CSplign::THitRef THitRef
 
typedef CSplign::THitRefs THitRefs
 
typedef map< int, CRef< CSeq_id > > TOidToSeqId
 
- Protected Types inherited from CNcbiApplication
enum  EPreparseArgs { ePreparse_Continue, ePreparse_Exit }
 Result of PreparseArgs() More...
 
enum  EDisableArgDesc { fDisableStdArgs = 0x01 }
 Disable argument descriptions. More...
 
enum  EHideStdArgs {
  fHideLogfile = 0x01, fHideConffile = 0x02, fHideVersion = 0x04, fHideFullVersion = 0x08,
  fHideDryRun = 0x10, fHideHelp = 0x20, fHideFullHelp = 0x40, fHideXmlHelp = 0x80,
  fHideAll = 0xFF
}
 Which standard flag's descriptions should not be displayed in the usage message. More...
 
enum  EStdioSetup { fDefault_SyncWithStdio = 0x01, fDefault_CinBufferSize = 0x02, fBinaryCin = 0x04, fBinaryCout = 0x08 }
 Flags to adjust standard I/O streams' behaviour. More...
 
enum  EExitMode { eNoExits, eExceptionalExits, eAllExits }
 When to return a user-set exit code. More...
 
typedef int TDisableArgDesc
 Binary OR of "EDisableArgDesc". More...
 
typedef int THideStdArgs
 Binary OR of "EHideStdArgs". More...
 
typedef int TStdioSetupFlags
 Binary OR of "EStdioSetup". More...
 

Protected Member Functions

void x_RunSplign (bool raw_hits, THitRefs *phitrefs, THit::TCoord smin, THit::TCoord smax, CSplign::TResults *psplign_results)
 
void x_ProcessPair (THitRefs &hitrefs, const CArgs &args, THit::TCoord smin=0, THit::TCoord smax=0)
 
CRef< blast::CBlastOptionsHandle > x_SetupBlastOptions (bool cross)
 
void x_GetBl2SeqHits (CRef< objects::CSeq_id > seqid_query, CRef< objects::CSeq_id > seqid_subj, CRef< objects::CScope > scope, THitRefs *phitrefs)
 
void x_LogCompartmentStatus (const THit::TId &query, const THit::TId &subj, const CSplign::SAlignedCompartment &ac)
 
bool x_GetNextPair (istream &ifs, THitRefs *hitrefs)
 
bool x_GetNextPair (const THitRefs &hitrefs, THitRefs *hitrefs_pair)
 
bool x_GetNextComp (istream &ifs, THitRefs *hitrefs, THit::TCoord *psubj_min, THit::TCoord *psubj_max)
 
CRef< objects::CSeq_id > x_ReadFastaSetId (const CArgValue &argval, CRef< objects::CScope >)
 
- Protected Member Functions inherited from CNcbiApplication
virtual EPreparseArgs PreparseArgs (int argc, const char *const *argv)
 Check the command line arguments before parsing them. More...
 
void DisableArgDescriptions (TDisableArgDesc disable=fDisableStdArgs)
 
void HideStdArgs (THideStdArgs hide_mask)
 Set the hide mask for the Hide Std Flags. More...
 
void SetStdioFlags (TStdioSetupFlags stdio_flags)
 Adjust the behavior of standard I/O streams. More...
 
void SetVersion (const CVersionInfo &version)
 Set the version number for the program. More...
 
void SetVersion (const CVersionInfo &version, const SBuildInfo &build_info)
 
void SetVersionByBuild (int major)
 
void SetFullVersion (CRef< CVersion > version)
 Set version data for the program. More...
 
virtual void SetupArgDescriptions (CArgDescriptions *arg_desc)
 Setup the command line argument descriptions. More...
 
const CArgDescriptionsGetArgDescriptions (void) const
 Get argument descriptions (set by SetupArgDescriptions) More...
 
bool SetupDiag (EAppDiagStream diag)
 Setup the application diagnostic stream. More...
 
virtual bool LoadConfig (CNcbiRegistry &reg, const string *conf, CNcbiRegistry::TFlags reg_flags)
 Load settings from the configuration file to the registry. More...
 
virtual bool LoadConfig (CNcbiRegistry &reg, const string *conf)
 Load settings from the configuration file to the registry. More...
 
CNcbiRegistryGetRWConfig (void)
 Get the application's cached configuration parameters, accessible to read-write for an application only. More...
 
void SetProgramDisplayName (const string &app_name)
 Set program's display name. More...
 
virtual void AppStart (void)
 Method to be called before application start. More...
 
virtual void AppStop (int exit_code)
 Method to be called before application exit. More...
 
void SetExitCode (int exit_code, EExitMode when=eExceptionalExits)
 Force the program to return a specific exit code later, either when it exits due to an exception or unconditionally. More...
 

Static Protected Member Functions

static THitRef s_ReadBlastHit (const string &m8)
 
- Static Protected Member Functions inherited from CNcbiApplication
static string FindProgramExecutablePath (int argc, const char *const *argv, string *real_path=0)
 Find the application's executable file. More...
 

Protected Attributes

blast::EProgram m_BlastProgram
 
CRef< blast::CBlastOptionsHandle > m_BlastOptionsHandle
 
CRef< CSplignm_Splign
 
CRef< CSplignFormatterm_Formatter
 
CNcbiOstreamm_AsnOut
 
CNcbiOstreamm_AlnOut
 
CNcbiOstreamm_logstream
 
TOidToSeqId m_Oid2SeqId
 
string m_AppName
 
string m_firstline
 
THitRefs m_PendingHits
 
size_t m_CurHitRef
 
CRef< objects::CObjectManager > m_ObjMgr
 

Additional Inherited Members

- Public Types inherited from CNcbiApplication
enum  EAppNameType { eBaseName, eFullName, eRealName }
 
- Static Public Member Functions inherited from CNcbiApplication
static CNcbiApplicationInstance (void)
 Singleton method. More...
 
static SSystemMutex & GetInstanceMutex (void)
 Mutex for application singleton object. More...
 
static string GetAppName (EAppNameType name_type=eBaseName, int argc=0, const char *const *argv=NULL)
 

Detailed Description

Definition at line 58 of file splign_app.hpp.

Member Typedef Documentation

typedef CSplign::THit CSplignApp::THit
protected

Definition at line 69 of file splign_app.hpp.

Definition at line 70 of file splign_app.hpp.

Definition at line 71 of file splign_app.hpp.

typedef map<int, CRef<CSeq_id> > CSplignApp::TOidToSeqId
protected

Definition at line 115 of file splign_app.hpp.

Constructor & Destructor Documentation

CSplignApp::CSplignApp ( void  )

Member Function Documentation

void CSplignApp::Init ( void  )
virtual
int CSplignApp::Run ( )
virtual
CSplign::THitRef CSplignApp::s_ReadBlastHit ( const string m8)
staticprotected

Definition at line 211 of file splign_app.cpp.

References CSeq_id_Base::e_Local, NCBI_THROW, and string.

Referenced by x_GetNextPair().

void CSplignApp::x_GetBl2SeqHits ( CRef< objects::CSeq_id >  seqid_query,
CRef< objects::CSeq_id >  seqid_subj,
CRef< objects::CScope >  scope,
THitRefs phitrefs 
)
protected
bool CSplignApp::x_GetNextComp ( istream &  ifs,
THitRefs hitrefs,
THit::TCoord psubj_min,
THit::TCoord psubj_max 
)
protected

Definition at line 374 of file splign_app.cpp.

References copy(), eDiag_Fatal, ePattern, kUndef, max(), min(), NCBI_THROW2, and ReadCompartment().

Referenced by Run().

bool CSplignApp::x_GetNextPair ( istream &  ifs,
THitRefs hitrefs 
)
protected

Definition at line 276 of file splign_app.cpp.

References buf, copy(), CT_POS_TYPE, i, CConstRef< C, Locker >::IsNull(), m_firstline, m_PendingHits, query, and s_ReadBlastHit().

Referenced by Run().

bool CSplignApp::x_GetNextPair ( const THitRefs hitrefs,
THitRefs hitrefs_pair 
)
protected

Definition at line 244 of file splign_app.cpp.

References m_CurHitRef, max(), query, and USING_SCOPE.

void CSplignApp::x_LogCompartmentStatus ( const THit::TId query,
const THit::TId subj,
const CSplign::SAlignedCompartment ac 
)
protected
void CSplignApp::x_ProcessPair ( THitRefs hitrefs,
const CArgs args,
THit::TCoord  smin = 0,
THit::TCoord  smax = 0 
)
protected
CRef< objects::CSeq_id > CSplignApp::x_ReadFastaSetId ( const CArgValue argval,
CRef< objects::CScope >  scope 
)
protected
void CSplignApp::x_RunSplign ( bool  raw_hits,
THitRefs phitrefs,
THit::TCoord  smin,
THit::TCoord  smax,
CSplign::TResults psplign_results 
)
protected
CRef< blast::CBlastOptionsHandle > CSplignApp::x_SetupBlastOptions ( bool  cross)
protected

Member Data Documentation

CNcbiOstream* CSplignApp::m_AlnOut
protected

Definition at line 97 of file splign_app.hpp.

Referenced by Run(), and x_ProcessPair().

string CSplignApp::m_AppName
protected

Definition at line 118 of file splign_app.hpp.

Referenced by CSplignApp(), and Init().

CNcbiOstream* CSplignApp::m_AsnOut
protected

Definition at line 96 of file splign_app.hpp.

Referenced by Run(), and x_ProcessPair().

CRef<blast::CBlastOptionsHandle> CSplignApp::m_BlastOptionsHandle
protected

Definition at line 83 of file splign_app.hpp.

Referenced by Run(), and x_GetBl2SeqHits().

blast::EProgram CSplignApp::m_BlastProgram
protected

Definition at line 82 of file splign_app.hpp.

Referenced by x_GetBl2SeqHits(), and x_SetupBlastOptions().

size_t CSplignApp::m_CurHitRef
protected

Definition at line 123 of file splign_app.hpp.

Referenced by x_GetNextPair().

string CSplignApp::m_firstline
protected

Definition at line 120 of file splign_app.hpp.

Referenced by x_GetNextPair().

CRef<CSplignFormatter> CSplignApp::m_Formatter
protected

Definition at line 85 of file splign_app.hpp.

Referenced by Run(), and x_ProcessPair().

CNcbiOstream* CSplignApp::m_logstream
protected

Definition at line 99 of file splign_app.hpp.

Referenced by Run(), and x_LogCompartmentStatus().

CRef<objects::CObjectManager> CSplignApp::m_ObjMgr
protected

Definition at line 125 of file splign_app.hpp.

Referenced by Init(), and Run().

TOidToSeqId CSplignApp::m_Oid2SeqId
protected

Definition at line 116 of file splign_app.hpp.

THitRefs CSplignApp::m_PendingHits
protected

Definition at line 121 of file splign_app.hpp.

Referenced by x_GetNextPair().

CRef<CSplign> CSplignApp::m_Splign
protected

Definition at line 84 of file splign_app.hpp.

Referenced by Run(), x_ProcessPair(), and x_RunSplign().


The documentation for this class was generated from the following files:
Modified on Wed Aug 16 05:48:02 2017 by modify_doxy.py rev. 533848