38 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
54 #include <boost/shared_ptr.hpp>
64 class OnDiscMSExperiment;
141 static const std::string NamesOfLabelType[SIZE_OF_LABEL_TYPE];
200 return consensus_map_;
206 return consensus_map_;
249 return on_disc_peaks;
255 return chromatogram_map_;
261 return chromatogram_map_;
278 bool annotate(
const std::vector<PeptideIdentification>& identifications,
279 const std::vector<ProteinIdentification>& protein_identifications);
285 return annotations_1d[current_spectrum_idx_];
291 return annotations_1d[current_spectrum_idx_];
297 return annotations_1d[spectrum_index];
303 return annotations_1d[spectrum_index];
315 cached_spectrum_.sortByPosition();
324 return current_spectrum_idx_;
330 current_spectrum_idx_ = index;
341 getChromatogramData().get()->getNrChromatograms() == 0
342 ? getPeakDataMuteable() : getChromatogramData());
349 return this->getPeakData()->size() > 0 &&
350 this->getPeakData()->metaValueExists(
"is_ion_mobility") &&
351 this->getPeakData()->getMetaValue(
"is_ion_mobility").toBool();
356 peak_map_->setMetaValue(
"is_ion_mobility",
"true");
362 return this->getPeakData()->size() > 0 &&
363 this->getPeakData()->metaValueExists(
"is_dia_data") &&
364 this->getPeakData()->getMetaValue(
"is_dia_data").toBool();
370 peak_map_->setMetaValue(
"is_dia_data",
"true");
383 return this->getPeakData()->size() > 0 &&
384 this->getPeakData()->metaValueExists(
"is_chromatogram") &&
385 this->getPeakData()->getMetaValue(
"is_chromatogram").toBool();
391 peak_map_->setMetaValue(
"is_chromatogram",
"true");
397 if (this->chromatogram_flag_set())
399 peak_map_->removeMetaValue(
"is_chromatogram");
567 "Select peptide identification data", gui_lock)
584 "Select AccurateMassSearch's featureXML file", gui_lock)
601 "Select OpenSwath/pyProphet output file", gui_lock)
Container for annotations to content of Plot1DCanvas.
Definition: Annotations1DContainer.h:55
A container for consensus elements.
Definition: ConsensusMap.h:88
DataFilter array providing some convenience functions.
Definition: DataFilters.h:51
A container for features.
Definition: FeatureMap.h:105
holds a vector of known file types, e.g. as a way to specify supported input formats
Definition: FileTypes.h:134
Definition: LayerData.h:580
virtual bool annotateWorker_(LayerData &layer, const String &filename, LogWindow &log) const
LayerAnnotatorAMS(QWidget *gui_lock)
Definition: LayerData.h:582
Definition: LayerData.h:519
QWidget * gui_lock_
optional widget which will be locked when calling annotateWorker_() in child-classes
Definition: LayerData.h:556
const FileTypes::FileTypeList supported_types_
Definition: LayerData.h:554
static std::unique_ptr< LayerAnnotatorBase > getAnnotatorWhichSupports(const FileTypes::Type &type)
bool annotateWithFileDialog(LayerData &layer, LogWindow &log, const String ¤t_path) const
virtual bool annotateWorker_(LayerData &layer, const String &filename, LogWindow &log) const =0
bool annotateWithFilename(LayerData &layer, LogWindow &log, const String &filename) const
LayerAnnotatorBase(const FileTypes::FileTypeList &supported_types, const String &file_dialog_text, QWidget *gui_lock)
C'tor with params.
static std::unique_ptr< LayerAnnotatorBase > getAnnotatorWhichSupports(const String &filename)
see getAnnotatorWhichSupports(const FileTypes::Type& type). Filetype is queried from filename
const String file_dialog_text_
Definition: LayerData.h:555
Definition: LayerData.h:597
LayerAnnotatorOSW(QWidget *gui_lock)
Definition: LayerData.h:599
virtual bool annotateWorker_(LayerData &layer, const String &filename, LogWindow &log) const
Definition: LayerData.h:563
virtual bool annotateWorker_(LayerData &layer, const String &filename, LogWindow &log) const
LayerAnnotatorPeptideID(QWidget *gui_lock)
Definition: LayerData.h:565
Class that stores the data for one layer.
Definition: LayerData.h:96
void remove_chromatogram_flag()
remove the chromatogram flag
Definition: LayerData.h:395
boost::shared_ptr< ExperimentType > ExperimentSharedPtrType
SharedPtr on MSExperiment.
Definition: LayerData.h:159
const OSWDataSharedPtrType & getChromatogramAnnotation() const
const Annotations1DContainer & getAnnotations(Size spectrum_index) const
Returns a const reference to the annotations of the current spectrum (1D view)
Definition: LayerData.h:295
const ExperimentSharedPtrType & getChromatogramData() const
Returns a mutable reference to the current chromatogram data.
Definition: LayerData.h:253
PeakMap ExperimentType
Main data type (experiment)
Definition: LayerData.h:156
boost::shared_ptr< OnDiscMSExperiment > ODExperimentSharedPtrType
SharedPtr on On-Disc MSExperiment.
Definition: LayerData.h:164
LayerData & operator=(const LayerData &ld)=delete
no assignment operator (should not be needed)
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.
Size getCurrentSpectrumIndex() const
Get the index of the current spectrum (1D view)
Definition: LayerData.h:322
bool annotate(const std::vector< PeptideIdentification > &identifications, const std::vector< ProteinIdentification > &protein_identifications)
LabelType
Label used in visualization.
Definition: LayerData.h:131
@ L_ID_ALL
All peptide hits of the first identification run are used.
Definition: LayerData.h:136
@ L_ID
The best peptide hit of the first identification run is used.
Definition: LayerData.h:135
@ L_NONE
No label is displayed.
Definition: LayerData.h:132
@ L_META_LABEL
The 'label' meta information is used.
Definition: LayerData.h:134
@ L_INDEX
The element number is used.
Definition: LayerData.h:133
float getMaxIntensity() const
Returns the maximum intensity of the internal data, depending on type.
float getMinIntensity() const
Returns the minimum intensity of the internal data, depending on type.
void setCurrentSpectrumIndex(Size index)
Set the index of the current spectrum (1D view)
Definition: LayerData.h:328
bool isDIAData() const
Check whether the current layer contains DIA (SWATH-MS) data.
Definition: LayerData.h:360
void set_chromatogram_flag()
set the chromatogram flag
Definition: LayerData.h:389
std::vector< PeptideIdentification > peptides
peptide identifications
Definition: LayerData.h:451
std::vector< Annotations1DContainer > annotations_1d
Annotations of all spectra of the experiment (1D view)
Definition: LayerData.h:463
String name_
layer name
Definition: LayerData.h:435
ExperimentSharedPtrType peak_map_
peak data
Definition: LayerData.h:498
void setOnDiscPeakData(ODExperimentSharedPtrType p)
Set the current on-disc data.
Definition: LayerData.h:241
bool modified
Flag that indicates that the layer data was modified since loading it.
Definition: LayerData.h:472
void removePeakAnnotationsFromPeptideHit(const std::vector< Annotation1DItem * > &selected_annotations)
remove peak annotations in the given list from the currently active PeptideHit
const ConstExperimentSharedPtrType getPeakData() const
Returns a const reference to the current in-memory peak data.
bool isIonMobilityData() const
Check whether the current layer should be represented as ion mobility.
Definition: LayerData.h:347
void setChromatogramAnnotation(OSWData &&data)
add annotation from an OSW sqlite file.
ConsensusMap ConsensusMapType
consensus features
Definition: LayerData.h:150
const FeatureMapSharedPtrType & getFeatureMap() const
Returns a const reference to the current feature data.
Definition: LayerData.h:186
OSWDataSharedPtrType & getChromatogramAnnotation()
DataFilters filters
Filters to apply before painting.
Definition: LayerData.h:460
const ExperimentSharedPtrType & getPeakDataMuteable()
Returns a mutable reference to the current in-memory peak data.
Definition: LayerData.h:229
bool chromatogram_flag_set() const
Check whether the current layer is a chromatogram.
Definition: LayerData.h:381
void setPeakData(ExperimentSharedPtrType p)
Set the current in-memory peak data.
Definition: LayerData.h:234
ExperimentSharedPtrType chromatogram_map_
chromatogram data
Definition: LayerData.h:504
FeatureMapSharedPtrType features_
feature data
Definition: LayerData.h:492
ODExperimentSharedPtrType on_disc_peaks
on disc peak data
Definition: LayerData.h:501
LayerData(LayerData &&ld)=default
move Ctor
const ODExperimentSharedPtrType & getOnDiscPeakData() const
Returns a mutable reference to the on-disc data.
Definition: LayerData.h:247
Size current_spectrum_idx_
Index of the current spectrum.
Definition: LayerData.h:510
void labelAsIonMobilityData() const
Definition: LayerData.h:354
const ConsensusMapSharedPtrType & getConsensusMap() const
Returns a const reference to the consensus feature data.
Definition: LayerData.h:198
void sortCurrentSpectrumByPosition()
Definition: LayerData.h:313
ConsensusMapSharedPtrType consensus_map_
consensus feature data
Definition: LayerData.h:495
FeatureMapSharedPtrType & getFeatureMap()
Returns a const reference to the current feature data.
Definition: LayerData.h:192
void synchronizePeakAnnotations()
bool modifiable
Flag that indicates if the layer data can be modified (so far used for features only)
Definition: LayerData.h:469
std::bitset< SIZE_OF_FLAGS > flags
Actual state of each flag.
Definition: LayerData.h:127
boost::shared_ptr< const ExperimentType > ConstExperimentSharedPtrType
Definition: LayerData.h:161
boost::shared_ptr< ConsensusMap > ConsensusMapSharedPtrType
SharedPtr on consensus features.
Definition: LayerData.h:153
ExperimentSharedPtrType & getChromatogramData()
Returns a mutable reference to the current chromatogram data.
Definition: LayerData.h:259
void updatePeptideHitAnnotations_(PeptideHit &hit)
updates the PeakAnnotations in the current PeptideHit with manually changed annotations
bool visible
if this layer is visible
Definition: LayerData.h:425
Flags
Flags that determine which information is shown.
Definition: LayerData.h:114
@ I_PEPTIDEMZ
Identifications: m/z source.
Definition: LayerData.h:121
@ F_HULL
Features: Overall convex hull.
Definition: LayerData.h:115
@ F_UNASSIGNED
Features: Unassigned peptide hits.
Definition: LayerData.h:117
@ P_PRECURSORS
Peaks: Mark precursor peaks of MS/MS scans.
Definition: LayerData.h:118
@ I_LABELS
Identifications: Show labels (not sequences)
Definition: LayerData.h:122
@ P_PROJECTIONS
Peaks: Show projections.
Definition: LayerData.h:119
@ C_ELEMENTS
Consensus features: Show elements.
Definition: LayerData.h:120
@ F_HULLS
Features: Convex hulls of single mass traces.
Definition: LayerData.h:116
LayerData(const LayerData &ld)=delete
no Copy-ctor (should not be needed)
LayerData()
Default constructor.
const String & getName() const
Definition: LayerData.h:438
LabelType label
Label type.
Definition: LayerData.h:475
void updateCache_()
Update current cached spectrum for easy retrieval.
DataType type
data type (peak or feature data)
Definition: LayerData.h:431
Annotations1DContainer & getCurrentAnnotations()
Returns a mutable reference to the annotations of the current spectrum (1D view)
Definition: LayerData.h:289
ConsensusMapSharedPtrType & getConsensusMap()
Returns current consensus map (mutable)
Definition: LayerData.h:204
OSWDataSharedPtrType chrom_annotation_
Chromatogram annotation data.
Definition: LayerData.h:507
const Annotations1DContainer & getCurrentAnnotations() const
Returns a const reference to the annotations of the current spectrum (1D view)
Definition: LayerData.h:283
MultiGradient gradient
Gradient for 2D and 3D views.
Definition: LayerData.h:457
Param param
Layer parameters.
Definition: LayerData.h:454
LayerData & operator=(LayerData &&ld)=default
move assignment
DataType
Definition: LayerData.h:103
@ DT_FEATURE
Feature data.
Definition: LayerData.h:106
@ DT_PEAK
Spectrum profile or centroided data.
Definition: LayerData.h:104
@ DT_CONSENSUS
Consensus feature data.
Definition: LayerData.h:107
@ DT_CHROMATOGRAM
Chromatogram data.
Definition: LayerData.h:105
@ DT_IDENT
Peptide identification data.
Definition: LayerData.h:108
ExperimentSharedPtrType getFullChromData()
Definition: LayerData.h:338
FeatureMap FeatureMapType
Features.
Definition: LayerData.h:144
void updateRanges()
Update ranges of all data structures.
String filename
file name of the file the data comes from (if available)
Definition: LayerData.h:448
boost::shared_ptr< OSWData > OSWDataSharedPtrType
SharedPtr on OSWData.
Definition: LayerData.h:167
ExperimentType::SpectrumType cached_spectrum_
Current cached spectrum.
Definition: LayerData.h:513
boost::shared_ptr< FeatureMap > FeatureMapSharedPtrType
SharedPtr on feature map.
Definition: LayerData.h:147
int peptide_hit_index
Definition: LayerData.h:479
const ExperimentType::SpectrumType & getCurrentSpectrum() const
Returns a const reference to the current spectrum (1D view)
void setName(const String &new_name)
Definition: LayerData.h:442
String getDecoratedName() const
get name augmented with attributes, e.g. [flipped], or '*' if modified
void labelAsDIAData()
Label the current layer as DIA (SWATH-MS) data.
Definition: LayerData.h:368
bool flipped
if this layer is flipped (1d mirror view)
Definition: LayerData.h:428
Annotations1DContainer & getAnnotations(Size spectrum_index)
Returns a mutable reference to the annotations of the current spectrum (1D view)
Definition: LayerData.h:301
std::vector< QColor > peak_colors_1d
Peak colors of the currently shown spectrum.
Definition: LayerData.h:466
int peptide_id_index
Selected peptide id and hit index (-1 if none is selected)
Definition: LayerData.h:478
A log window (QTextEdit) with convenience functions.
Definition: LogWindow.h:55
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:80
The representation of a 1D spectrum.
Definition: MSSpectrum.h:71
A gradient of multiple colors and arbitrary distances between colors.
Definition: MultiGradient.h:68
Holds all or partial information from an OSW file.
Definition: OSWData.h:305
Management and storage of parameters / INI files.
Definition: Param.h:70
Representation of a peptide hit.
Definition: PeptideHit.h:57
A more convenient string class.
Definition: String.h:61
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
const FileTypes::FileTypeList supported_types({ FileTypes::MZML, FileTypes::MZXML, FileTypes::MZDATA, FileTypes::SQMASS, FileTypes::FEATUREXML, FileTypes::CONSENSUSXML, FileTypes::IDXML, FileTypes::DTA, FileTypes::DTA2D, FileTypes::MGF, FileTypes::MS2, FileTypes::MSP, FileTypes::BZ2, FileTypes::GZ })
supported types which can be opened with File–>Open
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
Centralizes the file types recognized by FileHandler.
Definition: FileTypes.h:53
Type
Actual file types enum.
Definition: FileTypes.h:57
@ MZIDENTML
mzIdentML (HUPO PSI AnalysisXML followup format) (.mzid)
Definition: FileTypes.h:75
@ FEATUREXML
OpenMS feature file (.featureXML)
Definition: FileTypes.h:63
@ IDXML
OpenMS identification format (.idXML)
Definition: FileTypes.h:64
@ OSW
OpenSWATH OpenSWATH report (OSW) SQLite DB.
Definition: FileTypes.h:104