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

Search Toolkit Book for CSearchHelper

class to hold various helper functions for CSearch More...

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

Public Types

typedef map< int, stringTTaxNameMap
 read in taxonomy file More...
 

Static Public Member Functions

static void SaveOneFile (CMSSearch &MySearch, const string Filename, ESerialDataFormat FileFormat, bool IncludeRequest, bool bz2)
 
static int ReadModFiles (const string &ModFileName, const string &UserModFileName, const string &Path, CRef< CMSModSpecSet > Modset)
 read in modification files. More...
 
static void ReadTaxFile (string &Filename, TTaxNameMap &TaxNameMap)
 
static void ConditionXMLStream (CObjectOStreamXml *xml_out)
 correctly set up xml stream More...
 
static int ReadFile (const string &Filename, const EMSSpectrumFileType FileType, CMSSearch &MySearch)
 Read in a spectrum file. More...
 
static int LoadAnyFile (CMSSearch &MySearch, CConstRef< CMSInFile > InFile, bool *SearchEngineIterative=0)
 Read in any input file. More...
 
static int ReadSearchRequest (const string &Filename, const ESerialDataFormat DataFormat, CMSSearch &MySearch)
 Read in an MSRequest. More...
 
static int ReadCompleteSearch (const string &Filename, const ESerialDataFormat DataFormat, bool bz2, CMSSearch &MySearch)
 Read in a complete search (typically for an iterative search) More...
 
static int SaveAnyFile (CMSSearch &MySearch, CMSSearchSettings::TOutfiles OutFiles, CRef< CMSModSpecSet > Modset)
 Write out a complete search. More...
 
static void ValidateSearchSettings (CRef< CMSSearchSettings > &Settings)
 Validates Search Settings. More...
 
static void CreateSearchSettings (string FileName, CRef< CMSSearchSettings > &Settings)
 create search setting object from file or brand new More...
 

Detailed Description

class to hold various helper functions for CSearch

Definition at line 917 of file omssa.hpp.

Member Typedef Documentation

◆ TTaxNameMap

read in taxonomy file

Parameters
Filenamefilename
TaxNameMapmaps taxid to friendly name

Definition at line 954 of file omssa.hpp.

Member Function Documentation

◆ ConditionXMLStream()

void CSearchHelper::ConditionXMLStream ( CObjectOStreamXml xml_out)
static

correctly set up xml stream

Parameters
xml_outxml output stream

Definition at line 135 of file omssa.cpp.

References CObjectOStreamXml::SetReferenceSchema(), and CObjectOStream::SetWriteNamedIntegersByValue().

Referenced by SaveOneFile().

◆ CreateSearchSettings()

void CSearchHelper::CreateSearchSettings ( string  FileName,
CRef< CMSSearchSettings > &  Settings 
)
static

create search setting object from file or brand new

Parameters
FileNamename of search settings file
Settingsoutput

Definition at line 379 of file omssa.cpp.

References ERR_POST, eSerial_Xml, Fatal(), ObjectInfo(), and CObjectIStream::Open().

Referenced by COMSSA::Run().

◆ LoadAnyFile()

int CSearchHelper::LoadAnyFile ( CMSSearch MySearch,
CConstRef< CMSInFile InFile,
bool SearchEngineIterative = 0 
)
static

Read in any input file.

Parameters
InFiletype and name of file to be read in
MySearchthe search i/o object
SearchEngineIterativeset to true if this should be an iterative search
Returns
1, -1 = error, 0 = ok

Definition at line 224 of file omssa.cpp.

References eMSSpectrumFileType_asc, eMSSpectrumFileType_dta, eMSSpectrumFileType_dtablank, eMSSpectrumFileType_dtaxml, eMSSpectrumFileType_mgf, eMSSpectrumFileType_oms, eMSSpectrumFileType_omx, eMSSpectrumFileType_omxbz2, eMSSpectrumFileType_pkl, eMSSpectrumFileType_pks, eMSSpectrumFileType_sciex, eMSSpectrumFileType_unknown, eMSSpectrumFileType_xml, eSerial_AsnBinary, eSerial_Xml, ReadCompleteSearch(), ReadFile(), and ReadSearchRequest().

Referenced by COMSSA::Run().

◆ ReadCompleteSearch()

int CSearchHelper::ReadCompleteSearch ( const string Filename,
const ESerialDataFormat  DataFormat,
bool  bz2,
CMSSearch MySearch 
)
static

Read in a complete search (typically for an iterative search)

Parameters
Filenamename of file
Dataformatxml or asn.1
bz2is the file bzip2 compressed?
MySearchthe search
Returns
0 if OK

Definition at line 193 of file omssa.cpp.

References ERR_POST, CCompressionStream::fOwnProcessor, in(), ObjectInfo(), CObjectIStream::Open(), and Warning().

Referenced by LoadAnyFile(), COMSSAMerge::Run(), and COmssa2pepxmlApplication::Run().

◆ ReadFile()

int CSearchHelper::ReadFile ( const string Filename,
const EMSSpectrumFileType  FileType,
CMSSearch MySearch 
)
static

Read in a spectrum file.

Parameters
Filenamename of file
FileTypetype of file to be read in
MySearchthe search
Returns
1, -1 = error, 0 = ok

Definition at line 147 of file omssa.cpp.

References ERR_POST, Fatal(), and CMSSearch_Base::SetRequest().

Referenced by LoadAnyFile().

◆ ReadModFiles()

int CSearchHelper::ReadModFiles ( const string ModFileName,
const string UserModFileName,
const string Path,
CRef< CMSModSpecSet Modset 
)
static

read in modification files.

probably should be in some helper class

Parameters
ModFileNamemods.xml
UserModFileNameusermods.xml
Pathprogram path
Modsetthe data structure containing the mods
bz2use bzip2 compression
Returns
1 on error

Definition at line 61 of file omssa.cpp.

References CMSModSpecSet::Append(), Critical(), ERR_POST, eSerial_Xml, Fatal(), CDirEntry::GetDir(), CDirEntry::IsAbsolutePath(), ObjectInfo(), CObjectIStream::Open(), Path(), and Warning().

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

◆ ReadSearchRequest()

int CSearchHelper::ReadSearchRequest ( const string Filename,
const ESerialDataFormat  DataFormat,
CMSSearch MySearch 
)
static

Read in an MSRequest.

Parameters
Filenamename of file
Dataformatxml or asn.1
MySearchthe search
Returns
0 if OK

Definition at line 169 of file omssa.cpp.

References ERR_POST, in(), ObjectInfo(), CObjectIStream::Open(), CMSSearch_Base::SetRequest(), and Warning().

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

◆ ReadTaxFile()

void CSearchHelper::ReadTaxFile ( string Filename,
TTaxNameMap TaxNameMap 
)
static

Definition at line 116 of file omssa.cpp.

References NStr::fSplit_Tokenize, NStr::Split(), and NStr::StringToInt().

◆ SaveAnyFile()

int CSearchHelper::SaveAnyFile ( CMSSearch MySearch,
CMSSearchSettings::TOutfiles  OutFiles,
CRef< CMSModSpecSet Modset 
)
static

◆ SaveOneFile()

void CSearchHelper::SaveOneFile ( CMSSearch MySearch,
const string  Filename,
ESerialDataFormat  FileFormat,
bool  IncludeRequest,
bool  bz2 
)
static
Parameters
MySearch
iOutFile
Filename
FileFormat
txt_out

Definition at line 265 of file omssa.cpp.

References ConditionXMLStream(), eSerial_Xml, CCompressionStream::fOwnProcessor, ObjectInfo(), CObjectOStream::Open(), and CMSSearch_Base::SetResponse().

Referenced by SaveAnyFile().

◆ ValidateSearchSettings()

void CSearchHelper::ValidateSearchSettings ( CRef< CMSSearchSettings > &  Settings)
static

Validates Search Settings.

Parameters
Settings

Definition at line 366 of file omssa.cpp.

References ERR_POST, Fatal(), CMSSearchSettings::Validate(), and Warning().

Referenced by COMSSA::Run().


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:57:03 2024 by modify_doxy.py rev. 669887