|
OpenMS
2.5.0
|
Go to the documentation of this file.
76 template <
typename FeatureMapType>
77 void load(
const String& filename, FeatureMapType& feature_map)
86 bool first_line =
true;
92 if (line.empty() || line[0] ==
'#')
continue;
102 std::vector<String> parts;
103 line.
split(
'\t', parts);
105 if (parts.size() < 18)
107 throw Exception::ParseError(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
"",
String(
"Failed to convert line ") +
String((it - input.
begin()) + 1) +
". Not enough columns (expected 18 or more, got " +
String(parts.size()) +
")");
112 Size column_to_convert = 0;
115 column_to_convert = 1;
116 f.
setRT(parts[1].toDouble());
117 column_to_convert = 2;
118 f.
setMZ(parts[2].toDouble());
119 column_to_convert = 5;
121 column_to_convert = 6;
123 column_to_convert = 8;
126 column_to_convert = 3;
128 column_to_convert = 4;
130 column_to_convert = 7;
132 column_to_convert = 9;
134 column_to_convert = 10;
136 column_to_convert = 11;
138 column_to_convert = 12;
140 column_to_convert = 13;
142 column_to_convert = 14;
144 column_to_convert = 15;
146 column_to_convert = 16;
151 throw Exception::ParseError(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
"",
String(
"Failed to convert value in column ") +
String(column_to_convert + 1) +
" into a number (line '" +
String((it - input.
begin()) + 1) +
")");
154 feature_map.push_back(f);
166 template <
typename SpectrumType>
169 std::cerr <<
"Store() for MsInspectFile not implemented. Filename was: " << filename <<
", spec of size " << spectrum.size() <<
"\n";
static DateTime now()
Returns the current date and time.
void addMSLevel(int level)
adds a desired MS level for peaks to load
void getPrimaryMSRunPath(StringList &toFill) const
get the file path to the first MS run
void setScoreType(const String &type)
Sets the protein score type.
void setRT(double rt)
sets the RT of the MS2 spectrum where the identification occurred
void store(const String &filename, const SpectrumType &spectrum) const
Stores a featureXML as a MsInspect file.
Definition: MsInspectFile.h:167
Int getCharge() const
returns the charge of the peptide
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
A method or algorithm argument contains illegal values.
Definition: Exception.h:648
Representation of a peptide evidence.
Definition: PeptideEvidence.h:50
File adapter for MsInspect files.
Definition: MsInspectFile.h:60
static bool rename(const String &from, const String &to, bool overwrite_existing=true, bool verbose=true)
Rename a file.
void load(const String &filename, std::vector< ProteinIdentification > &poid, std::vector< PeptideIdentification > &peid)
Loads the identifications from a MzIdentML file.
This class provides some basic file handling methods for text files.
Definition: TextFile.h:46
ExitCodes
Exit codes.
Definition: TOPPBase.h:149
void setOverallQuality(QualityType q)
Set the overall quality.
static ModificationsDB * getInstance()
Returns a pointer to the modifications DB (singleton)
void setMZ(CoordinateType coordinate)
Mutable access to the m/z coordinate (index 1)
Definition: Peak2D.h:202
void setIntensity(IntensityType intensity)
Non-mutable access to the data point intensity (height)
Definition: Peak2D.h:172
Representation of a protein identification run.
Definition: ProteinIdentification.h:71
void setDateTime(const DateTime &date)
Sets the date of the protein identification run.
ConstIterator begin() const
Gives access to the underlying text buffer.
static bool addMissingRTsToPeptideIDs(std::vector< PeptideIdentification > &peptides, const String &filename, bool stop_on_error=false)
Add missing retention time values to peptide identifications based on raw data.
void load(const String &filename, FeatureMapType &feature_map)
Loads a MsInspect file into a featureXML.
Definition: MsInspectFile.h:77
void setIdentifier(const String &id)
Sets the identifier.
#define OPENMS_LOG_ERROR
Macro to be used if non-fatal error are reported (processing continues)
Definition: LogStream.h:455
double getDiffMonoMass() const
returns the diff monoisotopic mass if set
const AASequence & getSequence() const
returns the peptide sequence without trailing or following spaces
String charges
The allowed charges for the search.
Definition: ProteinIdentification.h:227
String toString() const
returns the peptide as string with modifications embedded in brackets
const String & getId() const
returns the identifier of the modification
void getAllSearchModifications(std::vector< String > &modifications) const
Collects all modifications that can be used for identification searches.
void setPrimaryMSRunPath(const StringList &s, bool raw=false)
Definition: ProteinIdentification.h:213
static const char C_TERMINAL_AA
Definition: PeptideEvidence.h:61
std::vector< String >::const_iterator ConstIterator
Non-mutable iterator.
Definition: TextFile.h:56
String substr(size_t pos=0, size_t n=npos) const
Wrapper for the STL substr() method. Returns a String object with its contents initialized to a subst...
Representation of a protein hit.
Definition: ProteinHit.h:57
void load(const String &filename, std::vector< ProteinIdentification > &proteins, std::vector< PeptideIdentification > &peptides, const String &experiment_name, const SpectrumMetaDataLookup &lookup)
Loads peptide sequences with modifications out of a PepXML file.
File adapter for MzIdentML files.
Definition: MzIdentMLFile.h:67
void setIdentifier(const String &id)
sets the identifier
PeakMassType mass_type
Mass type of the peaks.
Definition: ProteinIdentification.h:228
Iterator begin()
Definition: MSExperiment.h:157
Int getMSGFID() const
returns the MSGFPlus enzyme id
static AASequence fromString(const String &s, bool permissive=true)
create AASequence object by parsing an OpenMS string
void insertHit(const PeptideHit &hit)
Appends a peptide hit.
Base class for TOPP applications.
Definition: TOPPBase.h:144
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
void setSearchParameters(const SearchParameters &search_parameters)
Sets the search parameters.
An LC-MS feature.
Definition: Feature.h:70
ConstIterator end() const
Gives access to the underlying text buffer.
void setAAAfter(const char acid)
sets the amino acid single letter code after the sequence (subsequent amino acid in the protein)....
Not all required information provided.
Definition: Exception.h:195
double precursor_mass_tolerance
Mass tolerance of precursor ions (Dalton or ppm)
Definition: ProteinIdentification.h:234
DateTime Class.
Definition: DateTime.h:54
void setAccession(const String &accession)
sets the accession of the protein
void setMetaValue(const String &name, const DataValue &value)
Sets the DataValue corresponding to a name.
#define OPENMS_LOG_FATAL_ERROR
Macro to be used if fatal error are reported (processing stops)
Definition: LogStream.h:450
Iterator end()
Definition: MSExperiment.h:167
void getDate(UInt &month, UInt &day, UInt &year) const
Fills the arguments with the date.
void setHigherScoreBetter(bool value)
sets the peptide score orientation
void setSearchEngineVersion(const String &search_engine_version)
Sets the search engine version.
Representation of a peptide/protein sequence.
Definition: AASequence.h:113
const ResidueModification * getModification(Size index) const
Returns the modification with the given index. note: out-of-bounds check is only performed in debug m...
Search parameters of the DB search.
Definition: ProteinIdentification.h:221
const std::vector< MSSpectrum > & getSpectra() const
returns the spectrum list
Protease digestion_enzyme
The cleavage site information in details (from ProteaseDB)
Definition: ProteinIdentification.h:236
Used to load and store PepXML files.
Definition: PepXMLFile.h:62
const std::vector< PeptideHit > & getHits() const
returns the peptide hits as const
void setRT(CoordinateType coordinate)
Mutable access to the RT coordinate (index 0)
Definition: Peak2D.h:214
void setScoreType(const String &type)
sets the peptide score type
void getAllMSGFNames(std::vector< String > &all_names) const
returns all the enzyme names available for MSGFPlus
SpectrumType
Spectrum peak type.
Definition: SpectrumSettings.h:70
static const char N_TERMINAL_AA
Definition: PeptideEvidence.h:60
Not implemented exception.
Definition: Exception.h:436
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
std::vector< String > variable_modifications
Allowed variable modifications.
Definition: ProteinIdentification.h:230
bool precursor_mass_tolerance_ppm
Mass tolerance unit of precursor ions (true: ppm, false: Dalton)
Definition: ProteinIdentification.h:235
void setSearchEngine(const String &search_engine)
Sets the search engine type.
void setProteinAccession(const String &s)
set the protein accession the peptide matches to. If not available set to empty string.
void setHits(const std::vector< ProteinHit > &hits)
Sets the protein hits.
static bool exists(const String &file)
Method used to test if a file exists.
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:62
static const char UNKNOWN_AA
Definition: PeptideEvidence.h:57
QString toQString() const
Conversion to Qt QString.
String getTermSpecificityName(TermSpecificity term_spec=NUMBER_OF_TERM_SPECIFICITY) const
Returns the name of the terminal specificity.
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...
Size< TNeedle >::Type position(const PatternAuxData< TNeedle > &dh)
Definition: AhoCorasickAmbiguous.h:561
Used to load and store idXML files.
Definition: IdXMLFile.h:63
This class handles csv files. Currently only loading is implemented.
Definition: CsvFile.h:49
void getAllNames(std::vector< String > &all_names) const
returns all the enzyme names (does NOT include synonym names)
Definition: DigestionEnzymeDB.h:122
File adapter for MzML files.
Definition: MzMLFile.h:55
double getScore() const
returns the PSM score
profile data
Definition: SpectrumSettings.h:74
bool find(TFinder &finder, const Pattern< TNeedle, FuzzyAC > &me, PatternAuxData< TNeedle > &dh)
Definition: AhoCorasickAmbiguous.h:884
static ProteaseDB * getInstance()
this member function serves as a replacement of the constructor
Definition: DigestionEnzymeDB.h:69
void setCharge(const ChargeType &ch)
Set charge state.
Exception base class.
Definition: Exception.h:89
void addPeptideEvidence(const PeptideEvidence &peptide_evidence)
adds information on a peptide that is (potentially) identified by this PSM
A more convenient string class.
Definition: String.h:58
Representation of a peptide hit.
Definition: PeptideHit.h:54
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.
static String removeExtension(const String &file)
File is empty.
Definition: Exception.h:594
String db
The used database.
Definition: ProteinIdentification.h:224
void setAABefore(const char acid)
sets the amino acid single letter code before the sequence (preceding amino acid in the protein)....
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
static bool canRun(const String &java_executable, bool verbose_on_error=true)
Determine if Java is installed and reachable.
void sort()
Sorts the hits by score.
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
char getOrigin() const
Returns the origin (i.e. modified amino acid)
Representation of a modification.
Definition: ResidueModification.h:76
const DigestionEnzymeType * getEnzyme(const String &name) const
Definition: DigestionEnzymeDB.h:98
static bool readable(const String &file)
Return true if the file exists and is readable.
Base::iterator iterator
Definition: MSExperiment.h:124
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:73
void setMZ(double mz)
sets the MZ of the MS2 spectrum
Parse Error exception.
Definition: Exception.h:622
bool split(const char splitter, std::vector< String > &substrings, bool quote_protect=false) const
Splits a string into substrings using splitter as delimiter.
PeakFileOptions & getOptions()
Mutable access to the options for loading/storing.
Collection of utility functions for management of vectors.
Definition: ListUtils.h:77
static bool remove(const String &file)
Removes a file (if it exists).
static String findDatabase(const String &db_name)
std::vector< String > fixed_modifications
Used fixed modifications.
Definition: ProteinIdentification.h:229