|
OpenMS
2.5.0
|
Go to the documentation of this file.
53 typedef std::vector<String>::iterator
Iterator;
80 TextFile(
const String& filename,
bool trim_lines =
false,
Int first_n = -1,
bool skip_empty_lines =
false);
92 void load(
const String& filename,
bool trim_lines =
false,
Int first_n = -1,
bool skip_empty_lines =
false);
101 void store(
const String& filename);
104 template <
typename StringType>
107 buffer_.push_back(static_cast<String>(
string));
111 template <
typename StringType>
114 buffer_.push_back(static_cast<String>(line));
123 static std::istream& getLine(std::istream& is, std::string& t);
128 ConstIterator begin()
const;
134 ConstIterator end()
const;
static DateTime now()
Returns the current date and time.
const std::vector< PeptideIdentification > & getUnassignedPeptideIdentifications() const
non-mutable access to the unassigned peptide identifications
UInt getRank() const
returns the PSM rank
Stream class for writing to comma/tab/...-separated values files.
Definition: SVOutStream.h:54
double getScore() const
returns the score of the protein hit
std::vector< String >::const_reverse_iterator ConstReverseIterator
Non-mutable reverse iterator.
Definition: TextFile.h:60
This class provides Input/Output functionality for feature maps.
Definition: FeatureXMLFile.h:68
const DateTime & getDateTime() const
Returns the date of the protein identification run.
void sortByQuality(bool reverse=false)
Sorts the peaks according to ascending quality.
const String & getScoreType() const
Returns the protein score type.
WidthType getWidth() const
Non-mutable access to the features width (full width at half max, FWHM)
Int getCharge() const
returns the charge of the peptide
double getCoverage() const
returns the coverage (in percent) of the protein hit based upon matched peptides
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
OpenMS identification format (.idXML)
Definition: FileTypes.h:66
OpenMS consensus map format (.consensusXML)
Definition: FileTypes.h:67
This class provides some basic file handling methods for text files.
Definition: TextFile.h:46
void sortByMZ()
Sorts the peaks to m/z position.
static String concatenate(const std::vector< T > &container, const String &glue="")
Concatenates all elements of the container and puts the glue string between elements.
Definition: ListUtils.h:193
const String & getScoreType() const
returns the peptide score type
const std::vector< MSChromatogram > & getChromatograms() const
returns the chromatogram list
std::vector< String >::reverse_iterator ReverseIterator
Mutable reverse iterator.
Definition: TextFile.h:58
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
void sortByIntensity(bool reverse=false)
Sorts the peaks according to ascending intensity.
const String & getAccession() const
returns the accession of the protein
const String & getIdentifier() const
returns the identifier
Representation of a protein identification run.
Definition: ProteinIdentification.h:71
void load(const String &filename, FeatureMap &feature_map)
loads the file with name filename into map and calls updateRanges().
bool metaValueExists(const String &name) const
Returns whether an entry with the given name exists.
void sortBySize()
Sorts with respect to the size (number of elements)
void sortByRT()
Sorts the peaks to RT position.
CoordinateType getMZ() const
Returns the m/z coordinate (index 1)
Definition: Peak2D.h:196
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...
double CoordinateType
Coordinate type (of the position)
Definition: Peak2D.h:64
const AASequence & getSequence() const
returns the peptide sequence without trailing or following spaces
String db_version
The database version.
Definition: ProteinIdentification.h:225
String charges
The allowed charges for the search.
Definition: ProteinIdentification.h:227
void load(const String &filename, std::vector< ProteinIdentification > &protein_ids, std::vector< PeptideIdentification > &peptide_ids)
Loads the identifications of an idXML file without identifier.
void setWidth(WidthType width)
Sets the width (FWHM)
void sortByPosition()
Lexicographically sorts the peaks by their position (First RT then m/z).
UInt getRank() const
returns the rank of the protein hit
WidthType getWidth() const
Returns the width (FWHM)
const String & getIdentifier() const
Returns the identifier.
ChargeType getCharge() const
Returns the charge.
Exception indicating that an invalid parameter was handed over to an algorithm.
Definition: Exception.h:347
Definition: ProteinIdentification.h:213
A container for features.
Definition: FeatureMap.h:95
std::vector< String >::const_iterator ConstIterator
Non-mutable iterator.
Definition: TextFile.h:56
Representation of a protein hit.
Definition: ProteinHit.h:57
MzML file (.mzML)
Definition: FileTypes.h:72
Base::const_iterator const_iterator
Definition: MSExperiment.h:125
static String typeToName(Type type)
Returns the name/extension of the type.
TextFile & operator<<(const StringType &string)
Operator for appending entries with less code.
Definition: TextFile.h:105
PeakMassType mass_type
Mass type of the peaks.
Definition: ProteinIdentification.h:228
CoordinateType getRT() const
Returns the RT coordinate (index 0)
Definition: Peak2D.h:208
Base class for TOPP applications.
Definition: TOPPBase.h:144
Unable to create file exception.
Definition: Exception.h:636
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
This class provides Input functionality for ConsensusMaps and Output functionality for alignments and...
Definition: ConsensusXMLFile.h:61
const std::vector< ProteinIdentification > & getProteinIdentifications() const
non-mutable access to the protein identifications
An LC-MS feature.
Definition: Feature.h:70
bool modifyStrings(bool modify)
Switch modification of strings (quoting/replacing of separators) on/off.
double precursor_mass_tolerance
Mass tolerance of precursor ions (Dalton or ppm)
Definition: ProteinIdentification.h:234
std::ifstream infile
Questionable file tested by TEST_FILE_EQUAL.
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSChromatogram.h:93
Unknown file extension.
Definition: FileTypes.h:60
static T_Out findCommonMetaKeys(const typename T_In::const_iterator &it_start, const typename T_In::const_iterator &it_end, float min_frequency)
Find keys in a collection of MetaInfoInterface objects which reach a certain frequency threshold.
Definition: MetaInfoInterfaceUtils.h:74
std::vector< String > accessions
Accessions of (indistinguishable) proteins that belong to the same group.
Definition: ProteinIdentification.h:98
std::vector< String >::iterator Iterator
Mutable iterator.
Definition: TextFile.h:54
String getName() const
returns the name of the enzyme
Search parameters of the DB search.
Definition: ProteinIdentification.h:221
const std::vector< MSSpectrum > & getSpectra() const
returns the spectrum list
A consensus feature spanning multiple LC-MS/MS experiments.
Definition: ConsensusFeature.h:69
static MetaInfoRegistry & metaRegistry()
Returns a reference to the MetaInfoRegistry.
Protease digestion_enzyme
The cleavage site information in details (from ProteaseDB)
Definition: ProteinIdentification.h:236
Definition: SVOutStream.h:45
const ColumnHeaders & getColumnHeaders() const
Non-mutable access to the file descriptions.
SVOutStream & write(const String &str)
Unformatted output (no quoting: useful for comments, but use only on a line of its own!...
const std::vector< PeptideHit > & getHits() const
returns the peptide hits as const
A container for consensus elements.
Definition: ConsensusMap.h:79
std::vector< String > buffer_
Internal buffer storing the lines before writing them to the file.
Definition: TextFile.h:140
const SearchParameters & getSearchParameters() const
Returns the search parameters.
void setRT(CoordinateType coordinate)
Mutable access to the RT coordinate (index 0)
Definition: Peak2D.h:214
static FileTypes::Type getType(const String &filename)
Tries to determine the file type (by name or content)
const String & getSearchEngineVersion() const
Returns the search engine version.
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
std::vector< String > variable_modifications
Allowed variable modifications.
Definition: ProteinIdentification.h:230
Bundles multiple (e.g. indistinguishable) proteins in a group.
Definition: ProteinIdentification.h:81
void sortByMaps()
Sorts with respect to the sets of maps covered by the consensus features (lexicographically).
No progress logging.
Definition: ProgressLogger.h:74
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
void addLine(const StringType &line)
Definition: TextFile.h:112
OpenMS feature file (.featureXML)
Definition: FileTypes.h:65
void load(const String &filename, ConsensusMap &map)
Loads a consensus map from file and calls updateRanges.
double getMZ() const
returns the MZ of the MS2 spectrum
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:62
IntensityType getIntensity() const
Definition: Peak2D.h:166
Type
Actual file types enum.
Definition: FileTypes.h:58
static const char UNKNOWN_AA
Definition: PeptideEvidence.h:57
const std::vector< ProteinHit > & getHits() const
Returns the protein hits.
Used to load and store idXML files.
Definition: IdXMLFile.h:63
double fragment_mass_tolerance
Mass tolerance of fragment ions (Dalton or ppm)
Definition: ProteinIdentification.h:232
bool hasRT() const
shortcut for isnan(getRT())
A basic LC-MS feature.
Definition: BaseFeature.h:56
double probability
Probability of this group.
Definition: ProteinIdentification.h:95
double getScore() const
returns the PSM score
String taxonomy
The taxonomy restriction.
Definition: ProteinIdentification.h:226
bool loadExperiment(const String &filename, MSExperiment &exp, FileTypes::Type force_type=FileTypes::UNKNOWN, ProgressLogger::LogType log=ProgressLogger::NONE, const bool rewrite_source_file=true, const bool compute_hash=true)
Loads a file into an MSExperiment.
A more convenient string class.
Definition: String.h:58
Representation of a peptide hit.
Definition: PeptideHit.h:54
double getRT() const
returns the RT of the MS2 spectrum where the identification occurred
QuotingMethod
How to handle embedded quotes when quoting strings.
Definition: String.h:81
SVOutStream & writeValueOrNan(NumericT thing)
Write a numeric value or "nan"/"inf"/"-inf", if applicable (would not be needed for Linux)
Definition: SVOutStream.h:171
Representation of a Peak2D, RichPeak2D or Feature .
Definition: FeatureHandle.h:57
const ChargeType & getCharge() const
Non-mutable access to charge state.
UInt missed_cleavages
The number of allowed missed cleavages.
Definition: ProteinIdentification.h:231
HandleSetType::const_iterator const_iterator
Definition: ConsensusFeature.h:76
String db
The used database.
Definition: ProteinIdentification.h:224
String getDescription() const
returns the description of the protein
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
const std::vector< ProteinIdentification > & getProteinIdentifications() const
non-mutable access to the protein identifications
void setCharge(ChargeType charge)
Sets the charge.
void get(UInt &month, UInt &day, UInt &year, UInt &hour, UInt &minute, UInt &second) const
Fills the arguments with the date and the time.
Facilitates file handling by file type recognition.
Definition: FileHandler.h:62
bool isHigherScoreBetter() const
Returns true if a higher score represents a better score.
const std::vector< PeptideIdentification > & getUnassignedPeptideIdentifications() const
non-mutable access to the unassigned peptide identifications
QualityType getQuality() const
Non-mutable access to the overall quality.
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:73
bool hasMZ() const
shortcut for isnan(getRT())
const String & getSequence() const
returns the protein sequence
Definition: ChromatogramSettings.h:74
const std::vector< PeptideEvidence > & getPeptideEvidences() const
returns information on peptides (potentially) identified by this PSM
std::vector< String > fixed_modifications
Used fixed modifications.
Definition: ProteinIdentification.h:229