libXpertMassCore and libXpertMassGui Developer Documentation
  • libXpertMassCore
  • LowMassDeconvolverFullLabelling
  • MsXpS::libXpertMassCore::Processing::LowMassDeconvolverFullLabelling Class

    class MsXpS::libXpertMassCore::Processing::LowMassDeconvolverFullLabelling

    The LowMassDeconvolverFullLabelling class manages the deconvolution of low mass analytes mass spectra. More...

    Header: #include <\ MsXpS/libXpertMassCore/Processing/LowMassDeconvolverFullLabelling.hpp>
    Inherits: MsXpS::libXpertMassCore::Processing::AbstractLowMassDeconvolver

    Public Functions

    LowMassDeconvolverFullLabelling(const MsXpS::libXpertMassCore::Processing::LowMassDeconvolverParameters &parameters)
    virtual ~LowMassDeconvolverFullLabelling()

    Reimplemented Public Functions

    virtual QList<MsXpS::libXpertMassCore::Processing::DeconvolutedFeature> deconvolute(const pappso::Trace &input_centroids) const override

    Reimplemented Protected Functions

    virtual bool fitIsotopicEnvelope(const pappso::Trace &input_centroids, std::size_t input_centroid_index, MsXpS::libXpertMassCore::Processing::ChargeSpecificFeature &charge_specific_feature, std::vector<bool> &globally_used) const override
    virtual std::vector<MsXpS::libXpertMassCore::Processing::ChargeSpecificFeature> generateChargeSpecificFeatures(const pappso::Trace &input_centroids) const override
    virtual pappso::Trace getIsotopicClusterReducedToMaxMatchCount(const pappso::Trace &isotopic_cluster) const override
    virtual std::vector<MsXpS::libXpertMassCore::Processing::IsoMatch, std::allocator<MsXpS::libXpertMassCore::Processing::IsoMatch>>::const_iterator getIsotopologueMatchIterator(const std::vector<MsXpS::libXpertMassCore::Processing::IsoMatch> &matches, int isotopologue_index, QString &message) const override
    virtual std::vector<MsXpS::libXpertMassCore::Processing::IsoMatch, std::allocator<MsXpS::libXpertMassCore::Processing::IsoMatch>>::const_iterator getMonoisotopicMatchIterator(const std::vector<MsXpS::libXpertMassCore::Processing::IsoMatch> &matches, QString &message) const override

    Detailed Description

    The mass spectra must have been acquired on analytes labelled using stable heavy isotopes. The overall labelling must be sufficient so as to effectively invert the isotopic cluster's shape, such that the monoisotopic isotopologue centroid is located at the right of the cluster (on the m/z abscissa). Since the analytes are of low mass, the monoisotopic isotopologue centroid is effectively the centroid located at the greatest m/z value (see explanations in AbstractLowMassDeconvolver; save for the tiny peaks that might appear on the right of it if the hyperfine structure of the isotopic cluster is not collapsed; see collapseTheoreticalIsotopicCluster).

    Member Function Documentation

    [explicit] LowMassDeconvolverFullLabelling::LowMassDeconvolverFullLabelling(const MsXpS::libXpertMassCore::Processing::LowMassDeconvolverParameters &parameters)

    Constructs a LowMassDeconvolverFullLabelling instance using parameters.

    The parameters structure members are used to initialize the isotopic data and the Averagine formula. Any failure to do so triggers qFatal().

    [virtual noexcept] LowMassDeconvolverFullLabelling::~LowMassDeconvolverFullLabelling()

    Destructs this instance.

    [override virtual] QList<MsXpS::libXpertMassCore::Processing::DeconvolutedFeature> LowMassDeconvolverFullLabelling::deconvolute(const pappso::Trace &input_centroids) const

    Performs the deconvolution of the input centroided mass spectrum input_centroids.

    Returns a container of DeconvolutedFeature instances corresponding to the found neutral masses along with supporting ions data.

    [override virtual protected] bool LowMassDeconvolverFullLabelling::fitIsotopicEnvelope(const pappso::Trace &input_centroids, std::size_t input_centroid_index, MsXpS::libXpertMassCore::Processing::ChargeSpecificFeature &charge_specific_feature, std::vector<bool> &globally_used) const

    Fits the charge_specific_feature contained data to a theoretical isotopic cluster.

    The idea of this function implementation is that we get the input_centroid_index index to one centroid of the input_centroids input centroided mass spectrum. That centroid is thus an observed, not a theoretical, centroid characterized by it (m/z, intensity) pair of values. We also get the neutral mass of that centroid m/z, as stored in the charge_specific_feature parameter. This neutral mass is used to compute a theoretical isotopic cluster.

    The centroids of the computed neutral theoretical isotopic cluster are iterated into and for each one a m/z value is computed using the charge in charge_specific_feature.

    Then, matches are searched from the input centroided mass spectrum to the computed m/z value0. When all the possible centroids of the input mass spectrum have been checked, the matches (if any) are subsequently thoroughly checked for various consistency notions (like inter-centroid distance, isotopic cluster shape correlation between the input mass spectral data and the theoretical isotopic cluster, for example).

    If the checks succeed, the input_centroid_index is recorded into globally_used so as to avoid having to iterate into it again. The charge_specific_feature object is then updated with data for the successful match.

    Since the mass spectrometry data have been acquired on unlabelled analytes, the iteration in the input mass spectrum, in search for the matches mentioned above, is perform from right to left, that is, from upper to lower m/z values.

    Returns true upon a successful fit, false otherwise.

    [override virtual protected] std::vector<MsXpS::libXpertMassCore::Processing::ChargeSpecificFeature> LowMassDeconvolverFullLabelling::generateChargeSpecificFeatures(const pappso::Trace &input_centroids) const

    Generates a set of ChargeSpecificFeature instances modelled using the input_centroids input centroided mass spectrum.

    The implementation of this function does the following:

    For each centroid in input_centroids, a set of ChargeSpecificFeature instances is created by iterating in the range of acceptable ion charge values as defined in the member Parameters datum. Since the charge of the ion below each centroid in the input mass spectrum is not known, a neutral mass is computed corresponding to eacb one of the values in that charge range. For each charge level, a new ChargeSpecificFeature is allocated.

    If the neutral mass that is computed is outside of the min-max mass range as defined in the member Parameters datum, then the input centroid is skipped.

    Because the analytes recorded in the input_centroids centroided mass spectrum are fully (or almost fully) labelled with heavy isotopes (that is, the isotopes have non-natural abundances), the input mass spectrum is iterated into from the greatest to the smallest m/z values (that is, the mass spectrum is reverse-iterated).

    All the generated ChargeSpecificFeature instances are returned in a vector.

    [override virtual protected] pappso::Trace LowMassDeconvolverFullLabelling::getIsotopicClusterReducedToMaxMatchCount(const pappso::Trace &isotopic_cluster) const

    Returns an isotopic cluster as a pappso::Trace corresponding to isotopic_cluster from which centroids have been removed.

    The input isotopic cluster may have more centroids than the number of accepted centroids as specified in m_params.maxIsotopicClusterMatches.

    An iterator to the most intense centroid is searched for in isotopic_cluster and as long as the number of centroids is not greater than m_params.maxIsotopicClusterMatches, centroids from isotopic_cluster are copied in the returned isotopic cluster.

    Because the analytes recorded in the mass spectrum are fully (or almost fully) labelled with heavy isotopes, the isotopic cluster is inverted. Thus, the iteration in the isotopic_cluster is in reverse mode: from the greatest m/z value (rightmost centroid in the isotopic cluster) to the smalles m/z value (leftmost centroid in the cluster).

    This process is equivalent to setting to the returned isotopic cluster only the m_params.maxIsotopicClusterMatches most intense centroids found in isotopic_cluster.

    qFatal() is called if it was not possible to find the most intense centroid in isotopic_cluster.

    [override virtual protected] std::vector<MsXpS::libXpertMassCore::Processing::IsoMatch, std::allocator<MsXpS::libXpertMassCore::Processing::IsoMatch>>::const_iterator LowMassDeconvolverFullLabelling::getIsotopologueMatchIterator(const std::vector<MsXpS::libXpertMassCore::Processing::IsoMatch> &matches, int isotopologue_index, QString &message) const

    Returns an iterator to the IsoMatch instance in matches found to be the isotopologue isotopologue_index of the isotopic cluster.

    Because we are handling fully labeled C13/N15 analytes, and that these analytes are of a low mass, the monoisotopic centroid has to be both:

    isotopologue_index cannot be greater or equal to the number of matches in matches. If so the end iterator to the matches container is returned.

    Any message that needs to be fed back to the caller is appended to message.

    Isotopologue 0 is the monoisotopic centroid, isotopologue 1 is the centroid that is left of isotopologue 0, isotopologue 2 is the centroid that is left of isotopologue 1.

    Returns an iterator to the IsoMatch item corresponding to the found isotopic cluster's isotopologue_index isotopologue.

    [override virtual protected] std::vector<MsXpS::libXpertMassCore::Processing::IsoMatch, std::allocator<MsXpS::libXpertMassCore::Processing::IsoMatch>>::const_iterator LowMassDeconvolverFullLabelling::getMonoisotopicMatchIterator(const std::vector<MsXpS::libXpertMassCore::Processing::IsoMatch> &matches, QString &message) const

    Returns an iterator to the IsoMatch instance that corresponds to the isotopic cluster centroid match having the greatest intensity among all the matches in matches.

    Because the analytes on which the mass spectrum has been acquired are fully (or almost fully) labelled with heavy isotopes, the isotopic cluster shape is inverted and the monoisotopic isotopologue centroid is thus the rightmost one in the isotopic cluster.

    Any message that needs to be fed back to the caller is appended to message.

    See also getIsotopologueMatchIterator.