|
The FragRule class provides a model for specifying gas phase fragmentation rules for refining fragmentation specifications (FragSpec) of Oligomer Sequences. More...
Header: | #include <FragRule.hpp> |
Inherits: | MsXpS::libXpertMass::PolChemDefEntity and MsXpS::libXpertMass::Formula |
FragRule(PolChemDefCstSPtr pol_chem_def_csp, QString name, QString prevCode = QString(), QString currCode = QString(), QString nextCode = QString(), QString formula = QString(), const QString &comment = QString()) | |
FragRule(const FragRule &other) | |
virtual | ~FragRule() |
QString | comment() const |
QString | currCode() const |
QString * | formatXmlFgrElement(int offset, const QString &indent = QString(" ")) |
QString | formula() const |
QString | nextCode() const |
QString | prevCode() const |
bool | renderXmlFgrElement(const QDomElement &element) |
void | setComment(const QString &comment) |
void | setCurrCode(const QString &code) |
void | setNextCode(const QString &code) |
void | setPrevCode(const QString &code) |
bool | validate() |
FragRule & | operator=(const FragRule &other) |
int | isNameInList(const QString &name, const QList<FragRule *> &frag_rule_list, FragRule *other = nullptr) |
QString | m_comment |
QString | m_currCode |
QString | m_nextCode |
QString | m_prevCode |
Fragmentation rules characterize in more detail the chemical reaction that governs the fragmentation of the polymer in the gas-phase. The rule is a conditional rule. Its logic is based on the presence of specified monomers right at the place of the fragmentation and before or after that precise location.
In saccharide chemistry, fragmentations are a very complex topic. This is because a given monomer will fragment according to a given chemistry if it is preceded in the sequence by a monomer of a given identity and according to another chemistry if its direct environment is different.
This paradigm is implemented using a sequence environment logic based on conditions that can be formulated thanks to three monomer codes:
The use of these codes is typically according to this logic:
If current monomer is Glu and that previous monomer is Gly and following monomer is Arg, then fragmentation should occur according to this formula : "-H2O".
See also FragSpec.
Constructs a fragmentation rule.
pol_chem_def_csp Polymer chemistry definition. Cannot be nullptr.
name Name. Cannot be empty.
prevCode Previous monomer code. Defaults to the null string.
currCode Current monomer code. Defaults to the null string.
nextCode Next monomer code. Defaults to the null string.
formula Formula. Defaults to the null string.
comment Comment. Defaults to the null string.
Constructs a FragRule instance as a copy of other.
[virtual noexcept]
FragRule::~FragRule()Destructs the fragmentation rule.
Returns the comment.
See also setComment().
Returns the current monomer code.
See also setCurrCode().
Formats a string suitable to use as an XML element.
The string is suitable to be used as an XML element in a polymer chemistry definition file. The typical fragmentation rule element that is generated in this function looks like this:
<fgr> <name>a-fgr-2</name> <formula>+H100</formula> <prev-mnm-code>F</prev-mnm-code> <curr-mnm-code>D</curr-mnm-code> <next-mnm-code>E</next-mnm-code> <comment>comment here!</comment> </fgr>
The formatting of the XML element takes into account offset and indent by prepending the string with offset * indent character substring.
indent defaults to two spaces.
Returns a dynamically allocated string that needs to be freed after use.
Returns the Formula as a string.
[static]
int FragRule::isNameInList(const QString &name, const QList<FragRule *> &frag_rule_list, FragRule *other = nullptr)Searches by name a FragRule in frag_rule_list.
If a FragRule instance is found and other is non-nullptr, the found fragmentation rule's data are copied into other.
Returns the index of the found FragRule or -1 if none is found or if name is empty.
Returns the next monomer code.
See also setNextCode().
Returns the previous monomer code.
See also setPrevCode().
Parses the FragRule XML element.
Upon parsing and validation of the parsed data, the member data are updated, thus essentially initializing this FragRule instance.
Returns true if parsing and formula validation were successful, false otherwise.
Sets the comment.
See also comment().
Sets the current monomer code.
See also currCode().
Sets the next monomer code.
See also nextCode().
Sets the previous monomer code.
See also prevCode().
Validates the FragRule.
The validation involves checking that:
Returns true upon success, false otherwise.
Assigns other to this FragRule instance.
Returns a reference to this fragmentation rule.
This variable holds a comment associated to the FragRule.
This variable holds the Monomer code at the actual fragmentation site.
This variable holds the Monomer code located after the actual fragmentation site.
This variable holds the Monomer code located before the actual fragmentation site.