OpenMS
SpectraTreeTab Class Reference

Hierarchical visualization and selection of spectra. More...

#include <OpenMS/VISUAL/SpectraTreeTab.h>

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

Signals

void spectrumSelected (int)
 
void chromsSelected (std::vector< int > indices)
 
void spectrumDoubleClicked (int)
 
void chromsDoubleClicked (std::vector< int > indices)
 
void showSpectrumAsNew1D (int)
 
void showChromatogramsAsNew1D (std::vector< int > indices)
 
void showSpectrumMetaData (int)
 

Public Member Functions

 SpectraTreeTab (QWidget *parent=nullptr)
 Constructor. More...
 
 ~SpectraTreeTab () override=default
 Destructor. More...
 
bool hasData (const LayerDataBase *layer) override
 docu in base class More...
 
void updateEntries (LayerDataBase *cl) override
 refresh the table using data from cl More...
 
void clear () override
 remove all visible data More...
 
bool getSelectedScan (MSExperiment &exp, LayerDataBase::DataType &current_type) const
 

Private Slots

void populateSearchBox_ ()
 fill the search-combo-box with current column header names More...
 
void spectrumSearchText_ ()
 searches for rows containing a search text (from spectra_search_box_); called when text search box is used More...
 
void itemSelectionChange_ (QTreeWidgetItem *, QTreeWidgetItem *)
 emits spectrumSelected() for PEAK or chromsSelected() for CHROM data More...
 
void searchAndShow_ ()
 searches using text box and plots the spectrum More...
 
void itemDoubleClicked_ (QTreeWidgetItem *)
 called upon double click on an item; emits spectrumDoubleClicked() or chromsDoubleClicked() after some checking More...
 
void spectrumContextMenu_ (const QPoint &)
 Display context menu; allows to open metadata window. More...
 

Private Attributes

QLineEditspectra_search_box_ = nullptr
 
QComboBox * spectra_combo_box_ = nullptr
 
TreeViewspectra_treewidget_ = nullptr
 
LayerDataBaselayer_ = nullptr
 
std::map< size_t, std::map< Precursor, std::vector< Size >, Precursor::MZLess > > map_precursor_to_chrom_idx_cache_
 cache to store mapping of chromatogram precursors to chromatogram indices More...
 
const PeakMaplast_peakmap_ = nullptr
 remember the last PeakMap that we used to fill the spectra list (and avoid rebuilding it) More...
 

Detailed Description

Hierarchical visualization and selection of spectra.

Constructor & Destructor Documentation

◆ SpectraTreeTab()

SpectraTreeTab ( QWidget parent = nullptr)

Constructor.

◆ ~SpectraTreeTab()

~SpectraTreeTab ( )
overridedefault

Destructor.

Member Function Documentation

◆ chromsDoubleClicked

void chromsDoubleClicked ( std::vector< int >  indices)
signal

◆ chromsSelected

void chromsSelected ( std::vector< int >  indices)
signal

◆ clear()

void clear ( )
overridevirtual

remove all visible data

Implements DataTabBase.

◆ getSelectedScan()

bool getSelectedScan ( MSExperiment exp,
LayerDataBase::DataType current_type 
) const

Return a copy of the currently selected spectrum/chrom (for drag'n'drop to new window) and store it either as Spectrum or Chromatogram in exp (all other data is cleared) If no spectrum/chrom is selected, false is returned and exp is empty

Parameters
[out]expThe currently active spec/chrom
current_typeEither DT_PEAK or DT_CHROMATOGRAM, depending on what is currently shown
Returns
true if a spec/chrom is currently active

Referenced by TOPPViewBase::copyLayer().

◆ hasData()

bool hasData ( const LayerDataBase layer)
overridevirtual

docu in base class

Implements DataTabBase.

◆ itemDoubleClicked_

void itemDoubleClicked_ ( QTreeWidgetItem *  )
privateslot

called upon double click on an item; emits spectrumDoubleClicked() or chromsDoubleClicked() after some checking

◆ itemSelectionChange_

void itemSelectionChange_ ( QTreeWidgetItem *  ,
QTreeWidgetItem *   
)
privateslot

emits spectrumSelected() for PEAK or chromsSelected() for CHROM data

◆ populateSearchBox_

void populateSearchBox_ ( )
privateslot

fill the search-combo-box with current column header names

◆ searchAndShow_

void searchAndShow_ ( )
privateslot

searches using text box and plots the spectrum

◆ showChromatogramsAsNew1D

void showChromatogramsAsNew1D ( std::vector< int >  indices)
signal

◆ showSpectrumAsNew1D

void showSpectrumAsNew1D ( int  )
signal

◆ showSpectrumMetaData

void showSpectrumMetaData ( int  )
signal

◆ spectrumContextMenu_

void spectrumContextMenu_ ( const QPoint &  )
privateslot

Display context menu; allows to open metadata window.

◆ spectrumDoubleClicked

void spectrumDoubleClicked ( int  )
signal

◆ spectrumSearchText_

void spectrumSearchText_ ( )
privateslot

searches for rows containing a search text (from spectra_search_box_); called when text search box is used

◆ spectrumSelected

void spectrumSelected ( int  )
signal

◆ updateEntries()

void updateEntries ( LayerDataBase cl)
overridevirtual

refresh the table using data from cl

Implements DataTabBase.

Member Data Documentation

◆ last_peakmap_

const PeakMap* last_peakmap_ = nullptr
private

remember the last PeakMap that we used to fill the spectra list (and avoid rebuilding it)

◆ layer_

LayerDataBase* layer_ = nullptr
private

◆ map_precursor_to_chrom_idx_cache_

std::map<size_t, std::map<Precursor, std::vector<Size>, Precursor::MZLess> > map_precursor_to_chrom_idx_cache_
private

cache to store mapping of chromatogram precursors to chromatogram indices

◆ spectra_combo_box_

QComboBox* spectra_combo_box_ = nullptr
private

◆ spectra_search_box_

QLineEdit* spectra_search_box_ = nullptr
private

◆ spectra_treewidget_

TreeView* spectra_treewidget_ = nullptr
private