libXpertMass Developer Documentation
  • libXpertMassGui
  • IsotopicClusterGeneratorDlg
  • IsotopicClusterGeneratorDlg Class

    class MsXpS::libXpertMassGui::IsotopicClusterGeneratorDlg

    The IsotopicClusterGeneratorDlg class provides a graphical user interface for the generation of an isotopic cluster. More...

    Header: #include <IsotopicClusterGeneratorDlg.hpp>

    Public Functions

    IsotopicClusterGeneratorDlg(QWidget *program_window_p, const QString &applicationName, const QString &description)
    virtual ~IsotopicClusterGeneratorDlg()
    bool initializeUserManualConfigurationWidgets(const libXpertMass::IsotopicDataManualConfigHandler &config_handler)

    Public Slots

    int *addElementGroupBox()
    int *addElementSkeletonGroupBox()
    int addIsotopeFrame()
    void addLibraryFormula()
    void addUserConfigFormula()
    int *createIsotopeFrame(int *elementGroupBox = nullptr)
    void removeElementGroupBox()
    void removeIsotopeFrame()
    void removeLibraryFormula()
    void removeUserConfigFormula()
    bool runLibrary()
    bool runUserConfig()
    bool runUserManualConfig()
    void toIsotopicClusterShaper()
    void traceColorPushButtonClicked()

    Protected Functions

    bool checkParameters()
    void closeEvent(int *event)
    bool loadUserConfig()
    bool loadUserManualConfig()
    void message(const QString &message, int timeout = 3000)
    void readSettings(const QString &config_settings_file_path)
    void reportResults()
    bool saveLibrary()
    bool saveUserConfig()
    bool saveUserManualConfig()
    bool setupDialog()
    void setupIsoSpecStandardStaticTableView()
    void setupIsoSpecStandardUserTableView()
    std::size_t validateManualConfig(libXpertMass::IsotopicDataManualConfigHandler &config_handler)
    void writeSettings(const QString &config_settings_file_path)

    Protected Variables

    QString m_applicationName
    int m_charge
    libXpertMass::IsotopicClusterGenerator m_clusterGenerator
    QByteArray m_colorByteArray
    libXpertMass::Formula m_formula
    double m_maxSummedProbability
    int m_normalizeIntensity
    pappso::SortOrder m_sortOrder
    pappso::SortType m_sortType
    QString m_windowDescription
    QWidget *mp_programWindow
    Ui::IsotopicClusterGeneratorDlg *mp_ui
    IsotopicDataTableViewModel *mpa_libraryStaticTableViewModel
    IsotopicDataTableViewModel *mpa_userStaticTableViewModel
    libXpertMass::IsotopicDataSPtr msp_isotopicDataLibrary
    libXpertMass::IsotopicDataSPtr msp_isotopicDataUserConfig
    libXpertMass::IsotopicDataSPtr msp_isotopicDataUserManualConfig

    Detailed Description

    The isotopic cluster is generated starting from a Formula.

    Member Function Documentation

    IsotopicClusterGeneratorDlg::IsotopicClusterGeneratorDlg(QWidget *program_window_p, const QString &applicationName, const QString &description)

    Constructs a IsotopicClusterGeneratorDlg instance.

    [virtual noexcept] IsotopicClusterGeneratorDlg::~IsotopicClusterGeneratorDlg()

    Destructs this IsotopicClusterGeneratorDlg instance.

    [slot] int *IsotopicClusterGeneratorDlg::addElementGroupBox()

    Creates a group box that will enshrine a chemical element definition.

    The group box is populated with a line edit widget for the element symbol and with a spin box for the count of the atoms in the final elemental composition defined here.

    The isotope-related frame is then created inside the newly created group box.

    See also addElementSkeletonGroupBox().

    [slot] int *IsotopicClusterGeneratorDlg::addElementSkeletonGroupBox()

    Creates a group box that will enshrine a chemical element definition.

    The group box is populated with a line edit widget for the element symbol and with a spin box for the count of the atoms in the final elemental composition defined here.

    The isotope-related widgets are not created.

    See also addElementGroupBox().

    [slot] int IsotopicClusterGeneratorDlg::addIsotopeFrame()

    Adds a frame for the definition of an isotope.

    Returns a pair of spin box widgets, the first for the isotope mass and the second for the probability (abundance).

    [slot] void IsotopicClusterGeneratorDlg::addLibraryFormula()

    Adds the currently displayed formula for the IsoSpec-based table view to the corresponding combo box widget.

    [slot] void IsotopicClusterGeneratorDlg::addUserConfigFormula()

    Adds the currently displayed formula for the IsoSpec-like user-modified table view to the corresponding combo box widget.

    [protected] bool IsotopicClusterGeneratorDlg::checkParameters()

    Returns true if all the parameters are correct and consistent, false otherwise.

    [protected] void IsotopicClusterGeneratorDlg::closeEvent(int *event)

    Upon closing of the dialog window (unused event), writes the settings to the application configuration file.

    [slot] int *IsotopicClusterGeneratorDlg::createIsotopeFrame(int *elementGroupBox = nullptr)

    Returns a newly created frame inside elementGroupBox that will enshrine all the specifications about the isotopes being configured.

    bool IsotopicClusterGeneratorDlg::initializeUserManualConfigurationWidgets(const libXpertMass::IsotopicDataManualConfigHandler &config_handler)

    Initializes all the widgets required to host the user manually-configured isotopic data.

    This function should be called right after having loaded a user manually-defined isotopic data configuration. config_handler is the isotopic data configuration handler that had previously loaded the data.

    Returns true upon success, false if the user manual configuration is empty.

    See also loadUserManualConfig().

    [protected] bool IsotopicClusterGeneratorDlg::loadUserConfig()

    Loads the user-configured IsoSpec-like data.

    Returns true if successful, false otherwise.

    [protected] bool IsotopicClusterGeneratorDlg::loadUserManualConfig()

    Loads the user manually-configured isotopic data configuration.

    All the widgets required to actually display the user manual configuration are created and configured automatically.

    Returns true upon success, false otherwise.

    [protected] void IsotopicClusterGeneratorDlg::message(const QString &message, int timeout = 3000)

    Prints message in the message line edit widget, that will be erased after the timeout.

    [protected] void IsotopicClusterGeneratorDlg::readSettings(const QString &config_settings_file_path)

    Reads the settings of this dialog window from the application configuration file (config_settings_file_path).

    The configuration is read from the file to set back the dialog window in the same status.

    [slot] void IsotopicClusterGeneratorDlg::removeElementGroupBox()

    Removes an element group box.

    The group box to be removed is determined from the identity of the push button that triggered this function.

    [slot] void IsotopicClusterGeneratorDlg::removeIsotopeFrame()

    Removes an isotope frame.

    The isotope frame to be removed is determined from the identity of the push button that triggered this function.

    [slot] void IsotopicClusterGeneratorDlg::removeLibraryFormula()

    Removes the currently displayed formula for the IsoSpec-based table view from the corresponding combo box widget.

    [slot] void IsotopicClusterGeneratorDlg::removeUserConfigFormula()

    Removes the currently displayed formula for the IsoSpec-like user-modified table view from the corresponding combo box widget.

    [protected] void IsotopicClusterGeneratorDlg::reportResults()

    Exports the computation results to a string that is set to the plain text edit widget in the results tab widget tab.

    [slot] bool IsotopicClusterGeneratorDlg::runLibrary()

    Runs the computation using the IsoSpec-based isotopic data.

    Returns true upon success, false otherwise.

    [slot] bool IsotopicClusterGeneratorDlg::runUserConfig()

    Runs the computation using the IsoSpec-like user-modified isotopic data.

    Returns true upon success, false otherwise.

    [slot] bool IsotopicClusterGeneratorDlg::runUserManualConfig()

    Runs the computation using the user manually-configured isotopic data.

    Returns true upon success, false otherwise.

    [protected] bool IsotopicClusterGeneratorDlg::saveLibrary()

    Returns true if the IsoSpec isotopic data could be written to file, false otherwise.

    [protected] bool IsotopicClusterGeneratorDlg::saveUserConfig()

    Returns true if the IsoSpec-like user-modified isotopic data could be written to file, false otherwise.

    [protected] bool IsotopicClusterGeneratorDlg::saveUserManualConfig()

    Saves the user manually-entered isotopic data configuration to file.

    The user is provided with a file selection dialog window.

    Returns true upon succes, false if the manual isotopic data configuration does not validate successfully.

    [protected] bool IsotopicClusterGeneratorDlg::setupDialog()

    Sets up the dialog window.

    Returns true upon success, or false if the IsoSpec-based isotopic data could not be loaded.

    [protected] void IsotopicClusterGeneratorDlg::setupIsoSpecStandardStaticTableView()

    Sets up the IsoSpec tables model and table view.

    [protected] void IsotopicClusterGeneratorDlg::setupIsoSpecStandardUserTableView()

    Sets up the user-configured IsoSpec-like tables model and table view.

    [slot] void IsotopicClusterGeneratorDlg::toIsotopicClusterShaper()

    Copies the results of the computation to an IsotopicClusterShaperDlg instance.

    [slot] void IsotopicClusterGeneratorDlg::traceColorPushButtonClicked()

    Reacts to a click onto the push button.

    Allows selecting a color for the mass spectrum trace to be created later on the basis of the isotopic cluster calculated here.

    [protected] std::size_t IsotopicClusterGeneratorDlg::validateManualConfig(libXpertMass::IsotopicDataManualConfigHandler &config_handler)

    Validates the user manual isotopic data configuration using the config_handler configuration handler.

    The manual configuration is performed by entering by hand the chemical elements (as a symbol) and their isotope (mass,prob) pairs. The element is defined using the symbol. The count of the element in the formula is set in a spin box.

    Validating the manual configuration means iterating in all the widgets that have been created by the user, extracting from them all the isotopic data.

    Returns the count of elements in the configuration.

    [protected] void IsotopicClusterGeneratorDlg::writeSettings(const QString &config_settings_file_path)

    Saves the settings of this dialog window to the application configuration file (config_settings_file_path).

    The saved configuration is read from the file to set back the dialog window in the same status.

    Member Variable Documentation

    QString IsotopicClusterGeneratorDlg::m_applicationName

    This variable holds the name of the application.

    int IsotopicClusterGeneratorDlg::m_charge

    This variable holds the charge of the analyte for which the calculations are performed.

    libXpertMass::IsotopicClusterGenerator IsotopicClusterGeneratorDlg::m_clusterGenerator

    This variable holds the isotopic cluster generator that will be used for the computations.

    QByteArray IsotopicClusterGeneratorDlg::m_colorByteArray

    This variable holds the color that should be used for displaying the mass spectrum when the isotopic cluster is later shaped into a mass spectrum.

    libXpertMass::Formula IsotopicClusterGeneratorDlg::m_formula

    This variable holds the formula that is used as the starting point for the calculations.

    The formula holds the elemental composition of the analyte for which the calculation should be performed. It must account for the chemical agent responsible for its ionization.

    double IsotopicClusterGeneratorDlg::m_maxSummedProbability

    This variable holds the sum of all the intensities of the cluster peaks should not exceed this value.

    By default, the value is 0.95.

    int IsotopicClusterGeneratorDlg::m_normalizeIntensity

    This variable holds the intensity value that the most intense peak in the cluster should have.

    All the other peaks intensities are normalized against this value.

    pappso::SortOrder IsotopicClusterGeneratorDlg::m_sortOrder

    This variable holds the order for the sorting (if any) of the obtained isotopic cluster's peak centroids.

    pappso::SortType IsotopicClusterGeneratorDlg::m_sortType

    This variable holds the type of sorting to use to sort the obtained isotopic cluster's peak centroids.

    QString IsotopicClusterGeneratorDlg::m_windowDescription

    This variable holds the text to be used for the window title.

    QWidget *IsotopicClusterGeneratorDlg::mp_programWindow

    This variable holds the main program window.

    Ui::IsotopicClusterGeneratorDlg *IsotopicClusterGeneratorDlg::mp_ui

    This variable holds the graphical user interface definition.

    IsotopicDataTableViewModel *IsotopicClusterGeneratorDlg::mpa_libraryStaticTableViewModel

    This variable holds the table view model that manages the library static IsoSpec standard data.

    IsotopicDataTableViewModel *IsotopicClusterGeneratorDlg::mpa_userStaticTableViewModel

    This variable holds the table view model that manages the library user-modified IsoSpec standard data.

    libXpertMass::IsotopicDataSPtr IsotopicClusterGeneratorDlg::msp_isotopicDataLibrary

    This variable holds the isotopic data from the IsoSpec library tables.

    libXpertMass::IsotopicDataSPtr IsotopicClusterGeneratorDlg::msp_isotopicDataUserConfig

    This variable holds the isotopic data from the IsoSpec-like library tables as modified by the user.

    libXpertMass::IsotopicDataSPtr IsotopicClusterGeneratorDlg::msp_isotopicDataUserManualConfig

    This variable holds the isotopic data from the user's manual configuration.