OpenMS  2.5.0
IndexedMzMLDecoder.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2020.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Hannes Roest $
32 // $Authors: Hannes Roest $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 #include <OpenMS/config.h>
38 #include <OpenMS/CONCEPT/Types.h>
41 
42 namespace OpenMS
43 {
44 
58  class OPENMS_DLLAPI IndexedMzMLDecoder
59  {
60  public:
61 
63  typedef std::vector< std::pair<std::string, std::streampos> > OffsetVector;
64 
80  int parseOffsets(String filename, std::streampos indexoffset, OffsetVector & spectra_offsets, OffsetVector& chromatograms_offsets);
81 
107  std::streampos findIndexListOffset(String filename, int buffersize = 1023);
108 
109  protected:
110 
146  int domParseIndexedEnd_(std::string in, OffsetVector & spectra_offsets, OffsetVector& chromatograms_offsets);
147  };
148 
149 }
OpenMS::FileTypes::IDXML
OpenMS identification format (.idXML)
Definition: FileTypes.h:66
OpenMS::PSLPFormulation::IndexLess
Definition: PSLPFormulation.h:140
OpenMS::TOPPBase
Base class for TOPP applications.
Definition: TOPPBase.h:144
OpenMS::Param::removeAll
void removeAll(const String &prefix)
Remove all entries that start with prefix.
OpenMS::Param::copy
Param copy(const String &prefix, bool remove_prefix=false) const
Returns a new Param object containing all entries that start with prefix.
FileHandler.h
Types.h
OpenMS::OfflinePrecursorIonSelection::getMassRanges
void getMassRanges(const FeatureMap &features, const PeakMap &experiment, std::vector< std::vector< std::pair< Size, Size > > > &indices)
Calculates the mass ranges for each feature and stores them as indices of the raw data.
OpenMS::Exception::InvalidSize
Invalid UInt exception.
Definition: Exception.h:303
OpenMS::MSExperiment::sortSpectra
void sortSpectra(bool sort_mz=true)
Sorts the data points by retention time.
OpenMS::FASTAFile
This class serves for reading in and writing FASTA files.
Definition: FASTAFile.h:64
InclusionExclusionList.h
OpenMS::IndexedMzMLDecoder::OffsetVector
std::vector< std::pair< std::string, std::streampos > > OffsetVector
The vector containing binary offsets.
Definition: IndexedMzMLDecoder.h:63
OpenMS::MzMLFile
File adapter for MzML files.
Definition: MzMLFile.h:55
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::MSExperiment::begin
Iterator begin()
Definition: MSExperiment.h:157
MzMLFile.h
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
IdXMLFile.h
OpenMS::Constants::c
const double c
OpenMS::Param::getValue
const DataValue & getValue(const String &key) const
Returns a value of a parameter.
OpenMS::FeatureMap::setPrimaryMSRunPath
void setPrimaryMSRunPath(const StringList &s)
set the file path to the primary MS run (usually the mzML file obtained after data conversion from ra...
OpenMS::IntList
std::vector< Int > IntList
Vector of signed integers.
Definition: ListUtils.h:55
OpenMS::PSLPFormulation::createAndSolveILPForKnownLCMSMapFeatureBased
void createAndSolveILPForKnownLCMSMapFeatureBased(const FeatureMap &features, const PeakMap &experiment, std::vector< IndexTriple > &variable_indices, std::vector< std::vector< std::pair< Size, Size > > > &mass_ranges, std::set< Int > &charges_set, UInt ms2_spectra_per_rt_bin, std::vector< int > &solution_indices)
Encode ILP formulation for a given LC-MS map, but unknown protein sample.
OpenMS::MSExperiment::size
Size size() const
Definition: MSExperiment.h:127
OpenMS::IdXMLFile::load
void load(const String &filename, std::vector< ProteinIdentification > &protein_ids, std::vector< PeptideIdentification > &peptide_ids)
Loads the identifications of an idXML file without identifier.
OpenMS::File::exists
static bool exists(const String &file)
Method used to test if a file exists.
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
Exception.h
OpenMS::FileTypes::FEATUREXML
OpenMS feature file (.featureXML)
Definition: FileTypes.h:65
OpenMS::MzMLFile::load
void load(const String &filename, PeakMap &map)
Loads a map from a MzML file. Spectra and chromatograms are sorted by default (this can be disabled u...
OpenMS::FileHandler
Facilitates file handling by file type recognition.
Definition: FileHandler.h:62
OpenMS::PSLPFormulation
Implements ILP formulation of precursor selection problems.
Definition: PSLPFormulation.h:55
OpenMS::OfflinePrecursorIonSelection::createProteinSequenceBasedLPInclusionList
void createProteinSequenceBasedLPInclusionList(String include, String rt_model_file, String pt_model_file, FeatureMap &precursors)
OpenMS::FeatureXMLFile::load
void load(const String &filename, FeatureMap &feature_map)
loads the file with name filename into map and calls updateRanges().
RangeUtils.h
OpenMS::FileTypes::Type
Type
Actual file types enum.
Definition: FileTypes.h:58
OpenMS::Exception::UnableToCreateFile
Unable to create file exception.
Definition: Exception.h:636
OpenMS::FileHandler::getType
static FileTypes::Type getType(const String &filename)
Tries to determine the file type (by name or content)
OpenMS::DefaultParamHandler::setParameters
void setParameters(const Param &param)
Sets the parameters.
OpenMS::InclusionExclusionList
Provides functionality for writing inclusion or exclusion lists.
Definition: InclusionExclusionList.h:52
OpenMS::DefaultParamHandler::getParameters
const Param & getParameters() const
Non-mutable access to the parameters.
OpenMS::FeatureXMLFile::store
void store(const String &filename, const FeatureMap &feature_map)
stores the map feature_map in file with name filename.
OpenMS::UInt
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
OfflinePrecursorIonSelection.h
main
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:73
OpenMS::FeatureMap
A container for features.
Definition: FeatureMap.h:95
OpenMS::OfflinePrecursorIonSelection
Implements different algorithms for precursor ion selection.
Definition: OfflinePrecursorIonSelection.h:61
OpenMS::Param::remove
void remove(const String &key)
Remove the entry key or a section key (when suffix is ':')
OpenMS::FASTAFile::load
static void load(const String &filename, std::vector< FASTAEntry > &data)
loads a FASTA file given by 'filename' and stores the information in 'data'
OpenMS::MSExperiment::end
Iterator end()
Definition: MSExperiment.h:167
OpenMS::MSExperiment::getSpectra
const std::vector< MSSpectrum > & getSpectra() const
returns the spectrum list
OpenMS::FeatureXMLFile
This class provides Input/Output functionality for feature maps.
Definition: FeatureXMLFile.h:68
OpenMS::InclusionExclusionList::writeTargets
void writeTargets(const std::vector< FASTAFile::FASTAEntry > &fasta_entries, const String &out_path, const IntList &charges, const String rt_model_path)
Writes inclusion or exclusion list of tryptic peptides of the given proteins (tab-delimited).
String.h
OpenMS::Param
Management and storage of parameters / INI files.
Definition: Param.h:73
OpenMS::Exception::MissingInformation
Not all required information provided.
Definition: Exception.h:195
OpenMS::TargetedExperiment
A description of a targeted experiment containing precursor and production ions.
Definition: TargetedExperiment.h:64
OpenMS::IndexedMzMLDecoder
A class to analyze indexedmzML files and extract the offsets of individual tags.
Definition: IndexedMzMLDecoder.h:58
OpenMS::Param::insert
void insert(const String &prefix, const Param &param)
File.h
TOPPBase.h
OpenMS::InMSLevelRange
Predicate that determines if a spectrum lies inside/outside a specific MS level set.
Definition: RangeUtils.h:170
OpenMS::IdXMLFile
Used to load and store idXML files.
Definition: IdXMLFile.h:63