|
The CrossLink class provides abstractions to work with a cross-link entity between Monomer instances. More...
Header: | #include <CrossLink.hpp> |
Inherits: | MsXpS::libXpertMass::CrossLinker |
CrossLink(PolChemDefCstSPtr pol_chem_def_csp, Polymer *polymer, const QString &name, const QString &formula, const QString &comment = QString()) | |
CrossLink(const CrossLinker &cross_linker, Polymer *polymer, const QString &comment = QString()) | |
CrossLink(const CrossLink &other) | |
virtual | ~CrossLink() |
bool | appendMonomer(const Monomer *monomer) |
const QString & | comment() const |
int | encompassedBy(int start, int end, int *in = 0, int *out = 0) |
int | encompassedBy(const CoordinateList &coordinate_list, int *in = 0, int *out = 0) |
const Monomer * | firstMonomer() const |
int | involvesMonomer(const Monomer *monomer) const |
const Monomer * | monomerAt(int index) |
int | monomerIndexList(QList<int> *list) |
QString | monomerIndexText() |
QList<const Monomer *> * | monomerList() |
QString | monomerPosText() |
Polymer * | polymer() |
int | populateMonomerList(QString text) |
QString * | prepareResultsTxtString() |
bool | removeMonomerAt(int index) |
void | setComment(const QString &comment) |
bool | setMonomerAt(Monomer *monomer, int index) |
void | setPolymer(Polymer *polymer) |
bool | validate() |
virtual bool | operator==(const CrossLink &other) const |
virtual bool | accountMasses(double *mono = 0, double *avg = 0, int times = 1) override |
virtual bool | accountMasses(Ponderable *ponderable, int times = 1) override |
virtual bool | calculateMasses() override |
QString | m_comment |
QList<const Monomer *> | m_monomerList |
Polymer * | mp_polymer |
The notion of a cross-link is that it is a chemical reaction that involves at least two monomers in a Polymer or in an Oligomer sequence.
Polymer sequences might contain more than one CrossLink and these are stored as a CrossLinkList.
Constructs a CrossLink instance
Constructs a CrossLink instance
Constructs a CrossLink instance as a copy of other.
[virtual noexcept]
CrossLink::~CrossLink()Destructs this CrossLink instance.
No entity needs to be destructed, since the Monomer instances in the list are not owned by this CrossLinker instance.
[override virtual]
bool CrossLink::accountMasses(double *mono = 0, double *avg = 0, int times = 1)Reimplements: CrossLinker::accountMasses(double *mono, double *avg, int times).
Adds the member m_mono and m_avg masses to mono and avg, as compounded by the times factor.
Returns true.
[override virtual]
bool CrossLink::accountMasses(Ponderable *ponderable, int times = 1)Reimplements: CrossLinker::accountMasses(Ponderable *ponderable, int times).
Adds the member m_mono and m_avg masses to ponderable, as compounded by the times factor.
Returns true.
Adds monomer to the member list of Monomer instances.
monomer cannot be nullptr.
Returns true.
[override virtual]
bool CrossLink::calculateMasses()Reimplements: CrossLinker::calculateMasses().
Calculates the masses of this CrossLink and set them anew to the member masses (Ponderable base class).
Returns true.
Returns the member comment.
See also setComment().
Tells if this CrossLink instance is encompassed (partially or fully) or not at all by the Polymer sequence region defined by the [start - end ] Monomer index range.
The count of monomers involved in this cross-link that:
If all the monomers are listed as in, then this CrossLink is fully encompassed by the Polymer sequence region defined by the [start - end ] Monomer index range and CROSS_LINK_ENCOMPASSED_FULL is returned.
If all the monomers are listed as out, then this CrossLink is not at all encompassed by the Polymer sequence region and CROSS_LINK_ENCOMPASSED_NO is returned.
If both kinds of monmers were found, then CROSS_LINK_ENCOMPASSED_PARTIAL is returned.
Tells if this CrossLink instance is encompassed (partially or fully) or not at all by various Coordinates instances in the coordinate_list CoordinateList.
The count of monomers involved in this cross-link that:
If all the monomers are listed as in, then this CrossLink is fully encompassed by the Polymer sequence regions defined in coordinate_list and CROSS_LINK_ENCOMPASSED_FULL is returned.
If all the monomers are listed as out, then this CrossLink is not at all encompassed by the Polymer sequence region and CROSS_LINK_ENCOMPASSED_NO is returned.
If both kinds of monmers were found, then CROSS_LINK_ENCOMPASSED_PARTIAL is returned.
Returns the first Monomer instance listed in the member list of monomers. If the list is empty; returns nullptr.
Returns the index of monomer found in the member Polymer sequence that is involved in this CrossLink, or -1 if that is not found.
Returns the monomer at index in the member list of Monomer instances.
index cannot be out-of-bounds.
See also setMonomerAt().
Lists in list the indices of all the monomers involved in this CrossLink instance.
Returns the count of indices set to list.
Returns a string containing a ';'-separated list of the indices of all the Monomer instances involved in this CrossLink.
Returns the member list of Monomer instances.
Returns a string containing a ';'-separated list of the positions of all the Monomer instances involved in this CrossLink.
Returns the Polymer instance in which this CrossLink has been formed.
See also setPolymer().
Sets to the member monomer list all the Monomer instances referenced in text as indices to monomer in the Polymer sequence.
text contains a list of Monomer instance indices separated by ';' characters. The corresponding monomers found in the member Polymer are copied to the member list of Monomer instances, effectively documenting a CrossLink in that member Polymer sequence.
This CrossLink instance does not own the Monomer instances pointers, as they effectively point to monomer that belong to the member Polymer.
Returns an allocated string describing this CrossLink instance.
Removes the monomer at index in the member list of Monomer instances.
index cannot be out-of-bounds.
Returns true.
Set the member comment to comment.
See also comment().
Sets monomer to this CrossLink at index of the member list of Monomer instances, effectively replacing the monomer instance currently at that index.
monomer cannot be nullptr and index cannot be out-of-bounds.
This CrossLinker instance does not take ownership of monomer.
Returns true.
See also monomerAt().
Set polymer as the Polymer sequence in which this CrossLink has been formed.
polymer cannot be nullptr.
See also polymer().
Returns true if this CrossLink instance validates successfully, false otherwise.
The validation is successful if:
[virtual]
bool CrossLink::operator==(const CrossLink &other) constReturns true if this CrossLink instance and other are identical, false otherwise.
This variable holds the comment that might be associated to this CrossLink.
This variable holds the list of Monomer instances that are involved in the formation of this CrossLink.
The monomers are the Monomer instances found in the mp_polymer Polymer instance. This CrossLink does not own these Monomers.
The reason the CrossLink lists the involved Monomer instances as pointers to these very monomers in the polymer sequence is that in this way, even if the sequence is edited the cross-link does not loose the relation to the monomers. The only way that the sequence editing modifies a CrossLink instance is by removing a Monomer instance involved in the CrossLink. If that occurs, the CrossLink is informed and its destructed.
This variable holds the Polymer instance of which this CrossLink is part. This CrossLink does not own the Polymer.