|
The FragSpec class provides a model for specifying gas phase fragmentations of Oligomer Sequences. More...
Header: | #include <FragSpec.hpp> |
Inherits: | MsXpS::libXpertMass::PolChemDefEntity and MsXpS::libXpertMass::Formula |
FragSpec(PolChemDefCstSPtr pol_chem_def_csp, QString name, QString formula = QString(), FragEnd frag_end = FRAG_END_NONE, const QString &comment = QString()) | |
FragSpec(PolChemDefCstSPtr pol_chem_def_csp, QString name, QString formula) | |
FragSpec(const FragSpec &other) | |
virtual | ~FragSpec() |
void | appendRule(FragRule *frag_rule) |
QString | comment() const |
QString * | formatXmlFgsElement(int offset, const QString &indent = QString(" ")) |
QString | formula() const |
FragEnd | fragEnd() const |
void | insertRuleAt(int index, FragRule *frag_rule) |
void | removeRuleAt(int index) |
bool | renderXmlFgsElement(const QDomElement &element, int version) |
QList<FragRule *> & | ruleList() |
void | setComment(const QString &comment) |
void | setFragEnd(FragEnd frag_end) |
bool | validate() |
FragSpec & | operator=(const FragSpec &other) |
int | isNameInList(const QString &name, const QList<FragSpec *> &frag_spec_list, FragSpec *other = nullptr) |
The FragSpec class provides a fragmentation specification. Fragmentation specifications determine the chemical reaction that governs the fragmentation of the polymer in the gas-phase. The chemical reaction is embodied by a formula. The side of the polymer (left or right) that makes the fragment after the fragmentation has occurred is described by a fragmentation-end enumeration.
A fragmentation specification might not be enough information to determine the manner in which a polymer fragments in the gas-phase. Fragmentation rules (FragRules) might be required to refine the specification. A fragmentation specification might hold as many FragRules as required.
Constructs a FragSpec instance.
pol_chem_def_csp Polymer chemistry definition. Cannot be nullptr.
name Name. Cannot be empty.
formula Formula. Defaults to the null string.
frag_end Fragmentation end. Defaults to FRAG_END_NONE.
comment Comment. Defaults to the null string.
Constructs a fragmentation specification.
pol_chem_def_csp Polymer chemistry definition. Cannot be nullptr.
name Name. Cannot be empty.
formula Formula.
Constructs a FragSpec instance as a copy of other.
[virtual noexcept]
FragSpec::~FragSpec()Destroys this FragSpec instance.
Adds the frag_rule FragRule instance to the member list of FragRule instances.
Returns the comment.
See also setComment().
Formats a string representing this FragSpec instance suitable to use as an XML element.
The typical fragmentation specification element that is generated in this function looks like this:
<fgs> <name>a</name> <end>LE</end> <formula>-C1O1</formula> <fgr> <name>a-fgr-1</name> <formula>+H200</formula> <prev-mnm-code>E</prev-mnm-code> <curr-mnm-code>D</curr-mnm-code> <next-mnm-code>F</next-mnm-code> <comment>comment here!</comment> </fgr> <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> </fgs>
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.
Returns the fragmentation end.
See also setFragEnd().
Inserts in the member list of FragRule instances at index the frag_rule FragRule instance.
[static]
int FragSpec::isNameInList(const QString &name, const QList<FragSpec *> &frag_spec_list, FragSpec *other = nullptr)Searches by name for a FragSpec in the frag_spec_list.
If such fragmentation specification is found, and if other is non-0, the found fragmentation specification's data are copied into other.
Returns the index of the found FragSpec instance or -1 if none is found or if name is empty.
Removes from the member list of FragRule instances the item at index index.
Parses a fragmentation specification XML element using a versioned function.
Upon parsing and validation of the parsed data, the member data are updated, thus essentially initializing this FragSpec instance.
Returns true if parsing and formula validation were successful, false otherwise.
Returns the list of FragRule instances.
Sets the comment.
See also comment().
Sets the fragmentation end to frag_end.
See also fragEnd().
Validates the FragSpec.
The validation involves checking that:
Returns true upon success, false otherwise.
Assigns other to this FragSpec instance.
Returns a reference to this FragSpec.