OpenMS
2.5.0
|
Class that stores the data for one layer. More...
#include <OpenMS/VISUAL/LayerData.h>
Type definitions | |
enum | DataType { DT_PEAK, DT_CHROMATOGRAM, DT_FEATURE, DT_CONSENSUS, DT_IDENT, DT_UNKNOWN } |
enum | Flags { F_HULL, F_HULLS, F_UNASSIGNED, P_PRECURSORS, P_PROJECTIONS, C_ELEMENTS, I_PEPTIDEMZ, I_LABELS, SIZE_OF_FLAGS } |
Flags that determine which information is shown. More... | |
enum | LabelType { L_NONE, L_INDEX, L_META_LABEL, L_ID, L_ID_ALL, SIZE_OF_LABEL_TYPE } |
Label used in visualization. More... | |
typedef FeatureMap | FeatureMapType |
Features. More... | |
typedef boost::shared_ptr< FeatureMap > | FeatureMapSharedPtrType |
SharedPtr on feature map. More... | |
typedef ConsensusMap | ConsensusMapType |
consensus features More... | |
typedef boost::shared_ptr< ConsensusMap > | ConsensusMapSharedPtrType |
SharedPtr on consensus features. More... | |
typedef PeakMap | ExperimentType |
Main data type (experiment) More... | |
typedef boost::shared_ptr< ExperimentType > | ExperimentSharedPtrType |
SharedPtr on MSExperiment. More... | |
typedef boost::shared_ptr< const ExperimentType > | ConstExperimentSharedPtrType |
typedef boost::shared_ptr< OnDiscMSExperiment > | ODExperimentSharedPtrType |
SharedPtr on On-Disc MSExperiment. More... | |
std::bitset< SIZE_OF_FLAGS > | flags |
Actual state of each flag. More... | |
bool | visible |
if this layer is visible More... | |
bool | flipped |
if this layer is flipped (1d mirror view) More... | |
DataType | type |
data type (peak or feature data) More... | |
String | name |
layer name More... | |
String | filename |
file name of the file the data comes from (if available) More... | |
std::vector< PeptideIdentification > | peptides |
peptide identifications More... | |
Param | param |
Layer parameters. More... | |
MultiGradient | gradient |
Gradient for 2D and 3D views. More... | |
DataFilters | filters |
Filters to apply before painting. More... | |
std::vector< Annotations1DContainer > | annotations_1d |
Annotations of all spectra of the experiment (1D view) More... | |
std::vector< QColor > | peak_colors_1d |
Peak colors of the currently shown spectrum. More... | |
bool | modifiable |
Flag that indicates if the layer data can be modified (so far used for features only) More... | |
bool | modified |
Flag that indicates that the layer data was modified since loading it. More... | |
LabelType | label |
Label type. More... | |
int | peptide_id_index |
Selected peptide id and hit index (-1 if none is selected) More... | |
int | peptide_hit_index |
static const std::string | NamesOfLabelType [SIZE_OF_LABEL_TYPE] |
Label names. More... | |
FeatureMapSharedPtrType | features |
feature data More... | |
ConsensusMapSharedPtrType | consensus |
consensus feature data More... | |
ExperimentSharedPtrType | peaks |
peak data More... | |
ODExperimentSharedPtrType | on_disc_peaks |
on disc peak data More... | |
ExperimentSharedPtrType | chromatograms |
chromatogram data More... | |
Size | current_spectrum_ |
Index of the current spectrum. More... | |
ExperimentType::SpectrumType | cached_spectrum_ |
Current cached spectrum. More... | |
LayerData () | |
Default constructor. More... | |
const FeatureMapSharedPtrType & | getFeatureMap () const |
Returns a const reference to the current feature data. More... | |
FeatureMapSharedPtrType & | getFeatureMap () |
Returns a const reference to the current feature data. More... | |
const ConsensusMapSharedPtrType & | getConsensusMap () const |
Returns a const reference to the consensus feature data. More... | |
ConsensusMapSharedPtrType & | getConsensusMap () |
Returns current consensus map (mutable) More... | |
const ConstExperimentSharedPtrType | getPeakData () const |
Returns a const reference to the current in-memory peak data. More... | |
const ExperimentSharedPtrType & | getPeakDataMuteable () |
Returns a mutable reference to the current in-memory peak data. More... | |
void | setPeakData (ExperimentSharedPtrType p) |
Set the current in-memory peak data. More... | |
void | setOnDiscPeakData (ODExperimentSharedPtrType p) |
Set the current on-disc data. More... | |
const ODExperimentSharedPtrType & | getOnDiscPeakData () const |
Returns a mutable reference to the on-disc data. More... | |
const ExperimentSharedPtrType & | getChromatogramData () const |
Returns a mutable reference to the current chromatogram data. More... | |
ExperimentSharedPtrType & | getChromatogramData () |
Returns a mutable reference to the current chromatogram data. More... | |
const Annotations1DContainer & | getCurrentAnnotations () const |
Returns a const reference to the annotations of the current spectrum (1D view) More... | |
Annotations1DContainer & | getCurrentAnnotations () |
Returns a mutable reference to the annotations of the current spectrum (1D view) More... | |
const Annotations1DContainer & | getAnnotations (Size spectrum_index) const |
Returns a const reference to the annotations of the current spectrum (1D view) More... | |
Annotations1DContainer & | getAnnotations (Size spectrum_index) |
Returns a mutable reference to the annotations of the current spectrum (1D view) More... | |
const ExperimentType::SpectrumType & | getCurrentSpectrum () const |
Returns a const reference to the current spectrum (1D view) More... | |
void | sortCurrentSpectrumByPosition () |
const ExperimentType::SpectrumType | getSpectrum (Size spectrum_idx) const |
Returns a const-copy of the required spectrum which is guaranteed to be populated with raw data. More... | |
Size | getCurrentSpectrumIndex () const |
Get the index of the current spectrum (1D view) More... | |
void | setCurrentSpectrumIndex (Size index) |
Set the index of the current spectrum (1D view) More... | |
bool | isIonMobilityData () const |
Check whether the current layer should be represented as ion mobility. More... | |
void | labelAsIonMobilityData () const |
bool | isDIAData () const |
Check whether the current layer contains DIA (SWATH-MS) data. More... | |
void | labelAsDIAData () |
Label the current layer as DIA (SWATH-MS) data. More... | |
bool | chromatogram_flag_set () const |
Check whether the current layer is a chromatogram. More... | |
void | set_chromatogram_flag () |
set the chromatogram flag More... | |
void | remove_chromatogram_flag () |
remove the chromatogram flag More... | |
void | updateRanges () |
Update ranges of all data structures. More... | |
void | synchronizePeakAnnotations () |
void | removePeakAnnotationsFromPeptideHit (const std::vector< Annotation1DItem * > &selected_annotations) |
remove peak annotations in the given list from the currently active PeptideHit More... | |
void | updateCache_ () |
Update current cached spectrum for easy retrieval. More... | |
void | updatePeptideHitAnnotations_ (PeptideHit &hit) |
updates the PeakAnnotations in the current PeptideHit with manually changed annotations More... | |
Class that stores the data for one layer.
The data for a layer can be peak data, feature data (feature, consensus), chromatogram or peptide identification data.
For 2D and 3D data, the data is generally accessible through getPeakData() while features are accessible through getFeatureMap() and getConsensusMap(). For 1D data, the current spectrum must be accessed through getCurrentSpectrum().
Peak data is stored using a shared pointer to an MSExperiment data structure as well as a shared pointer to a OnDiscMSExperiment data structure. Note that the actual data may not be in memory as this is not efficient for large files and therefore may have to be retrieved from disk on-demand.
typedef boost::shared_ptr<ConsensusMap> ConsensusMapSharedPtrType |
SharedPtr on consensus features.
typedef ConsensusMap ConsensusMapType |
consensus features
typedef boost::shared_ptr<const ExperimentType> ConstExperimentSharedPtrType |
typedef boost::shared_ptr<ExperimentType> ExperimentSharedPtrType |
SharedPtr on MSExperiment.
typedef PeakMap ExperimentType |
Main data type (experiment)
typedef boost::shared_ptr<FeatureMap > FeatureMapSharedPtrType |
SharedPtr on feature map.
typedef FeatureMap FeatureMapType |
Features.
typedef boost::shared_ptr<OnDiscMSExperiment> ODExperimentSharedPtrType |
SharedPtr on On-Disc MSExperiment.
enum DataType |
Dataset types. Order in the enum determines the order in which layer types are drawn.
Enumerator | |
---|---|
DT_PEAK | Spectrum profile or centroided data. |
DT_CHROMATOGRAM | Chromatogram data. |
DT_FEATURE | Feature data. |
DT_CONSENSUS | Consensus feature data. |
DT_IDENT | Peptide identification data. |
DT_UNKNOWN | Undefined data type indicating an error. |
enum Flags |
Flags that determine which information is shown.
enum LabelType |
Label used in visualization.
|
inline |
Default constructor.
References LayerData::annotations_1d.
|
inline |
Check whether the current layer is a chromatogram.
This is needed because type will *not* distinguish properly between chromatogram and spectra data. This is due to the fact that we store chromatograms for display in 1D in a data layer using MSSpectrum and so the layer looks like PEAK data to tools.
References LayerData::getPeakData().
Referenced by LayerData::remove_chromatogram_flag(), and TOPPViewBase::runTOPPTool_().
|
inline |
Returns a mutable reference to the annotations of the current spectrum (1D view)
References LayerData::annotations_1d.
|
inline |
Returns a const reference to the annotations of the current spectrum (1D view)
References LayerData::annotations_1d.
|
inline |
Returns a mutable reference to the current chromatogram data.
References LayerData::chromatograms.
|
inline |
Returns a mutable reference to the current chromatogram data.
References LayerData::chromatograms.
|
inline |
Returns current consensus map (mutable)
References LayerData::consensus.
|
inline |
Returns a const reference to the consensus feature data.
References LayerData::consensus.
Referenced by TOPPViewBase::annotateWithID(), TOPPViewBase::copyLayer(), TOPPViewBase::fileChanged_(), and TOPPViewBase::runTOPPTool_().
|
inline |
Returns a mutable reference to the annotations of the current spectrum (1D view)
References LayerData::annotations_1d, and LayerData::current_spectrum_.
|
inline |
Returns a const reference to the annotations of the current spectrum (1D view)
References LayerData::annotations_1d, and LayerData::current_spectrum_.
const ExperimentType::SpectrumType& getCurrentSpectrum | ( | ) | const |
Returns a const reference to the current spectrum (1D view)
Referenced by TOPPViewBase::showCurrentPeaksAsDIA(), and TOPPViewBase::showCurrentPeaksAsIonMobility().
|
inline |
Get the index of the current spectrum (1D view)
References LayerData::current_spectrum_.
Referenced by TOPPViewBase::runTOPPTool_(), and TOPPViewBase::showCurrentPeaksAsIonMobility().
|
inline |
Returns a const reference to the current feature data.
References LayerData::features.
|
inline |
Returns a const reference to the current feature data.
References LayerData::features.
Referenced by TOPPViewBase::annotateWithID(), TOPPViewBase::copyLayer(), TOPPViewBase::fileChanged_(), and TOPPViewBase::runTOPPTool_().
|
inline |
Returns a mutable reference to the on-disc data.
References LayerData::on_disc_peaks.
Referenced by TOPPViewBase::copyLayer(), TOPPViewBase::showCurrentPeaksAs2D(), and TOPPViewBase::showCurrentPeaksAsDIA().
const ConstExperimentSharedPtrType getPeakData | ( | ) | const |
Returns a const reference to the current in-memory peak data.
Referenced by TOPPViewBase::addData(), LayerData::chromatogram_flag_set(), TOPPViewBase::copyLayer(), TOPPViewBase::enhancedWorkspaceWindowChanged(), LayerData::isDIAData(), LayerData::isIonMobilityData(), TOPPViewBase::layerZoomChanged(), TOPPViewBase::runTOPPTool_(), and TOPPViewBase::showCurrentPeaksAsDIA().
|
inline |
Returns a mutable reference to the current in-memory peak data.
References LayerData::peaks.
Referenced by TOPPViewBase::annotateMS1FromMassFingerprinting_(), TOPPViewBase::annotateWithID(), TOPPViewBase::copyLayer(), TOPPViewBase::fileChanged_(), TOPPViewBase::showCurrentPeaksAs2D(), and TOPPViewBase::showCurrentPeaksAs3D().
|
inline |
Returns a const-copy of the required spectrum which is guaranteed to be populated with raw data.
References LayerData::cached_spectrum_, LayerData::current_spectrum_, LayerData::on_disc_peaks, and LayerData::peaks.
|
inline |
Check whether the current layer contains DIA (SWATH-MS) data.
References LayerData::getPeakData().
Referenced by TOPPViewBase::showCurrentPeaksAsDIA().
|
inline |
Check whether the current layer should be represented as ion mobility.
References LayerData::getPeakData().
Referenced by TOPPViewBase::showCurrentPeaksAs3D().
|
inline |
Label the current layer as DIA (SWATH-MS) data.
References LayerData::peaks.
|
inline |
References LayerData::peaks.
|
inline |
remove the chromatogram flag
References LayerData::chromatogram_flag_set(), and LayerData::peaks.
Referenced by TOPPViewBase::runTOPPTool_().
void removePeakAnnotationsFromPeptideHit | ( | const std::vector< Annotation1DItem * > & | selected_annotations | ) |
remove peak annotations in the given list from the currently active PeptideHit
|
inline |
set the chromatogram flag
References LayerData::peaks.
|
inline |
Set the index of the current spectrum (1D view)
References LayerData::current_spectrum_, and LayerData::updateCache_().
|
inline |
Set the current on-disc data.
References LayerData::on_disc_peaks.
|
inline |
Set the current in-memory peak data.
References LayerData::peaks, and LayerData::updateCache_().
|
inline |
References LayerData::cached_spectrum_, and MSSpectrum::sortByPosition().
void synchronizePeakAnnotations | ( | ) |
updates the PeakAnnotations in the current PeptideHit with manually changed annotations if no PeptideIdentification or PeptideHit for the spectrum exist, it is generated
|
private |
Update current cached spectrum for easy retrieval.
Referenced by LayerData::setCurrentSpectrumIndex(), and LayerData::setPeakData().
|
private |
updates the PeakAnnotations in the current PeptideHit with manually changed annotations
void updateRanges | ( | ) |
Update ranges of all data structures.
Updates ranges of all tracked data structures (spectra, chromatograms, features etc).
std::vector<Annotations1DContainer> annotations_1d |
Annotations of all spectra of the experiment (1D view)
Referenced by LayerData::getAnnotations(), LayerData::getCurrentAnnotations(), and LayerData::LayerData().
|
private |
Current cached spectrum.
Referenced by LayerData::getSpectrum(), and LayerData::sortCurrentSpectrumByPosition().
|
private |
chromatogram data
Referenced by LayerData::getChromatogramData().
|
private |
consensus feature data
Referenced by LayerData::getConsensusMap().
|
private |
Index of the current spectrum.
Referenced by LayerData::getCurrentAnnotations(), LayerData::getCurrentSpectrumIndex(), LayerData::getSpectrum(), and LayerData::setCurrentSpectrumIndex().
|
private |
feature data
Referenced by LayerData::getFeatureMap().
String filename |
file name of the file the data comes from (if available)
Referenced by TOPPViewBase::copyLayer(), TOPPViewBase::fileChanged_(), TOPPViewBase::getFilenamesOfOpenFiles_(), TOPPViewBase::showCurrentPeaksAs2D(), TOPPViewBase::showCurrentPeaksAs3D(), TOPPViewBase::showCurrentPeaksAsDIA(), TOPPViewBase::showCurrentPeaksAsIonMobility(), and TOPPViewBase::updateLayerBar().
DataFilters filters |
Filters to apply before painting.
Referenced by TOPPViewBase::filterContextMenu(), TOPPViewBase::filterEdit(), and TOPPViewBase::updateFilterBar().
std::bitset<SIZE_OF_FLAGS> flags |
Actual state of each flag.
bool flipped |
if this layer is flipped (1d mirror view)
Referenced by TOPPViewBase::updateLayerBar().
MultiGradient gradient |
Gradient for 2D and 3D views.
LabelType label |
Label type.
Referenced by TOPPViewBase::updateToolBar().
bool modifiable |
Flag that indicates if the layer data can be modified (so far used for features only)
bool modified |
Flag that indicates that the layer data was modified since loading it.
Referenced by TOPPViewBase::updateLayerBar().
String name |
layer name
Referenced by TOPPViewBase::addData(), TOPPViewBase::copyLayer(), TOPPViewBase::filterContextMenu(), TOPPViewBase::layerContextMenu(), TOPPViewBase::runTOPPTool_(), TOPPViewBase::showCurrentPeaksAs2D(), TOPPViewBase::showCurrentPeaksAs3D(), TOPPViewBase::showCurrentPeaksAsDIA(), TOPPViewBase::showCurrentPeaksAsIonMobility(), and TOPPViewBase::updateLayerBar().
|
static |
Label names.
Referenced by TOPPViewBase::changeLabel(), and TOPPViewBase::TOPPViewBase().
|
private |
on disc peak data
Referenced by LayerData::getOnDiscPeakData(), LayerData::getSpectrum(), and LayerData::setOnDiscPeakData().
Param param |
Layer parameters.
Referenced by TOPPViewBase::loadFiles(), and TOPPViewBase::updateLayerBar().
std::vector<QColor> peak_colors_1d |
Peak colors of the currently shown spectrum.
|
private |
int peptide_hit_index |
int peptide_id_index |
Selected peptide id and hit index (-1 if none is selected)
std::vector<PeptideIdentification> peptides |
peptide identifications
Referenced by TOPPViewBase::copyLayer().
DataType type |
data type (peak or feature data)
Referenced by TOPPViewBase::addData(), TOPPViewBase::annotateMS1FromMassFingerprinting_(), TOPPViewBase::annotateWithID(), TOPPViewBase::copyLayer(), TOPPViewBase::fileChanged_(), TOPPViewBase::layerZoomChanged(), TOPPViewBase::runTOPPTool_(), TOPPViewBase::showCurrentPeaksAs3D(), TOPPViewBase::updateLayerBar(), and TOPPViewBase::updateToolBar().
bool visible |
if this layer is visible
Referenced by TOPPViewBase::annotateWithID(), TOPPViewBase::editMetadata(), TOPPViewBase::layerVisibilityChange(), TOPPViewBase::rerunTOPPTool(), TOPPViewBase::showTOPPDialog_(), and TOPPViewBase::updateLayerBar().