libXpertMass Developer Documentation
  • libXpertMass
  • CoordinateList
  • CoordinateList Class

    class MsXpS::libXpertMass::CoordinateList

    The CoordinateList class provides a list of Coordinates allocated instances. More...

    Header: #include <CoordinateList>
    Inherits: QList
    Inherited By:

    MsXpS::libXpertMass::Oligomer

    Public Functions

    CoordinateList(QString comment = QString(), QList<Coordinates *> *list = 0)
    CoordinateList(const CoordinateList &other)
    ~CoordinateList()
    void appendCoordinates(const Coordinates &coordinates)
    QString comment() const
    void debugPutStdErr()
    void empty()
    bool encompassIndex(int index) const
    QString indicesAsText() const
    bool isLeftMostCoordinates(Coordinates *coordinates) const
    bool isRightMostCoordinates(Coordinates *coordinates) const
    int leftMostCoordinates(QList<int> &index_list) const
    bool overlap() const
    QString positionsAsText() const
    int rightMostCoordinates(QList<int> &index_list) const
    void setComment(QString text)
    void setCoordinates(const Coordinates &coordinates)
    void setCoordinates(const CoordinateList &list)
    int setCoordinates(const QString &coordinates_string)
    CoordinateList &operator=(const CoordinateList &other)

    Protected Variables

    QString m_comment

    Detailed Description

    The Coordinates instances are allocated on the heap and stored as a QList.

    Member Function Documentation

    CoordinateList::CoordinateList(QString comment = QString(), QList<Coordinates *> *list = 0)

    Constructs a CoordinateList using comment and list.

    The Coordinates instances in list are duplicated and stored in this CoordinateList.

    CoordinateList::CoordinateList(const CoordinateList &other)

    Constructs a CoordinateList as a copy of other.

    The copy is a deep copy, with all the Coordinates instances in other duplicated and stored in this CoordinateList.

    [noexcept] CoordinateList::~CoordinateList()

    Destructs this CoordinateList.

    The Coordinates instances are freed.

    void CoordinateList::appendCoordinates(const Coordinates &coordinates)

    Add a copy of coordinates this CoordinateList instance.

    QString CoordinateList::comment() const

    Returns the comment.

    See also setComment().

    void CoordinateList::debugPutStdErr()

    Outputs a string listing all the Coordinates using qDebug().

    void CoordinateList::empty()

    Clears this CoordinateList of all its Coordinates.

    The Coordinates instances are free'd.

    bool CoordinateList::encompassIndex(int index) const

    Returns true if index is found to be between the start and end indices of at least one Coordinates instance in this CoordinateList, false otherwise.

    QString CoordinateList::indicesAsText() const

    Returns a string documenting the Coordinates in this CoordinateList.

    Each Coordinates instance is described like the following with the values being the indices m_start and m_end:

    [156-350]

    See also positionsAsText().

    bool CoordinateList::isLeftMostCoordinates(Coordinates *coordinates) const

    Returns true if coordinates is the left-most Coordinates in this CoordinateList. false otherwise.

    bool CoordinateList::isRightMostCoordinates(Coordinates *coordinates) const

    Returns true if coordinates is the right-most Coordinates in this CoordinateList. false otherwise.

    int CoordinateList::leftMostCoordinates(QList<int> &index_list) const

    Searches all the Coordinates that have the smallest m_start value.

    Searches all the Coordinates instances in this CoordinateList that share the same Coordinates::m_start value that is actually the smallest such value in the list. Each found Coordinates instance's index in this CoordinateList is added to index_list.

    Note: index_list is first emptied.

    Returns the count of Coordinates instances added to index_list.

    See also rightMostCoordinates(), isLeftMostCoordinates(), and isRightMostCoordinates.

    bool CoordinateList::overlap() const

    Returns true if at least two Coordinates instances overlap.

    Two Coordinates instances overlap if the second's m_start member is less than the first's m_end and greater than the first's m_start.

    See also encompassIndex().

    QString CoordinateList::positionsAsText() const

    Returns a string documenting the Coordinates in this CoordinateList.

    Each Coordinates instance is described like the following with the values being the indices m_start+1 and m_end+1:

    [157-351]

    Note: The values reported are not indices, but positions.

    See also indicesAsText().

    int CoordinateList::rightMostCoordinates(QList<int> &index_list) const

    Searches all the Coordinates that have the greatest m_end value.

    Searches all the Coordinates instances in this CoordinateList that share the same Coordinates::m_end value that is actually the greatest such value in the list. Each found Coordinates instance's index in this CoordinateList is added to index_list.

    Note: index_list is first emptied.

    Returns the count of Coordinates instances added to index_list.

    See also leftMostCoordinates(), isLeftMostCoordinates(), and isRightMostCoordinates.

    void CoordinateList::setComment(QString text)

    Sets the comment to text.

    See also comment().

    void CoordinateList::setCoordinates(const Coordinates &coordinates)

    Adds a copy of coordinates to this CoordinateList instance.

    Note: This CoordinateList's list of Coordinates instances is first emptied, essentially replacing its contents with a copy of coordinates.

    void CoordinateList::setCoordinates(const CoordinateList &list)

    Allocates a copy of each Coordinates instance in list and adds it to this CoordinateList instance.

    Note: This CoordinateList's list of Coordinates instances is first emptied, essentially replacing its contents with a copy of those in list.

    int CoordinateList::setCoordinates(const QString &coordinates_string)

    Creates the Coordinates instances based on coordinates_string and add them to this CoordinateList's list of Coordinates.

    Note: This CoordinateList's list of Coordinates instances is first emptied

    The format of the coordinates_string is

    "[228-246]"

    if there are not multiple regions. If there are multiple regions (for example when a cross-link exists), the format changes to account for the multiple regions:

    "[228-246][276-282][247-275]"

    Note: It is expected that the values in the coordinates_string are positions strings and not indices.

    Returns the count of added Coordinates instances or -1 if an error occurred.

    CoordinateList &CoordinateList::operator=(const CoordinateList &other)

    Assigns to this CoordinateList the members of other.

    The copy involves duplicationg all the Coordinates objects in other and all other members.

    Returns a reference to this CoordinateList instance.

    Member Variable Documentation

    QString CoordinateList::m_comment

    This variable holds a comment string.