19#ifndef MS_SPECTRAL_LIB_FILE
20#define MS_SPECTRAL_LIB_FILE
30namespace matrix_science {
69 ms_spectral_lib_file(
const char * fileName,
const char * regexForAccession,
const char * cdbFileName = 0);
73 ms_spectral_lib_file(
const char * fileName,
const char * regexForAccession,
const char * cdbFileName,
const std::map<std::string, std::string> & modificationAliases);
80 int getNumEntries()
const;
83 int getNumResidues()
const;
86 std::vector<int> findEntries(
const char * sequence,
const char * checksum = 0,
const char * accession = 0,
const char * mods=0)
const;
92 std::vector<std::string> getEntryFromNumberAsText(
const int number)
const;
96 std::string getAccessionFromNumber(
const int number)
const;
99 std::string getChecksumFromNumber(
const int number)
const;
102 std::string getSequenceFromNumber(
const int number)
const;
105 std::string getModsFromNumber(
const int number)
const;
108 double getPrecursorMZFromNumber(
const int number)
const;
111 int getPrecursorChargeFromNumber(
const int number)
const;
114 std::vector<std::string> getAllMods()
const;
120 bool saveAs(
const char * fileName,
121 const bool replaceProteinName =
true,
123 const int startNumber = 1,
124 const int endNumber = -1,
126 const double annotateTol = 0.6,
127 const char * annotateTolu =
"Da",
131 std::string getStatsInformation()
const;
134 std::string getFileName()
const;
137 long getQmatch(
double minMz,
double maxMz)
const;
147 struct sequentialIndex_t {
148 std::string accession;
149 std::string checksum;
150 std::string sequence;
154 OFFSET64_T fileOffset;
156 void initialise(
const char * fileName,
const char * regexForAccession,
const char * cdbFileName,
const std::map<std::string, std::string> & aliases);
157 bool readFile(
int recordNumber)
const;
158 void getline(std::string & str)
const;
159 ms_errs::err getEntryAsText(
const int number, std::vector<std::string> & lines, std::string & errorMsg)
const;
162 const OFFSET64_T fileOffset);
163 OFFSET64_T getFileOffsetFromId(
int number)
const;
164 const char * getSpectrumDelimiter()
const;
166 int applyModAliases(
const std::map<std::string, std::string> & aliases);
170 std::string fileName_;
171 mutable int numEntries_;
172 mutable int numResidues_;
174 mutable bool wholeFileRead_;
182 mutable OFFSET64_T offsetToNextRecord_;
183 typedef std::map<std::string, std::vector<int> > strLookup_t;
184 std::vector<strLookup_t> lookup_;
185 std::vector<sequentialIndex_t> sequentialIndex_;
186 typedef std::map<std::string, std::string> modMap_t;
187 mutable modMap_t modsMap_;
189 typedef std::multiset<double> precursors_t;
190 mutable precursors_t precursors_;
This class is used as a base class for several Mascot Parser classes.
Definition: ms_errors.hpp:696
msg_num_t err
Definitions for error numbers.
Definition: ms_errors.hpp:41
Represents a single regular expression parsing rule.
Definition: ms_parserule.hpp:38
This class is used to encapsulate a single entry, i.e. single spectrum from a NIST ....
Definition: ms_spectral_lib_entry.hpp:68
WHAT_TO_ANNOTATE
Used by annotatePeaks to specify if existing annotation should be overwritten.
Definition: ms_spectral_lib_entry.hpp:76
This class is used to encapsulate a complete NIST .msp, SpectraST .sptxt or X!Hunter ASL MGF file.
Definition: ms_spectral_lib_file.hpp:66
Wrapper for the public domain tinycdb package http://www.corpit.ru/mjt/tinycdb.html by Michael Tokare...
Definition: ms_tinycdb.hpp:124
This class represents the file unimod.xml.
Definition: ms_umod_configfile.hpp:54
FILE_FORMAT
Definition: ms_spectral_lib_peak.hpp:48