Ejemplo n.º 1
0
    def get_segids(self):
        """
        Obtain all the currently defined segment IDs.

        Returns:
            (list of str): All defined segids in current molecule
        """
        return _psfgen.query_segment(psfstate=self._data, task="segids")
Ejemplo n.º 2
0
    def get_last(self, segid):
        """
        Get the name of the patch applied to the end of a given segment

        Args:
            segid (str): Segment ID to query

        Returns:
            (str): Patch name, or None
        """
        return _psfgen.query_segment(psfstate=self._data,
                                     task="last",
                                     segid=segid)
Ejemplo n.º 3
0
    def get_resids(self, segid):
        """
        Obtain all currently defined resids in a given segment

        Args:
            segid (str): Segment ID to query

        Returns:
            (list of str): All defined resids in given segment
        """
        return _psfgen.query_segment(psfstate=self._data,
                                     task="resids",
                                     segid=segid)
Ejemplo n.º 4
0
    def get_resname(self, segid, resid):
        """
        Obtains the residue name given a resid and segment

        Args:
            segid (str): Segment ID to query
            resid (str or int): Residue ID to query

        Returns:
            (str): Residue name
        """
        # Handle integer resid, just turn it into a string
        if isinstance(resid, int):
            resid = str(resid)

        return _psfgen.query_segment(psfstate=self._data,
                                     task="residue",
                                     segid=segid,
                                     resid=resid)