MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / getSpectrum

Method getSpectrum

src/openms/source/FORMAT/CachedMzML.cpp:63–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61 }
62
63 MSSpectrum CachedmzML::getSpectrum(Size id)
64 {
65 OPENMS_PRECONDITION(id < getNrSpectra(), "Id cannot be larger than number of spectra");
66
67 if ( !ifs_.seekg(spectra_index_[id]) )
68 {
69 std::cerr << "Error while reading spectrum " << id << " - seekg created an error when trying to change position to " << spectra_index_[id] << "." << std::endl;
70 std::cerr << "Maybe an invalid position was supplied to seekg, this can happen for example when reading large files (>2GB) on 32bit systems." << std::endl;
71 throw Exception::ParseError(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
72 "Error while changing position of input stream pointer.", filename_cached_);
73 }
74
75 MSSpectrum s = meta_ms_experiment_.getSpectrum(id);
76 Internal::CachedMzMLHandler::readSpectrum(s, ifs_);
77 return s;
78 }
79
80 MSChromatogram CachedmzML::getChromatogram(Size id)
81 {

Callers 15

mouseMoveEventMethod · 0.45
addDataFileMethod · 0.45
showCurrentPeaksAsDIAMethod · 0.45
calculateSpectrum_Method · 0.45
LayerDataPeak.hFile · 0.45
postScoreHits_Function · 0.45
main_Function · 0.45
main_Method · 0.45

Calls 1

getNrSpectraFunction · 0.50

Tested by 12

calculateSpectrum_Method · 0.36
START_SECTIONFunction · 0.36
START_SECTIONFunction · 0.36
START_SECTIONFunction · 0.36
START_SECTIONFunction · 0.36
createMSSpectrumFunction · 0.36
START_SECTIONFunction · 0.36
START_SECTIONFunction · 0.36
START_SECTIONFunction · 0.36
test_readfile_contentMethod · 0.36
mainFunction · 0.36