OpenMS  2.6.0
openswathalgo/include/OpenMS/OPENSWATHALGO/Macros.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 <cassert>
38 
39 // Simple implementation of PRE and POST conditions using assert (should be on
40 // during debug mode and off during release mode) with a informative message
41 // which is printed alongside the dump.
42 // see http://stackoverflow.com/questions/3692954/add-custom-messages-in-assert
43 // "Since a pointer "is true" if it's non-null, you can use the &&-operator to
44 // chain and display the message".
45 #define OPENSWATH_PRECONDITION(condition, message)\
46  assert( (condition) && (message));
47 
48 #define OPENMS_POSTCONDITION(condition, message)\
49  assert( (condition) && (message));
50 
OpenMS::SpectrumLookup::findByRT
Size findByRT(double rt) const
Look up spectrum by retention time (RT).
OpenMS::FileTypes::IDXML
OpenMS identification format (.idXML)
Definition: FileTypes.h:66
OpenMS::TOPPBase
Base class for TOPP applications.
Definition: TOPPBase.h:144
OpenMS::Residue::getModificationName
const String & getModificationName() const
returns the name (ID) of the modification, or an empty string if none is set
FileHandler.h
FileTypes.h
OpenMS::IDFilter::keepNBestHits
static void keepNBestHits(std::vector< IdentificationType > &ids, Size n)
Filters peptide or protein identifications according to the score of the hits, keeping the n best hit...
Definition: IDFilter.h:863
OpenMS::IdXMLFile::store
void store(const String &filename, const std::vector< ProteinIdentification > &protein_ids, const std::vector< PeptideIdentification > &peptide_ids, const String &document_id="")
Stores the data in an idXML file.
OpenMS::ResidueModification
Representation of a modification.
Definition: ResidueModification.h:76
OpenMS::PeptideHit::getSequence
const AASequence & getSequence() const
returns the peptide sequence without trailing or following spaces
OpenMS::File::basename
static String basename(const String &file)
Returns the basename of the file (without the path).
OpenMS::MSExperiment::sortSpectra
void sortSpectra(bool sort_mz=true)
Sorts the data points by retention time.
OpenMS::FileHandler::getTypeByFileName
static FileTypes::Type getTypeByFileName(const String &filename)
Determines the file type from a file name.
OpenMS::FileTypes::PEPXML
TPP pepXML file (.pepXML)
Definition: FileTypes.h:75
OpenMS::MetaInfoInterface::getMetaValue
const DataValue & getMetaValue(const String &name, const DataValue &default_value=DataValue::EMPTY) const
Returns the value corresponding to a string, or a default value (default: DataValue::EMPTY) if not fo...
OpenMS::MzMLFile
File adapter for MzML files.
Definition: MzMLFile.h:55
OpenMS::String
A more convenient string class.
Definition: String.h:59
JavaInfo.h
OpenMS::Exception::FileNotFound
File not found exception.
Definition: Exception.h:523
MzMLFile.h
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
OpenMS::PeakFileOptions::addMSLevel
void addMSLevel(int level)
adds a desired MS level for peaks to load
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::AASequence::toString
String toString() const
returns the peptide as string with modifications embedded in brackets
OpenMS::AASequence::toUnmodifiedString
String toUnmodifiedString() const
returns the peptide as string without any modifications or (e.g., "PEPTIDER")
OPENMS_LOG_WARN
#define OPENMS_LOG_WARN
Macro if a warning, a piece of information which should be read by the user, should be logged.
Definition: LogStream.h:460
OpenMS::String::hasPrefix
bool hasPrefix(const String &string) const
true if String begins with string, false otherwise
OpenMS::String::hasSubstring
bool hasSubstring(const String &string) const
true if String contains the string, false otherwise
OpenMS::AASequence::getCTerminalModificationName
const String & getCTerminalModificationName() const
returns the name (ID) of the C-terminal modification, or an empty string if none is set
OpenMS::PeptideIdentification::getHits
const std::vector< PeptideHit > & getHits() const
returns the peptide hits as const
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::AASequence::setModification
void setModification(Size index, const String &modification)
OpenMS::ModificationsDB::getInstance
static ModificationsDB * getInstance()
Returns a pointer to the modifications DB (singleton)
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
OpenMS::ResidueModification::getOrigin
char getOrigin() const
Returns the origin (i.e. modified amino acid)
OpenMS::MetaInfoInterface::setMetaValue
void setMetaValue(const String &name, const DataValue &value)
Sets the DataValue corresponding to a name.
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::SpectrumLookup::findByNativeID
Size findByNativeID(const String &native_id) const
Look up spectrum by native ID.
OpenMS::SpectrumLookup::rt_tolerance
double rt_tolerance
Tolerance for look-up by retention time.
Definition: SpectrumLookup.h:78
OpenMS::AASequence::setNTerminalModification
void setNTerminalModification(const String &modification)
OpenMS::FileHandler
Facilitates file handling by file type recognition.
Definition: FileHandler.h:62
OpenMS::AASequence::getResidue
const Residue & getResidue(Size index) const
returns a pointer to the residue at position index
OpenMS::SpectrumLookup
Helper class for looking up spectra based on different attributes.
Definition: SpectrumLookup.h:67
ModificationDefinitionsSet.h
OpenMS::ResidueModification::getDiffMonoMass
double getDiffMonoMass() const
returns the diff monoisotopic mass, or 0.0 if not set
OpenMS::FileTypes::Type
Type
Actual file types enum.
Definition: FileTypes.h:58
OpenMS::SpectrumLookup::readSpectra
void readSpectra(const SpectrumContainer &spectra, const String &scan_regexp=default_scan_regexp)
Read and index spectra for later look-up.
Definition: SpectrumLookup.h:103
OpenMS::AASequence::size
Size size() const
returns the number of residues
OpenMS::PepXMLFile::store
void store(const String &filename, std::vector< ProteinIdentification > &protein_ids, std::vector< PeptideIdentification > &peptide_ids, const String &mz_file="", const String &mz_name="", bool peptideprophet_analyzed=false, double rt_tolerance=0.01)
Stores idXML as PepXML file.
OpenMS::AASequence::setCTerminalModification
void setCTerminalModification(const String &modification)
OpenMS::FileHandler::getType
static FileTypes::Type getType(const String &filename)
Tries to determine the file type (by name or content)
OpenMS::String::split
bool split(const char splitter, std::vector< String > &substrings, bool quote_protect=false) const
Splits a string into substrings using splitter as delimiter.
PepXMLFile.h
OpenMS::String::toQString
QString toQString() const
Conversion to Qt QString.
OpenMS::File::path
static String path(const String &file)
Returns the path of the file (without the file name).
CsvFile.h
OpenMS::AASequence::isModified
bool isModified() const
returns true if any of the residues or termini are modified
OpenMS::PeptideIdentification::getScoreType
const String & getScoreType() const
returns the peptide score type
OpenMS::PeptideHit::setSequence
void setSequence(const AASequence &sequence)
sets the peptide sequence
ModificationsDB.h
OpenMS::AASequence::getNTerminalModificationName
const String & getNTerminalModificationName() const
returns the name (ID) of the N-terminal modification, or an empty string if none is set
OpenMS::CsvFile
This class handles csv files. Currently only loading is implemented.
Definition: CsvFile.h:49
OpenMS::JavaInfo::canRun
static bool canRun(const String &java_executable, bool verbose_on_error=true)
Determine if Java is installed and reachable.
main
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:73
OpenMS::AASequence::hasCTerminalModification
bool hasCTerminalModification() const
predicate which is true if the peptide is C-term modified
OpenMS::Exception::RequiredParameterNotGiven
A required parameter was not given.
Definition: TOPPBase.h:111
OPENMS_LOG_ERROR
#define OPENMS_LOG_ERROR
Macro to be used if non-fatal error are reported (processing continues)
Definition: LogStream.h:455
OpenMS::File::absolutePath
static String absolutePath(const String &file)
Replaces the relative path in the argument with the absolute path.
OpenMS::File::TempDir
Class representing a temporary directory.
Definition: File.h:63
OpenMS::PeptideIdentification
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:62
OpenMS::ListUtils
Collection of utility functions for management of vectors.
Definition: ListUtils.h:77
OpenMS::MetaInfoInterface::metaValueExists
bool metaValueExists(const String &name) const
Returns whether an entry with the given name exists.
OpenMS::MSExperiment::getSpectra
const std::vector< MSSpectrum > & getSpectra() const
returns the spectrum list
OpenMS::PeptideHit::getScore
double getScore() const
returns the PSM score
OpenMS::PeakFileOptions
Options for loading files containing peak data.
Definition: PeakFileOptions.h:47
OpenMS::TOPPBase::ExitCodes
ExitCodes
Exit codes.
Definition: TOPPBase.h:149
String.h
OpenMS::ModificationsDB::getAllSearchModifications
void getAllSearchModifications(std::vector< String > &modifications) const
Collects all modifications that can be used for identification searches.
OpenMS::PeakFileOptions::clearMSLevels
void clearMSLevels()
clears the MS levels
OpenMS::String::remove
String & remove(char what)
Remove all occurrences of the character what.
OpenMS::AASequence
Representation of a peptide/protein sequence.
Definition: AASequence.h:111
OpenMS::AASequence::hasNTerminalModification
bool hasNTerminalModification() const
predicate which is true if the peptide is N-term modified
IDFilter.h
OpenMS::PepXMLFile
Used to load and store PepXML files.
Definition: PepXMLFile.h:63
OpenMS::AASequence::fromString
static AASequence fromString(const String &s, bool permissive=true)
create AASequence object by parsing an OpenMS string
OpenMS::Exception::ElementNotFound
Element could not be found exception.
Definition: Exception.h:662
OpenMS::ProteinIdentification::SearchParameters
Search parameters of the DB search.
Definition: ProteinIdentification.h:258
OpenMS::Residue::isModified
bool isModified() const
true if the residue is a modified one
StandardTypes.h
OpenMS::ModificationsDB::getModification
const ResidueModification * getModification(Size index) const
Returns the modification with the given index. note: out-of-bounds check is only performed in debug m...
File.h
OpenMS::Constants::UserParam::LOCALIZED_MODIFICATIONS_USERPARAM
const std::string LOCALIZED_MODIFICATIONS_USERPARAM
OpenMS::ProgressLogger::setLogType
void setLogType(LogType type) const
Sets the progress log that should be used. The default type is NONE!
TOPPBase.h
OpenMS::SpectrumLookup::findByScanNumber
Size findByScanNumber(Size scan_number) const
Look up spectrum by scan number (extracted from the native ID).
OpenMS::IdXMLFile
Used to load and store idXML files.
Definition: IdXMLFile.h:63
OpenMS::FileTypes::typeToName
static String typeToName(Type type)
Returns the name/extension of the type.
OpenMS::PeptideIdentification::getRT
double getRT() const
returns the RT of the MS2 spectrum where the identification occurred
OpenMS::PeptideHit::setScore
void setScore(double score)
sets the PSM score
OpenMS::FileHandler::swapExtension
static String swapExtension(const String &filename, const FileTypes::Type new_type)
Tries to find and remove a known file extension, and append the new one.
OpenMS::PeptideHit
Representation of a peptide hit.
Definition: PeptideHit.h:55