35 #ifndef OPENMS_KERNEL_FEATUREMAP_H
36 #define OPENMS_KERNEL_FEATUREMAP_H
73 if (
this == &rhs)
return *
this;
94 OPENMS_DLLAPI std::ostream &
operator<<(std::ostream & os,
const AnnotationStatistics& ann);
110 template <
typename FeatureT = Feature>
112 private std::vector<FeatureT>,
125 using typename privvec::value_type;
126 using typename privvec::iterator;
127 using typename privvec::const_iterator;
128 using typename privvec::size_type;
129 using typename privvec::pointer;
130 using typename privvec::reference;
131 using typename privvec::const_reference;
132 using typename privvec::difference_type;
135 using privvec::begin;
139 using privvec::resize;
140 using privvec::empty;
141 using privvec::reserve;
142 using privvec::operator[];
146 using privvec::push_back;
147 using privvec::pop_back;
148 using privvec::erase;
153 typedef std::vector<FeatureType>
Base;
199 if (&rhs ==
this)
return *
this;
201 Base::operator=(rhs);
215 return std::operator==(*
this, rhs) &&
271 this->insert(this->end(), rhs.begin(), rhs.end());
284 LOG_INFO <<
"Replaced " << replaced_uids <<
" invalid uniqueID's\n";
301 std::sort(this->begin(), this->end(),
reverseComparator(
typename FeatureType::IntensityLess()));
305 std::sort(this->begin(), this->end(),
typename FeatureType::IntensityLess());
349 for (
Size i = 0; i < this->size(); ++i)
351 DBoundingBox<2> box = this->operator[](i).getConvexHull().getBoundingBox();
384 tmp.RangeManagerType::operator=(* this);
386 from.RangeManagerType::operator=(tmp);
468 void clear(
bool clear_meta_data =
true)
495 template <
typename Type>
498 Size assignments = 0;
499 assignments += ((*this).*member_function)();
500 for (
Iterator iter = this->begin(); iter != this->end(); ++iter)
502 assignments += iter->applyMemberFunction(member_function);
508 template <
typename Type>
511 Size assignments = 0;
512 assignments += ((*this).*member_function)();
513 for (
ConstIterator iter = this->begin(); iter != this->end(); ++iter)
515 assignments += iter->applyMemberFunction(member_function);
523 for (
ConstIterator iter = this->begin(); iter != this->end(); ++iter)
525 result += iter->getAnnotationState();
543 template <
typename FeatureType>
544 std::ostream & operator<<(std::ostream & os, const FeatureMap<FeatureType> & map)
546 os <<
"# -- DFEATUREMAP BEGIN --" <<
"\n";
547 os <<
"# POS \tINTENS\tOVALLQ\tCHARGE\tUniqueID" <<
"\n";
550 os << iter->getPosition() <<
'\t'
551 << iter->getIntensity() <<
'\t'
552 << iter->getOverallQuality() <<
'\t'
553 << iter->getCharge() <<
'\t'
554 << iter->getUniqueId() <<
"\n";
556 os <<
"# -- DFEATUREMAP END --" << std::endl;
563 #endif // OPENMS_KERNEL_DFEATUREMAP_H
Base::const_iterator ConstIterator
Definition: FeatureMap.h:155
void sortByMZ()
Sort features by m/z position.
Definition: FeatureMap.h:322
void sortByRT()
Sort features by RT position.
Definition: FeatureMap.h:316
std::vector< Size > states
Definition: FeatureMap.h:59
FeatureMap()
Default constructor.
Definition: FeatureMap.h:168
std::vector< ProteinIdentification > & getProteinIdentifications()
mutable access to the protein identifications
Definition: FeatureMap.h:416
PositionRangeType pos_range_
Position range (D-dimensional)
Definition: RangeManager.h:151
const std::vector< ProteinIdentification > & getProteinIdentifications() const
non-mutable access to the protein identifications
Definition: FeatureMap.h:410
#define LOG_INFO
Macro if a information, e.g. a status should be reported.
Definition: LogStream.h:455
AnnotationStatistics getAnnotationStatistics() const
Definition: FeatureMap.h:520
FeatureMap & operator+=(const FeatureMap &rhs)
Add one feature map to another.
Definition: FeatureMap.h:254
Compare by quality.
Definition: BaseFeature.h:108
std::vector< PeptideIdentification > & getUnassignedPeptideIdentifications()
mutable access to the unassigned peptide identifications
Definition: FeatureMap.h:434
Retention time dimension id (0 if used as a const int)
Definition: Peak2D.h:76
void swap(FeatureMap &from)
Definition: FeatureMap.h:389
A container for features.
Definition: FeatureMap.h:111
const std::vector< PeptideIdentification > & getUnassignedPeptideIdentifications() const
non-mutable access to the unassigned peptide identifications
Definition: FeatureMap.h:428
AnnotationStatistics(const AnnotationStatistics &rhs)
Definition: FeatureMap.h:66
Base::reverse_iterator ReverseIterator
Definition: FeatureMap.h:156
bool operator==(const FeatureMap &rhs) const
Equality operator.
Definition: FeatureMap.h:213
std::ostream & operator<<(std::ostream &os, const ItraqQuantifier::ItraqQuantifierStats &stats)
ReverseComparator< Cmp > reverseComparator(Cmp const &cmp)
Make-function to create a ReverseComparator from another comparator without the need to specify the t...
Definition: ComparatorUtils.h:261
Mass-to-charge dimension id (1 if used as a const int)
Definition: Peak2D.h:77
FeatureType & Reference
Definition: FeatureMap.h:158
AnnotationStatistics & operator+=(BaseFeature::AnnotationState state)
Definition: FeatureMap.h:84
Size applyMemberFunction(Size(Type::*member_function)())
Applies a member function of Type to the container itself and all features (including subordinates)...
Definition: FeatureMap.h:496
std::vector< DataProcessing > & getDataProcessing()
returns a mutable reference to the description of the applied data processing
Definition: FeatureMap.h:452
bool operator==(const RangeManager &rhs) const
Equality operator.
Definition: RangeManager.h:88
Size clearUniqueId()
Clear the unique id. The new unique id will be invalid. Returns 1 if the unique id was changed...
Definition: UniqueIdInterface.h:116
Base::const_reverse_iterator ConstReverseIterator
Definition: FeatureMap.h:157
A basic LC-MS feature.
Definition: BaseFeature.h:55
void setDataProcessing(const std::vector< DataProcessing > &processing_method)
sets the description of the applied data processing
Definition: FeatureMap.h:458
Comparator by position. Lexicographical comparison (first RT then m/z) is done.
Definition: Peak2D.h:324
const std::vector< DataProcessing > & getDataProcessing() const
returns a const reference to the description of the applied data processing
Definition: FeatureMap.h:446
const FeatureType & ConstReference
Definition: FeatureMap.h:159
RangeManager< 2 > RangeManagerType
Definition: FeatureMap.h:152
void setProteinIdentifications(const std::vector< ProteinIdentification > &protein_identifications)
sets the protein identifications
Definition: FeatureMap.h:422
bool operator==(const DocumentIdentifier &rhs) const
Equality operator.
FeatureMap & operator=(const FeatureMap &rhs)
Assignment operator.
Definition: FeatureMap.h:197
RangeManager & operator=(const RangeManager &rhs)
Assignment operator.
Definition: RangeManager.h:77
bool operator!=(const FeatureMap &rhs) const
Equality operator.
Definition: FeatureMap.h:225
FeatureMap operator+(const FeatureMap &rhs) const
Joins two feature maps.
Definition: FeatureMap.h:235
Size resolveUniqueIdConflicts()
Assign new UID's to doubly occurring UID's.
Definition: UniqueIdIndexer.h:167
std::vector< ProteinIdentification > protein_identifications_
protein identifications
Definition: FeatureMap.h:533
void clearRanges()
Resets the ranges.
Definition: RangeManager.h:140
void sortByPosition()
Sort features by position. Lexicographical comparison (first RT then m/z) is done.
Definition: FeatureMap.h:310
void updateUniqueIdToIndex() const
Updates the hash map from unique id to index.
Definition: UniqueIdIndexer.h:116
A base class for random access containers for classes derived from UniqueIdInterface that adds functi...
Definition: UniqueIdIndexer.h:63
Base::iterator Iterator
Definition: FeatureMap.h:154
FeatureMap(const FeatureMap &source)
Copy constructor.
Definition: FeatureMap.h:180
An LC-MS feature.
Definition: Feature.h:66
bool operator==(const AnnotationStatistics &rhs) const
Definition: FeatureMap.h:79
std::vector< PeptideIdentification > unassigned_peptide_identifications_
peptide identifications not matched to a specific feature
Definition: FeatureMap.h:536
A base class defining a common interface for all classes having a unique id.
Definition: UniqueIdInterface.h:51
Comparator by RT position.
Definition: Peak2D.h:272
std::vector< FeatureType > Base
Definition: FeatureMap.h:153
void swapFeaturesOnly(FeatureMap &from)
Swaps the feature content (plus its range information) of this map with the content of from...
Definition: FeatureMap.h:377
std::vector< DataProcessing > data_processing_
applied data processing
Definition: FeatureMap.h:539
PositionType const & minPosition() const
Accessor to minimum position.
Definition: DIntervalBase.h:121
void updateRanges()
Updates minimum and maximum position/intensity.
Definition: FeatureMap.h:343
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:144
AnnotationState
state of identification, use getIDState() to query it
Definition: BaseFeature.h:69
void swap(DocumentIdentifier &from)
exchange content with from
virtual ~FeatureMap()
Destructor.
Definition: FeatureMap.h:192
DocumentIdentifier()
default constructor
void swap(UniqueIdInterface &from)
Definition: UniqueIdInterface.h:128
void sortByOverallQuality(bool reverse=false)
Sort features by ascending overall quality.
Definition: FeatureMap.h:328
UniqueIdInterface & operator=(UniqueIdInterface const &rhs)
Assignment operator - copies the unique id.
Definition: UniqueIdInterface.h:89
const String & getIdentifier() const
retrieve document identifier (e.g. an LSID)
PositionType const & maxPosition() const
Accessor to maximum position.
Definition: DIntervalBase.h:127
bool operator==(UniqueIdInterface const &rhs) const
Equality comparison operator - the unique ids must be equal (!)
Definition: UniqueIdInterface.h:102
Postcondition failed exception.
Definition: Exception.h:181
Definition: FeatureMap.h:57
A D-dimensional bounding box.
Definition: DBoundingBox.h:51
Size applyMemberFunction(Size(Type::*member_function)() const) const
The "const" variant.
Definition: FeatureMap.h:509
void updateRanges_(const PeakIteratorType &begin, const PeakIteratorType &end)
Updates the range using data points in the iterator range.
Definition: RangeManager.h:155
Handles the managment of a position and intensity range.
Definition: RangeManager.h:48
AnnotationStatistics & operator=(const AnnotationStatistics &rhs)
Definition: FeatureMap.h:71
bool isEmpty() const
Test if bounding box is empty.
Definition: DBoundingBox.h:192
DocumentIdentifier & operator=(const DocumentIdentifier &source)
Assignment operator.
void sortByIntensity(bool reverse=false)
Sorts the peaks according to ascending intensity.
Definition: FeatureMap.h:297
Comparator by m/z position.
Definition: Peak2D.h:298
void clear(bool clear_meta_data=true)
Clears all data and meta data.
Definition: FeatureMap.h:468
Manage source document information.
Definition: DocumentIdentifier.h:56
std::vector< FeatureT > privvec
Definition: FeatureMap.h:122
void setUnassignedPeptideIdentifications(const std::vector< PeptideIdentification > &unassigned_peptide_identifications)
sets the unassigned peptide identifications
Definition: FeatureMap.h:440
FeatureT FeatureType
Definition: FeatureMap.h:151
AnnotationStatistics()
Definition: FeatureMap.h:61