OpenMS
LayerDataChrom Class Reference

Class that stores the data for one layer of type Chromatogram. More...

#include <OpenMS/VISUAL/LayerDataChrom.h>

Inheritance diagram for LayerDataChrom:
[legend]
Collaboration diagram for LayerDataChrom:
[legend]

Public Member Functions

 LayerDataChrom ()
 Default constructor. More...
 
 LayerDataChrom (const LayerDataChrom &ld)=default
 Copy-ctor. More...
 
LayerDataChromoperator= (const LayerDataChrom &ld)=delete
 no assignment operator (should not be needed) More...
 
std::unique_ptr< Painter2DBasegetPainter2D () const override
 Obtain a painter which can draw the layer on a 2D canvas. More...
 
std::unique_ptr< LayerData1DBaseto1DLayer () const override
 Create a shallow copy (i.e. shared experimental data using shared_ptr) of the current layer, and make it 1D (i.e. support showing a single spec/chrom etc) More...
 
std::unique_ptr< LayerStoreDatastoreVisibleData (const RangeAllType &visible_range, const DataFilters &layer_filters) const override
 Returns a visitor which contains the current visible data and can write the data to disk. More...
 
std::unique_ptr< LayerStoreDatastoreFullData () const override
 Returns a visitor which contains the the full data of the layer and can write the data to disk in the appropriate format (e.g. mzML) More...
 
ProjectionData getProjection (const DIM_UNIT unit_x, const DIM_UNIT unit_y, const RangeAllType &area) const override
 
PeakIndex findHighestDataPoint (const RangeAllType &area) const override
 Find the datapoint with the highest intensity within the given range and return a proxy to that datapoint. More...
 
void updateRanges () override
 Update ranges of the underlying data. More...
 
RangeAllType getRange () const override
 
std::unique_ptr< LayerStatisticsgetStats () const override
 Compute layer statistics (via visitor) More...
 
PointXYType peakIndexToXY (const PeakIndex &peak, const DimMapper< 2 > &mapper) const override
 Convert a PeakIndex to a XY coordinate (via mapper). More...
 
String getDataArrayDescription (const PeakIndex &peak_index) override
 Get name and value of all data-arrays corresponding to the given datapoint. More...
 
const ExperimentType::ChromatogramTypegetChromatogram (Size idx) const
 
void setChromData (ExperimentSharedPtrType p)
 Set the current in-memory chrom data. More...
 
const ExperimentSharedPtrTypegetChromatogramData () const
 Returns a mutable reference to the current chromatogram data. More...
 
ExperimentSharedPtrTypegetChromatogramData ()
 Returns a mutable reference to the current chromatogram data. More...
 
void setOnDiscPeakData (ODExperimentSharedPtrType p)
 Set the current on-disc data. More...
 
const ODExperimentSharedPtrTypegetOnDiscPeakData () const
 Returns a mutable reference to the on-disc data. More...
 
OSWDataSharedPtrTypegetChromatogramAnnotation ()
 
const OSWDataSharedPtrTypegetChromatogramAnnotation () const
 
void setChromatogramAnnotation (OSWData &&data)
 add annotation from an OSW sqlite file. More...
 
- Public Member Functions inherited from LayerDataBase
 LayerDataBase ()=delete
 Default constructor (for virtual inheritance) More...
 
 LayerDataBase (const DataType type)
 C'tor for child classes. More...
 
 LayerDataBase (const LayerDataBase &ld)=default
 Copy-C'tor. More...
 
LayerDataBaseoperator= (const LayerDataBase &ld)=delete
 Assignment operator. More...
 
 LayerDataBase (LayerDataBase &&ld)=delete
 
LayerDataBaseoperator= (LayerDataBase &&ld)=delete
 Move assignment – deleted, by same argument as for move c'tor. More...
 
virtual ~LayerDataBase ()=default
 D'tor. More...
 
virtual PeakIndex findClosestDataPoint (const RangeAllType &) const
 Find the closest datapoint within the given range and return a proxy to that datapoint. More...
 
virtual bool annotate (const std::vector< PeptideIdentification > &identifications, const std::vector< ProteinIdentification > &protein_identifications)
 
float getMinIntensity () const
 Returns the minimum intensity of the internal data, depending on type. More...
 
float getMaxIntensity () const
 Returns the maximum intensity of the internal data, depending on type. More...
 
const StringgetName () const
 The name of the layer, usually the basename of the file. More...
 
void setName (const String &new_name)
 Set the name of the layer, usually the basename of the file. More...
 
const StringgetNameSuffix () const
 get the extra annotation to the layers name, e.g. '[39]' for which chromatogram index is currently shown in 1D More...
 
void setNameSuffix (const String &decorator)
 set an extra annotation as suffix to the layers name, e.g. '[39]' for which chromatogram index is currently shown in 1D More...
 
virtual String getDecoratedName () const
 get name augmented with attributes, e.g. '*' if modified More...
 

Protected Attributes

ExperimentSharedPtrType chromatogram_map_ = ExperimentSharedPtrType(new ExperimentType())
 chromatogram data More...
 
ODExperimentSharedPtrType on_disc_peaks_ = ODExperimentSharedPtrType(new OnDiscMSExperiment())
 on disc chrom data More...
 
OSWDataSharedPtrType chrom_annotation_
 Chromatogram annotation data. More...
 

Additional Inherited Members

- Public Types inherited from LayerDataBase
using RangeAllType = RangeManager< RangeRT, RangeMZ, RangeIntensity, RangeMobility >
 
- Public Types inherited from LayerDataDefs
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< FeatureMapFeatureMapSharedPtrType
 SharedPtr on feature map. More...
 
typedef ConsensusMap ConsensusMapType
 consensus features More...
 
typedef boost::shared_ptr< ConsensusMapConsensusMapSharedPtrType
 SharedPtr on consensus features. More...
 
typedef PeakMap ExperimentType
 Main data type (experiment) More...
 
typedef boost::shared_ptr< ExperimentTypeExperimentSharedPtrType
 SharedPtr on MSExperiment. More...
 
typedef boost::shared_ptr< const ExperimentTypeConstExperimentSharedPtrType
 
typedef boost::shared_ptr< OnDiscMSExperimentODExperimentSharedPtrType
 SharedPtr on On-Disc MSExperiment. More...
 
typedef boost::shared_ptr< OSWDataOSWDataSharedPtrType
 SharedPtr on OSWData. More...
 
- Public Attributes inherited from LayerDataBase
std::bitset< SIZE_OF_FLAGSflags
 Actual state of each flag. More...
 
bool visible = true
 if this layer is visible More...
 
DataType type = DT_UNKNOWN
 data type (peak or feature data, etc) More...
 
String filename
 file name of the file the data comes from (if available) More...
 
Param param
 Layer parameters. More...
 
MultiGradient gradient
 Gradient for 2D and 3D views. More...
 
DataFilters filters
 Filters to apply before painting. More...
 
bool modifiable = false
 Flag that indicates if the layer data can be modified (so far used for features only) More...
 
bool modified = false
 Flag that indicates that the layer data was modified since loading it. More...
 
LabelType label = L_NONE
 Label type. More...
 
int peptide_id_index = -1
 Selected peptide id and hit index (-1 if none is selected) More...
 
int peptide_hit_index = -1
 
- Static Public Attributes inherited from LayerDataDefs
static const std::string NamesOfLabelType [SIZE_OF_LABEL_TYPE]
 Label names. More...
 

Detailed Description

Class that stores the data for one layer of type Chromatogram.

Constructor & Destructor Documentation

◆ LayerDataChrom() [1/2]

Default constructor.

◆ LayerDataChrom() [2/2]

LayerDataChrom ( const LayerDataChrom ld)
default

Copy-ctor.

Member Function Documentation

◆ findHighestDataPoint()

PeakIndex findHighestDataPoint ( const RangeAllType ) const
overridevirtual

Find the datapoint with the highest intensity within the given range and return a proxy to that datapoint.

Parameters
areaRange to search in. Only dimensions used in the canvas are populated.
Returns
A proxy (e.g. scan + peak index in an MSExperiment) which points to the data

Reimplemented from LayerDataBase.

◆ getChromatogram()

const ExperimentType::ChromatogramType& getChromatogram ( Size  idx) const
inline

◆ getChromatogramAnnotation() [1/2]

OSWDataSharedPtrType& getChromatogramAnnotation ( )
inline

◆ getChromatogramAnnotation() [2/2]

const OSWDataSharedPtrType& getChromatogramAnnotation ( ) const
inline

◆ getChromatogramData() [1/2]

ExperimentSharedPtrType& getChromatogramData ( )
inline

Returns a mutable reference to the current chromatogram data.

◆ getChromatogramData() [2/2]

const ExperimentSharedPtrType& getChromatogramData ( ) const
inline

Returns a mutable reference to the current chromatogram data.

◆ getDataArrayDescription()

String getDataArrayDescription ( const PeakIndex )
overridevirtual

Get name and value of all data-arrays corresponding to the given datapoint.

Empty (or shorter) data-arrays are skipped.

Parameters
peak_indexThe datapoint
Returns
A string, e.g. "fwhm: 20, im: 3.3", depending on which float/string dataarrays are populated for the given datapoint

Reimplemented from LayerDataBase.

◆ getOnDiscPeakData()

const ODExperimentSharedPtrType& getOnDiscPeakData ( ) const
inline

Returns a mutable reference to the on-disc data.

◆ getPainter2D()

std::unique_ptr<Painter2DBase> getPainter2D ( ) const
overridevirtual

Obtain a painter which can draw the layer on a 2D canvas.

Returns
A painter

Implements LayerDataBase.

◆ getProjection()

ProjectionData getProjection ( const DIM_UNIT  unit_x,
const DIM_UNIT  unit_y,
const RangeAllType area 
) const
overridevirtual

Calculate a projection of the current layer for the given unit and the given area. E.g. the area might be restricted in RT and m/z, and then requested projection should return the XIC (unit == RT) It is up to the implementation to decide on binning.

Implements LayerDataBase.

◆ getRange()

RangeAllType getRange ( ) const
inlineoverridevirtual

Returns the data range of the whole layer (i.e. all scans/chroms/etc) in all known dimensions. If a layer does not support the dimension (or the layer is empty) the dimension will be empty If you need the data range for a 1D view (i.e. only a single spec/chrom/etc), call 'LayerDataBase1D::getRange1D()'

Implements LayerDataBase.

References RangeManager< RangeBases >::assign().

Referenced by LayerData1DChrom::getRange().

◆ getStats()

std::unique_ptr<LayerStatistics> getStats ( ) const
overridevirtual

Compute layer statistics (via visitor)

Implements LayerDataBase.

◆ operator=()

LayerDataChrom& operator= ( const LayerDataChrom ld)
delete

no assignment operator (should not be needed)

◆ peakIndexToXY()

PointXYType peakIndexToXY ( const PeakIndex peak,
const DimMapper< 2 > &  mapper 
) const
overridevirtual

Convert a PeakIndex to a XY coordinate (via mapper).

Parameters
peakThe Peak to convert
mapperConverts the internal representation (e.g. Peak1D) to an XY coordinate
Returns
XY coordinate in data units (e.g. X=m/z, Y=intensity)

Implements LayerDataBase.

◆ setChromatogramAnnotation()

void setChromatogramAnnotation ( OSWData &&  data)

add annotation from an OSW sqlite file.

◆ setChromData()

void setChromData ( ExperimentSharedPtrType  p)
inline

Set the current in-memory chrom data.

◆ setOnDiscPeakData()

void setOnDiscPeakData ( ODExperimentSharedPtrType  p)
inline

Set the current on-disc data.

◆ storeFullData()

std::unique_ptr<LayerStoreData> storeFullData ( ) const
overridevirtual

Returns a visitor which contains the the full data of the layer and can write the data to disk in the appropriate format (e.g. mzML)

Reimplemented from LayerDataBase.

◆ storeVisibleData()

std::unique_ptr<LayerStoreData> storeVisibleData ( const RangeAllType ,
const DataFilters  
) const
overridevirtual

Returns a visitor which contains the current visible data and can write the data to disk.

Reimplemented from LayerDataBase.

◆ to1DLayer()

std::unique_ptr<LayerData1DBase> to1DLayer ( ) const
overridevirtual

Create a shallow copy (i.e. shared experimental data using shared_ptr) of the current layer, and make it 1D (i.e. support showing a single spec/chrom etc)

Returns
A new layer for 1D

Implements LayerDataBase.

◆ updateRanges()

void updateRanges ( )
inlineoverridevirtual

Update ranges of the underlying data.

Implements LayerDataBase.

Referenced by LayerData1DChrom::updateRanges().

Member Data Documentation

◆ chrom_annotation_

OSWDataSharedPtrType chrom_annotation_
protected

Chromatogram annotation data.

◆ chromatogram_map_

ExperimentSharedPtrType chromatogram_map_ = ExperimentSharedPtrType(new ExperimentType())
protected

chromatogram data

◆ on_disc_peaks_

on disc chrom data