libXpertMass Developer Documentation
  • libXpertMass
  • ModifSpec
  • ModifSpec Class

    class MsXpS::libXpertMass::ModifSpec

    The ModifSpec class provides the specification about how Modif objects are represented. More...

    Header: #include <ModifSpec.hpp>

    Public Functions

    ModifSpec()
    virtual ~ModifSpec()
    int action()
    const QString &name()
    const QString &raster()
    void setAction(int action)
    void setName(const QString &name)
    void setRaster(const QString &raster)
    void setSound(const QString &sound)
    void setVector(const QString &vector)
    const QString &sound()
    const QString &vector()

    Static Public Members

    bool parseFile(QString &file_path, QList<ModifSpec *> *modif_spec_list)

    Detailed Description

    The ModifSpec class specifies how a Modif object is represented graphically, mainly by connecting its modif name to a graphics SVG file that is located in the Polymer chemistry definition directory. That connection is performed in the "modification_dictionary" dictionary file itself also located in the polymer chemistry definition directory. Its contents look like this:

    Phosphorylation%T%phospho.svg
    Sulphation%T%sulpho.svg
    AmidationAsp%O%asparagine.svg
    Acetylation%T%acetyl.svg
    AmidationGlu%O%glutamine.svg
    Oxidation%T%oxidation.svg
    SulfideBond%T%sulfbond.svg
    ProtonLoss%T%protonloss.svg

    The Phosphorylation%T%phospho.svg line indicates that, when a Monomer object modified by a Modif object by name "Phosphorylation" is to be rendered graphically, the corresponding vignette to be used is in the file named "phospho.svg" in the polymer chemistry definition directory. The 'T' and 'O' special directives, indicate the way the modification is to be represented graphically in the sequence editor. When a monomer is modified, the modification event can be shown by overlaying onto the monomer's vignette a transparent vignette or by replacing it totally with a new one. These two behaviours are documented above with the letters 'T' (transparent overlay) or 'O' (opaque overwrite).

    Member Function Documentation

    ModifSpec::ModifSpec()

    Constructs a ModifSpec instance.

    [virtual noexcept] ModifSpec::~ModifSpec()

    Destructs this ModifSpec instance.

    int ModifSpec::action()

    Returns the action.

    See also setAction().

    const QString &ModifSpec::name()

    Returns the monomer name.

    See also setName().

    [static] bool ModifSpec::parseFile(QString &file_path, QList<ModifSpec *> *modif_spec_list)

    Parses the file_path dictionary containing the Modif specifications.

    At the moment the file has this format:

    Phosphorylation%T%phospho.svg
    Sulphation%T%sulpho.svg
    AmidationAsp%O%asparagine.svg
    Acetylation%T%acetyl.svg
    AmidationGlu%O%glutamine.svg
    Oxidation%T%oxidation.svg

    Upon parsing, the modif_spec_list of ModifSpec instances will be filled with instances created on the basis of each parsed line in the file.

    Returns true if the parsing was successful, false otherwise.

    const QString &ModifSpec::raster()

    Returns the raster image file name.

    See also setRaster().

    void ModifSpec::setAction(int action)

    Sets the action.

    The action is the way the Modif's vignette applies itself on top of the Monomer's vignette: either in an Opaque manner, thus overwriting the initial vignette, or in a Transparent manner, thus only partially overlaying the initial vignette.

    See also action().

    void ModifSpec::setName(const QString &name)

    Sets the monomer name.

    See also name().

    void ModifSpec::setRaster(const QString &raster)

    Sets the raster image file name to raster.

    See also raster().

    void ModifSpec::setSound(const QString &sound)

    Sets the file name of the Modif's sound file.

    See also sound().

    void ModifSpec::setVector(const QString &vector)

    Sets the vector image file name to vector.

    See also vector().

    const QString &ModifSpec::sound()

    Returns the file name of the Modif's sound file.

    See also setSound().

    const QString &ModifSpec::vector()

    Returns the vector image file name.

    See also setVector().