|
OpenMS
2.6.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";
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.
Protease digestion_enzyme
The cleavage site information in details (from ProteaseDB)
Definition: ProteinIdentification.h:273
Int getCharge() const
returns the charge of the peptide
Base class for TOPP applications.
Definition: TOPPBase.h:144
ConstIterator end() const
Gives access to the underlying text buffer.
A method or algorithm argument contains illegal values.
Definition: Exception.h:648
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.
Representation of a modification.
Definition: ResidueModification.h:76
const AASequence & getSequence() const
returns the peptide sequence without trailing or following spaces
void insertHit(const PeptideHit &hit)
Appends a peptide hit.
static ProteaseDB * getInstance()
this member function serves as a replacement of the constructor
Definition: DigestionEnzymeDB.h:69
void setIdentifier(const String &id)
sets the identifier
TPP pepXML file (.pepXML)
Definition: FileTypes.h:75
void setSearchEngineVersion(const String &search_engine_version)
Sets the search engine version.
File adapter for MzML files.
Definition: MzMLFile.h:55
A more convenient string class.
Definition: String.h:59
Iterator begin()
Definition: MSExperiment.h:157
void setProteinAccession(const String &s)
set the protein accession the peptide matches to. If not available set to empty string.
const String & getId() const
returns the identifier of the modification
void setRT(double rt)
sets the RT of the MS2 spectrum where the identification occurred
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
void getAllNames(std::vector< String > &all_names) const
returns all the enzyme names (does NOT include synonym names)
Definition: DigestionEnzymeDB.h:122
This class provides some basic file handling methods for text files.
Definition: TextFile.h:46
void addMSLevel(int level)
adds a desired MS level for peaks to load
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Representation of a protein hit.
Definition: ProteinHit.h:58
Definition: ProteinIdentification.h:249
void setAABefore(const char acid)
sets the amino acid single letter code before the sequence (preceding amino acid in the protein)....
String toString() const
returns the peptide as string with modifications embedded in brackets
void getAllMSGFNames(std::vector< String > &all_names) const
returns all the enzyme names available for MSGFPlus
static bool remove(const String &file)
Removes a file (if it exists).
Representation of a protein identification run.
Definition: ProteinIdentification.h:70
profile data
Definition: SpectrumSettings.h:74
void setIntensity(IntensityType intensity)
Non-mutable access to the data point intensity (height)
Definition: Peak2D.h:172
const std::vector< PeptideHit > & getHits() const
returns the peptide hits as const
static DateTime now()
Returns the current date and time.
#define OPENMS_LOG_FATAL_ERROR
Macro to be used if fatal error are reported (processing stops)
Definition: LogStream.h:450
static ModificationsDB * getInstance()
Returns a pointer to the modifications DB (singleton)
String charges
The allowed charges for the search.
Definition: ProteinIdentification.h:264
void setAccession(const String &accession)
sets the accession of the protein
void load(const String &filename, FeatureMapType &feature_map)
Loads a MsInspect file into a featureXML.
Definition: MsInspectFile.h:77
File adapter for MzIdentML files.
Definition: MzIdentMLFile.h:67
const DigestionEnzymeType * getEnzyme(const String &name) const
Definition: DigestionEnzymeDB.h:98
static bool exists(const String &file)
Method used to test if a file exists.
void setRT(CoordinateType coordinate)
Mutable access to the RT coordinate (index 0)
Definition: Peak2D.h:214
static const char N_TERMINAL_AA
Definition: PeptideEvidence.h:60
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
void addPeptideEvidence(const PeptideEvidence &peptide_evidence)
adds information on a peptide that is (potentially) identified by this PSM
std::vector< String > variable_modifications
Allowed variable modifications.
Definition: ProteinIdentification.h:267
PeakMassType mass_type
Mass type of the peaks.
Definition: ProteinIdentification.h:265
char getOrigin() const
Returns the origin (i.e. modified amino acid)
void sort()
Sorts the hits by score.
void setPrimaryMSRunPath(const StringList &s, bool raw=false)
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...
SpectrumType
Spectrum peak type.
Definition: SpectrumSettings.h:70
Base::iterator iterator
Definition: MSExperiment.h:124
void setScoreType(const String &type)
Sets the protein score type.
String db
The used database.
Definition: ProteinIdentification.h:261
static const char UNKNOWN_AA
Definition: PeptideEvidence.h:57
double getDiffMonoMass() const
returns the diff monoisotopic mass, or 0.0 if not set
Representation of a peptide evidence.
Definition: PeptideEvidence.h:50
void setHigherScoreBetter(bool value)
sets the peptide score orientation
Exception base class.
Definition: Exception.h:89
bool split(const char splitter, std::vector< String > &substrings, bool quote_protect=false) const
Splits a string into substrings using splitter as delimiter.
void setMZ(CoordinateType coordinate)
Mutable access to the m/z coordinate (index 1)
Definition: Peak2D.h:202
void setOverallQuality(QualityType q)
Set the overall quality.
QString toQString() const
Conversion to Qt QString.
Not implemented exception.
Definition: Exception.h:436
void setSearchParameters(const SearchParameters &search_parameters)
Sets the search parameters.
void setFillData(bool only)
sets whether to fill the actual data into the container (spectrum/chromatogram)
bool find(TFinder &finder, const Pattern< TNeedle, FuzzyAC > &me, PatternAuxData< TNeedle > &dh)
Definition: AhoCorasickAmbiguous.h:884
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
std::vector< String > fixed_modifications
Used fixed modifications.
Definition: ProteinIdentification.h:266
void load(const String &filename, std::vector< ProteinIdentification > &poid, std::vector< PeptideIdentification > &peid)
Loads the identifications from a MzIdentML file.
This class handles csv files. Currently only loading is implemented.
Definition: CsvFile.h:49
static bool canRun(const String &java_executable, bool verbose_on_error=true)
Determine if Java is installed and reachable.
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:73
void setSearchEngine(const String &search_engine)
Sets the search engine type.
double precursor_mass_tolerance
Mass tolerance of precursor ions (Dalton or ppm)
Definition: ProteinIdentification.h:271
const std::string ISOTOPE_ERROR
ConstIterator begin() const
Gives access to the underlying text buffer.
#define OPENMS_LOG_ERROR
Macro to be used if non-fatal error are reported (processing continues)
Definition: LogStream.h:455
Class representing a temporary directory.
Definition: File.h:63
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:62
Parse Error exception.
Definition: Exception.h:622
Collection of utility functions for management of vectors.
Definition: ListUtils.h:77
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...
An LC-MS feature.
Definition: Feature.h:70
Iterator end()
Definition: MSExperiment.h:167
static String findDatabase(const String &db_name)
const std::vector< MSSpectrum > & getSpectra() const
returns the spectrum list
double getScore() const
returns the PSM score
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 not writable exception.
Definition: Exception.h:551
static bool readable(const String &file)
Return true if the file exists and is readable.
void getPrimaryMSRunPath(StringList &toFill) const
get the file path to the first MS run
static const char C_TERMINAL_AA
Definition: PeptideEvidence.h:61
ExitCodes
Exit codes.
Definition: TOPPBase.h:149
void getAllSearchModifications(std::vector< String > &modifications) const
Collects all modifications that can be used for identification searches.
void setDateTime(const DateTime &date)
Sets the date of the protein identification run.
Int getMSGFID() const
returns the MSGFPlus enzyme id
bool precursor_mass_tolerance_ppm
Mass tolerance unit of precursor ions (true: ppm, false: Dalton)
Definition: ProteinIdentification.h:272
Representation of a peptide/protein sequence.
Definition: AASequence.h:111
Used to load and store PepXML files.
Definition: PepXMLFile.h:63
static AASequence fromString(const String &s, bool permissive=true)
create AASequence object by parsing an OpenMS string
String getTermSpecificityName(TermSpecificity term_spec=NUMBER_OF_TERM_SPECIFICITY) const
Returns the name of the terminal specificity.
void setIdentifier(const String &id)
Sets the identifier.
File is empty.
Definition: Exception.h:594
void setHits(const std::vector< ProteinHit > &hits)
Sets the protein hits.
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
Search parameters of the DB search.
Definition: ProteinIdentification.h:258
void setMZ(double mz)
sets the MZ of the MS2 spectrum
std::vector< String >::const_iterator ConstIterator
Non-mutable iterator.
Definition: TextFile.h:56
EnzymaticDigestion::Specificity enzyme_term_specificity
The number of required cutting-rule matching termini during search (none=0, semi=1,...
Definition: ProteinIdentification.h:274
Size< TNeedle >::Type position(const PatternAuxData< TNeedle > &dh)
Definition: AhoCorasickAmbiguous.h:561
const ResidueModification * getModification(Size index) const
Returns the modification with the given index. note: out-of-bounds check is only performed in debug m...
DateTime Class.
Definition: DateTime.h:54
void setAAAfter(const char acid)
sets the amino acid single letter code after the sequence (subsequent amino acid in the protein)....
void setCharge(const ChargeType &ch)
Set charge state.
PeakFileOptions & getOptions()
Mutable access to the options for loading/storing.
static void writeParametersToMetaValues(const Param &write_this, MetaInfoInterface &write_here, const String &prefix="")
Writes all parameters to meta values.
void store(const String &filename, const SpectrumType &spectrum) const
Stores a featureXML as a MsInspect file.
Definition: MsInspectFile.h:167
void setScoreType(const String &type)
sets the peptide score type
Used to load and store idXML files.
Definition: IdXMLFile.h:63
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.
void getDate(UInt &month, UInt &day, UInt &year) const
Fills the arguments with the date.
Representation of a peptide hit.
Definition: PeptideHit.h:55