OpenMS
LayerDataChrom.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Chris Bielow $
6 // $Authors: Chris Bielow $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 
13 namespace OpenMS
14 {
16  typedef boost::shared_ptr<OSWData> OSWDataSharedPtrType;
17 
23  class OPENMS_GUI_DLLAPI LayerDataChrom : public virtual LayerDataBase
24  {
25  public:
29  LayerDataChrom(const LayerDataChrom& ld) = default;
31  LayerDataChrom& operator=(const LayerDataChrom& ld) = delete;
32 
33  std::unique_ptr<Painter2DBase> getPainter2D() const override;
34 
35  std::unique_ptr<LayerData1DBase> to1DLayer() const override;
36 
37  std::unique_ptr<LayerStoreData> storeVisibleData(const RangeAllType& visible_range, const DataFilters& layer_filters) const override;
38 
39  std::unique_ptr<LayerStoreData> storeFullData() const override;
40 
41  ProjectionData getProjection(const DIM_UNIT unit_x, const DIM_UNIT unit_y, const RangeAllType& area) const override;
42 
43  PeakIndex findHighestDataPoint(const RangeAllType& area) const override;
44 
45  void updateRanges() override
46  {
47  chromatogram_map_->updateRanges();
48  }
49 
50  RangeAllType getRange() const override
51  {
52  RangeAllType r;
53  r.assign(*chromatogram_map_);
54  return r;
55  }
56 
57  std::unique_ptr<LayerStatistics> getStats() const override;
58 
59  PointXYType peakIndexToXY(const PeakIndex& peak, const DimMapper<2>& mapper) const override;
60 
61  String getDataArrayDescription(const PeakIndex& peak_index) override;
62 
64  {
65  return chromatogram_map_->getChromatogram(idx);
66  }
67 
68 
73  {
74  chromatogram_map_ = p;
75  }
76 
79  {
80  return chromatogram_map_;
81  }
82 
85  {
86  return chromatogram_map_;
87  }
88 
91  {
92  on_disc_peaks_ = p;
93  }
94 
97  {
98  return on_disc_peaks_;
99  }
100 
102  {
103  return chrom_annotation_;
104  }
105 
107  {
108  return chrom_annotation_;
109  }
110 
113 
114  protected:
117 
120 
123  };
124 
125 } //namespace
126 
DataFilter array providing some convenience functions.
Definition: DataFilters.h:27
Class that stores the data for one layer.
Definition: LayerDataBase.h:169
Class that stores the data for one layer of type Chromatogram.
Definition: LayerDataChrom.h:24
const ExperimentType::ChromatogramType & getChromatogram(Size idx) const
Definition: LayerDataChrom.h:63
const OSWDataSharedPtrType & getChromatogramAnnotation() const
Definition: LayerDataChrom.h:106
const ExperimentSharedPtrType & getChromatogramData() const
Returns a mutable reference to the current chromatogram data.
Definition: LayerDataChrom.h:78
std::unique_ptr< LayerStatistics > getStats() const override
Compute layer statistics (via visitor)
std::unique_ptr< LayerStoreData > storeFullData() const override
Returns a visitor which contains the the full data of the layer and can write the data to disk in the...
void setOnDiscPeakData(ODExperimentSharedPtrType p)
Set the current on-disc data.
Definition: LayerDataChrom.h:90
PeakIndex findHighestDataPoint(const RangeAllType &area) const override
Find the datapoint with the highest intensity within the given range and return a proxy to that datap...
void setChromatogramAnnotation(OSWData &&data)
add annotation from an OSW sqlite file.
LayerDataChrom(const LayerDataChrom &ld)=default
Copy-ctor.
OSWDataSharedPtrType & getChromatogramAnnotation()
Definition: LayerDataChrom.h:101
std::unique_ptr< LayerData1DBase > to1DLayer() const override
Create a shallow copy (i.e. shared experimental data using shared_ptr) of the current layer,...
const ODExperimentSharedPtrType & getOnDiscPeakData() const
Returns a mutable reference to the on-disc data.
Definition: LayerDataChrom.h:96
PointXYType peakIndexToXY(const PeakIndex &peak, const DimMapper< 2 > &mapper) const override
Convert a PeakIndex to a XY coordinate (via mapper).
ProjectionData getProjection(const DIM_UNIT unit_x, const DIM_UNIT unit_y, const RangeAllType &area) const override
RangeAllType getRange() const override
Definition: LayerDataChrom.h:50
ExperimentSharedPtrType & getChromatogramData()
Returns a mutable reference to the current chromatogram data.
Definition: LayerDataChrom.h:84
LayerDataChrom & operator=(const LayerDataChrom &ld)=delete
no assignment operator (should not be needed)
std::unique_ptr< LayerStoreData > storeVisibleData(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.
OSWDataSharedPtrType chrom_annotation_
Chromatogram annotation data.
Definition: LayerDataChrom.h:122
std::unique_ptr< Painter2DBase > getPainter2D() const override
Obtain a painter which can draw the layer on a 2D canvas.
void updateRanges() override
Update ranges of the underlying data.
Definition: LayerDataChrom.h:45
LayerDataChrom()
Default constructor.
String getDataArrayDescription(const PeakIndex &peak_index) override
Get name and value of all data-arrays corresponding to the given datapoint.
void setChromData(ExperimentSharedPtrType p)
Set the current in-memory chrom data.
Definition: LayerDataChrom.h:72
The representation of a chromatogram.
Definition: MSChromatogram.h:30
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:46
Holds all or partial information from an OSW file.
Definition: OSWData.h:279
Representation of a mass spectrometry experiment on disk.
Definition: OnDiscMSExperiment.h:41
auto & assign(const RangeManager< RangeBasesOther... > &rhs)
Definition: RangeManager.h:597
A more convenient string class.
Definition: String.h:34
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
DIM_UNIT
Definition: CommonEnums.h:20
boost::shared_ptr< OSWData > OSWDataSharedPtrType
SharedPtr on OSWData.
Definition: LayerDataChrom.h:16
Result of computing a projection on X and Y axis in a 2D Canvas; see LayerDataBase::getProjection()
Definition: LayerDataBase.h:51
boost::shared_ptr< ExperimentType > ExperimentSharedPtrType
SharedPtr on MSExperiment.
Definition: LayerDataBase.h:126
boost::shared_ptr< OnDiscMSExperiment > ODExperimentSharedPtrType
SharedPtr on On-Disc MSExperiment.
Definition: LayerDataBase.h:131
boost::shared_ptr< OSWData > OSWDataSharedPtrType
SharedPtr on OSWData.
Definition: LayerDataBase.h:134
Index of a peak or feature.
Definition: PeakIndex.h:25