 |
OpenMS
3.0.0
|
|
Go to the documentation of this file.
75 template <
typename FeatureMapType>
76 void load(
const String& filename, FeatureMapType& feature_map)
85 bool first_line =
true;
91 if (line.empty() || line[0] ==
'#')
continue;
101 std::vector<String> parts;
102 line.
split(
'\t', parts);
104 if (parts.size() < 18)
106 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()) +
")");
111 Size column_to_convert = 0;
114 column_to_convert = 1;
116 column_to_convert = 2;
118 column_to_convert = 5;
120 column_to_convert = 6;
122 column_to_convert = 8;
125 column_to_convert = 3;
127 column_to_convert = 4;
129 column_to_convert = 7;
131 column_to_convert = 9;
133 column_to_convert = 10;
135 column_to_convert = 11;
137 column_to_convert = 12;
139 column_to_convert = 13;
141 column_to_convert = 14;
143 column_to_convert = 15;
145 column_to_convert = 16;
150 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) +
")");
153 feature_map.push_back(f);
165 template <
typename SpectrumType>
168 std::cerr <<
"Store() for MsInspectFile not implemented. Filename was: " << filename <<
", spec of size " << spectrum.size() <<
"\n";
File adapter for MsInspect files.
Definition: MsInspectFile.h:59
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
static Int toInt(const String &this_s)
Definition: StringUtils.h:206
ConstIterator end() const
Gives access to the underlying text buffer.
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 on an amino acid residue.
Definition: ResidueModification.h:78
const AASequence & getSequence() const
returns the peptide sequence without trailing or following spaces
void insertHit(const PeptideHit &hit)
Appends a peptide hit.
static InstanceType * getInstance()
this member function serves as a replacement of the constructor
Definition: DigestionEnzymeDB.h:69
void setIdentifier(const String &id)
sets the identifier which links this PI to its corresponding ProteinIdentification
static QString toQString(const String &this_s)
Definition: StringUtils.h:201
TPP pepXML file (.pepXML)
Definition: FileTypes.h:73
void setSearchEngineVersion(const String &search_engine_version)
Sets the search engine version.
File adapter for MzML files.
Definition: MzMLFile.h:57
A more convenient string class.
Definition: String.h:58
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 run.
Definition: MSExperiment.h:70
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
The modification can only be N-terminal on the peptide.
Definition: ResidueModification.h:101
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
static bool remove(const String &file)
Removes a file (if it exists).
The modification can only be protein C-terminal (on a C-terminal peptide)
Definition: ResidueModification.h:102
Representation of a protein identification run.
Definition: ProteinIdentification.h:70
void setIntensity(IntensityType intensity)
Sets 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:76
File adapter for MzIdentML files.
Definition: MzIdentMLFile.h:67
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:47
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...
The modification can only be C-terminal on the peptide.
Definition: ResidueModification.h:100
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
The modification can only be protein N-terminal (on a N-terminal peptide)
Definition: ResidueModification.h:103
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.
Definition: MSNumpress.h:78
QString toQString() const
Conversion to Qt QString.
Not implemented exception.
Definition: Exception.h:428
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)
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
Base class for Search Engine Adapters.
Definition: SearchEngineBase.h:54
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:71
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
Definition: Constants.h:327
ConstIterator begin() const
Gives access to the underlying text buffer.
static double toDouble(const String &this_s)
Definition: StringUtils.h:216
#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:64
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:63
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
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:537
Refreshes the protein references for all peptide hits in a vector of PeptideIdentifications and adds ...
Definition: PeptideIndexing.h:113
void getPrimaryMSRunPath(StringList &toFill) const
get the file path to the first MS run
static const char C_TERMINAL_AA
Definition: PeptideEvidence.h:61
boost::container::flat_map< const ResidueModification *, const Residue * > val
Definition: ModifiedPeptideGenerator.h:58
static String number(double d, UInt n)
Definition: StringUtils.h:196
ExitCodes
Exit codes.
Definition: TOPPBase.h:152
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.
Definition: ModifiedPeptideGenerator.h:58
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.
static String substr(const String &this_s, size_t pos, size_t n)
Definition: StringUtilsSimple.h:213
static MapToResidueType getModifications(const StringList &modNames)
Retrieve modifications from strings.
void setIdentifier(const String &id)
Sets the identifier.
void setHits(const std::vector< ProteinHit > &hits)
Sets the protein hits.
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
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
static void writeParametersToMetaValues(const Param &write_this, MetaInfoInterface &write_here, const String &key_prefix="")
Writes all parameters to meta values.
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:58
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.
void store(const String &filename, const SpectrumType &spectrum) const
Stores a featureXML as a MsInspect file.
Definition: MsInspectFile.h:166
void setScoreType(const String &type)
sets the peptide score type
Used to load and store idXML files.
Definition: IdXMLFile.h:68
void setScore(double score)
sets the PSM score
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