NCBI C++ ToolKit
Public Types | Public Member Functions | Private Attributes | List of all members
COMSSABase Class Referenceabstract

Search Toolkit Book for COMSSABase

#include "omssaapp.hpp"
(Private to src/algo/ms/omssa.)

+ Inheritance diagram for COMSSABase:
+ Collaboration diagram for COMSSABase:

Public Types

typedef vector< CRef< CSearch > > TSearchThreads
 
- Public Types inherited from CNcbiApplication
enum  EAppNameType { eBaseName, eFullName, eRealName }
 

Public Member Functions

 COMSSABase ()
 
void SetOutFile (bool IncludeSpectra, EMSSerialDataFormat FileFormat, std::string FileName, CRef< CMSSearchSettings > &Settings)
 Set the out files. More...
 
virtual int Run ()=0
 Run the application. More...
 
virtual void Init ()
 Initialize the application. More...
 
virtual void AppInit (CArgDescriptions *argDesc)
 application specific initialization More...
 
void PrintMods (CRef< CMSModSpecSet > Modset)
 print out a list of modification that can be used in OMSSA More...
 
void PrintEnzymes (void)
 print out a list of enzymes that can be used in OMSSA More...
 
void PrintIons (void)
 print out a list of ions that can be used in OMSSA More...
 
void SetSearchSettings (const CArgs &args, CRef< CMSSearchSettings > Settings)
 Set search settings given args. More...
 
const TSearchThreadsGetsearchThreads (void) const
 get a list of the search engine threads More...
 
TSearchThreadsSetsearchThreads (void)
 return a settable list of search engine threads More...
 
const int GetnThreads (void) const
 return number of threads More...
 
intSetnThreads (void)
 return settable number of threads More...
 
void SetThreadCount (int NumThreads)
 set up number of threads More...
 
void RunSearch (CRef< CSearch > SearchEngine)
 run multithreaded search 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...
 

Private Attributes

TSearchThreads searchThreads
 search threads More...
 
int nThreads
 number of search threads More...
 

Additional Inherited Members

- 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)
 
- 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 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 inherited from CNcbiApplication
static string FindProgramExecutablePath (int argc, const char *const *argv, string *real_path=0)
 Find the application's executable file. More...
 

Detailed Description

Definition at line 68 of file omssaapp.hpp.

Member Typedef Documentation

Definition at line 107 of file omssaapp.hpp.

Constructor & Destructor Documentation

COMSSABase::COMSSABase ( )

Definition at line 60 of file omssaapp.cpp.

References CNcbiApplication::SetVersion().

Member Function Documentation

void COMSSABase::AppInit ( CArgDescriptions argDesc)
virtual

application specific initialization

Parameters
argDescargument descriptions

Reimplemented in COMSSA.

Definition at line 349 of file omssaapp.cpp.

Referenced by Init().

const int COMSSABase::GetnThreads ( void  ) const
inline

return number of threads

Definition at line 174 of file omssaapp.hpp.

References nThreads.

Referenced by RunSearch(), and SetThreadCount().

const COMSSABase::TSearchThreads & COMSSABase::GetsearchThreads ( void  ) const
inline

get a list of the search engine threads

Definition at line 160 of file omssaapp.hpp.

References searchThreads.

void COMSSABase::Init ( void  )
virtual

Initialize the application.

The default behavior of this is "do nothing". If you have special initialization logic that needs to be peformed, then you must override this method with your own logic.

Reimplemented from CNcbiApplication.

Definition at line 110 of file omssaapp.cpp.

References AppInit(), eDiag_Info, CArgDescriptions::eDouble, CArgDescriptions::eInteger, eMSCalcPlusOne_calc, eMSEnzymes_trypsin, CArgDescriptions::eString, NStr::IntToString(), SetDiagPostLevel(), and CNcbiApplication::SetupArgDescriptions().

void COMSSABase::PrintEnzymes ( void  )

print out a list of enzymes that can be used in OMSSA

Definition at line 89 of file omssaapp.cpp.

References eMSEnzymes_max, i, and kEnzymeNames.

Referenced by COMSSA::Run().

void COMSSABase::PrintIons ( void  )

print out a list of ions that can be used in OMSSA

Definition at line 99 of file omssaapp.cpp.

References eMSIonType_adot, eMSIonType_max, eMSIonType_parent, i, and kIonLabels.

Referenced by COMSSA::Run().

void COMSSABase::PrintMods ( CRef< CMSModSpecSet Modset)

print out a list of modification that can be used in OMSSA

Definition at line 69 of file omssaapp.cpp.

References eMSMod_max, CMSModSpecSet::GetModMass(), CMSModSpecSet::GetModName(), i, map_checker< Container >::insert(), and ITERATE.

Referenced by COMSSA::Run().

virtual int COMSSABase::Run ( )
pure virtual

Run the application.

It is defined as a pure virtual method – so you must(!) supply the Run() method to implement the application-specific logic.

Returns
Exit code.

Implements CNcbiApplication.

Implemented in COMSSA.

void COMSSABase::RunSearch ( CRef< CSearch SearchEngine)

run multithreaded search

Parameters
SearchEngineoriginal copy of search engine

Definition at line 528 of file omssaapp.cpp.

References _TRACE, CSearch< LEGACY, NHITS >::CopySettings(), CThread::fRunAllowST, GetnThreads(), i, result, and SetsearchThreads().

Referenced by COMSSA::Run().

int & COMSSABase::SetnThreads ( void  )
inline

return settable number of threads

Definition at line 181 of file omssaapp.hpp.

References nThreads.

Referenced by SetThreadCount().

void COMSSABase::SetOutFile ( bool  IncludeSpectra,
EMSSerialDataFormat  FileFormat,
std::string  FileName,
CRef< CMSSearchSettings > &  Settings 
)

Set the out files.

Parameters
IncludeSpectrashould we include the spectra in output?
FileFormatthe output file format
FileNameoutput file name
Settingsearch settings

Definition at line 353 of file omssaapp.cpp.

References CMSOutFile_Base::SetIncluderequest(), CMSOutFile_Base::SetOutfile(), CMSSearchSettings_Base::SetOutfiles(), and CMSOutFile_Base::SetOutfiletype().

Referenced by SetSearchSettings().

void COMSSABase::SetSearchSettings ( const CArgs args,
CRef< CMSSearchSettings Settings 
)

Set search settings given args.

Definition at line 375 of file omssaapp.cpp.

References eMSSerialDataFormat_asnbinary, eMSSerialDataFormat_asntext, eMSSerialDataFormat_csv, eMSSerialDataFormat_pepxml, eMSSerialDataFormat_xml, eMSSerialDataFormat_xmlbz2, eMSSpectrumFileType_dta, eMSSpectrumFileType_dtablank, eMSSpectrumFileType_dtaxml, eMSSpectrumFileType_mgf, eMSSpectrumFileType_oms, eMSSpectrumFileType_omx, eMSSpectrumFileType_omxbz2, eMSSpectrumFileType_pkl, eMSSpectrumFileType_xml, ERR_POST, Fatal(), InsertList(), MSSCALE, CMSSearchSettings_Base::SetAutomassadjust(), CMSSearchSettings_Base::SetChargehandling(), CMSSearchSettings_Base::SetCuthi(), CMSSearchSettings_Base::SetCutinc(), CMSSearchSettings_Base::SetCutlo(), CMSSearchSettings_Base::SetCutoff(), CMSSearchSettings_Base::SetDb(), CMSSearchSettings_Base::SetDoublenum(), CMSSearchSettings_Base::SetDoublewin(), CMSSearchSettings_Base::SetEnzyme(), CMSSearchSettings_Base::SetExactmass(), CMSSearchSettings_Base::SetFixed(), CMSSearchSettings_Base::SetHitlistlen(), CMSInFile_Base::SetInfile(), CMSSearchSettings_Base::SetInfiles(), CMSInFile_Base::SetInfiletype(), CMSSearchSettings_Base::SetIonstosearch(), CMSSearchSettings_Base::SetIterativesettings(), CMSSearchSettings_Base::SetMaxmods(), CMSSearchSettings_Base::SetMaxnoenzyme(), CMSSearchSettings_Base::SetMaxproductions(), CMSSearchSettings_Base::SetMinhit(), CMSSearchSettings_Base::SetMinnoenzyme(), CMSSearchSettings_Base::SetMinspectra(), CMSSearchSettings_Base::SetMissedcleave(), CMSSearchSettings_Base::SetMsmstol(), CMSSearchSettings_Base::SetNmethionine(), CMSSearchSettings_Base::SetNocorrelationscore(), CMSSearchSettings_Base::SetNoprolineions(), CMSSearchSettings_Base::SetNumisotopes(), SetOutFile(), CMSSearchSettings_Base::SetPepppm(), CMSSearchSettings_Base::SetPeptol(), CMSSearchSettings_Base::SetPrecursorcull(), CMSSearchSettings_Base::SetPrecursorsearchtype(), CMSSearchSettings_Base::SetProbfollowingion(), CMSSearchSettings_Base::SetProductsearchtype(), CMSSearchSettings_Base::SetPseudocount(), CMSSearchSettings_Base::SetReportedhitcount(), CMSSearchSettings_Base::SetScale(), CMSSearchSettings_Base::SetSearchb1(), CMSSearchSettings_Base::SetSearchctermproduct(), CMSSearchSettings_Base::SetSinglenum(), CMSSearchSettings_Base::SetSinglewin(), CMSSearchSettings_Base::SetTaxids(), CMSSearchSettings_Base::SetTophitnum(), CMSSearchSettings_Base::SetVariable(), CMSSearchSettings_Base::SetZdep(), and size.

Referenced by COMSSA::Run().

COMSSABase::TSearchThreads & COMSSABase::SetsearchThreads ( void  )
inline

return a settable list of search engine threads

Definition at line 167 of file omssaapp.hpp.

References searchThreads.

Referenced by COMSSA::Run(), and RunSearch().

void COMSSABase::SetThreadCount ( int  NumThreads)

set up number of threads

Parameters
NumThreadsnumber of threads requested by user

Definition at line 515 of file omssaapp.cpp.

References ERR_POST, GetCpuCount(), GetnThreads(), Info(), and SetnThreads().

Referenced by COMSSA::Run().

Member Data Documentation

int COMSSABase::nThreads
private

number of search threads

Definition at line 153 of file omssaapp.hpp.

Referenced by GetnThreads(), and SetnThreads().

TSearchThreads COMSSABase::searchThreads
private

search threads

Definition at line 148 of file omssaapp.hpp.

Referenced by GetsearchThreads(), and SetsearchThreads().


The documentation for this class was generated from the following files:
Modified on Mon May 29 16:56:32 2017 by modify_doxy.py rev. 533848