Interface Chain

  • All Superinterfaces:
    Serializable
    All Known Implementing Classes:
    ChainImpl

    public interface Chain
    extends Serializable

    Defines the interface for a Chain. A Chain corresponds to a Chain in a PDB file. A chain consists of a list of Group objects. A Group can either be an AminoAcid, Hetatom or Nucleotide.

    The BioJava API provides access to both the ATOM and SEQRES records in a PDB file. During parsing of a PDB file it aligns the ATOM and SEQRES groups and joins them. The SEQRES sequence can be accessed via getSeqResGroups() and the ATOM groups via getAtomGroups(). Groups that have been observed (i.e. they are in the ATOM records) can be detected by Group.has3D()

    Since:
    1.4
    Version:
    %I% %G%
    Author:
    Andreas Prlic
    • Method Detail

      • clone

        Object clone()
        Returns an identical copy of this Chain.
        Returns:
        an identical copy of this Chain
      • addGroup

        void addGroup​(Group group)
        Add a group to the list of ATOM record group of this chain. To add SEQRES records a more complex alignment between ATOM and SEQRES residues is required, please see SeqRes2AtomAligner for more details on that.
        Parameters:
        group - a Group object
      • setId

        void setId​(String asymId)
        Set the 'private' asymId (internal chain IDs in mmCif) for this chain.
        Parameters:
        asymId - the internal chain Id
      • setName

        void setName​(String authId)
        Set the 'public' authId (chain ID in PDB file)
        Parameters:
        authId - the 'public' authId (chain ID in PDB file)
        See Also:
        getId()
      • getName

        String getName()
        Get the 'public' authId (chain ID in PDB file)
        Returns:
        the authId for this chain.
        See Also:
        getId()
      • getAtomGroup

        Group getAtomGroup​(int position)
        Return the Group at given position, from within Groups with observed density in the chain, i.e. those with coordinates in ATOM and HETATMS (including waters) records.
        Parameters:
        position - an int
        Returns:
        a Group object
        See Also:
        getAtomLength(), getAtomGroups(), getSeqResGroup(int)
      • setAtomGroups

        void setAtomGroups​(List<Group> groups)
        Set all Groups with observed density in the chain, i.e. those with coordinates in ATOM and HETATMs (including waters) records.
        Parameters:
        groups - a List object representing the Groups of this Chain.
        See Also:
        getAtomGroups()
      • getGroupsByPDB

        Group[] getGroupsByPDB​(ResidueNumber pdbresnumStart,
                               ResidueNumber pdbresnumEnd)
                        throws StructureException
        Get all groups that are located between two PDB residue numbers.
        Parameters:
        pdbresnumStart - PDB residue number of start. If null, defaults to the chain start.
        pdbresnumEnd - PDB residue number of end. If null, defaults to the chain end.
        Returns:
        Groups in between. or throws a StructureException if either start or end can not be found,
        Throws:
        StructureException
      • getGroupsByPDB

        Group[] getGroupsByPDB​(ResidueNumber pdbresnumStart,
                               ResidueNumber pdbresnumEnd,
                               boolean ignoreMissing)
                        throws StructureException
        Get all groups that are located between two PDB residue numbers. In contrast to getGroupsByPDB this method call ignores if the exact outer groups are not found. This is useful e.g. when requesting the range of groups as specified by the DBREF records - these frequently are rather inaccurate.
        Parameters:
        pdbresnumStart - PDB residue number of start. If null, defaults to the chain start.
        pdbresnumEnd - PDB residue number of end. If null, defaults to the chain end.
        ignoreMissing - ignore missing groups in this range.
        Returns:
        Groups in between. or throws a StructureException if either start or end can not be found,
        Throws:
        StructureException
      • getAtomLength

        int getAtomLength()
        Returns the number of Groups with observed density in the chain, i.e. those with coordinates in ATOM and HETATMs (including waters) records
        Returns:
        the length
        See Also:
        getAtomGroup(int), getAtomGroups()
      • getBJSequence

        Sequence<?> getBJSequence()
        Converts the SEQRES groups of a Chain to a Biojava Sequence object.
        Returns:
        the SEQRES groups of the Chain as a Sequence object.
      • getSeqResSequence

        String getSeqResSequence()
        Returns the PDB SEQRES sequence as a one-letter sequence string. Non-standard residues are represented by an "X".
        Returns:
        one-letter PDB SEQRES sequence as string
        See Also:
        getAtomSequence()
      • setSeqResGroups

        void setSeqResGroups​(List<Group> seqResGroups)
        Sets the list of SeqResGroups for this chain.
        Parameters:
        seqResGroups - a List of Group objects that from the SEQRES groups of this chain.
        See Also:
        getSeqResGroups()
      • setStructure

        void setStructure​(Structure parent)
        Sets the back-reference to its parent Structure.
        Parameters:
        parent -
      • toPDB

        String toPDB()
        Convert this Chain to a String in PDB format
        Returns:
      • toMMCIF

        String toMMCIF()
        Convert this Chain to a String in mmCIF format
        Returns:
      • setSeqMisMatches

        void setSeqMisMatches​(List<SeqMisMatch> seqMisMatches)
        Sets annotated sequence mismatches for this chain. This is based on the STRUCT_REF_SEQ_DIF mmCif category
        Parameters:
        seqMisMatches -
      • getSeqMisMatches

        List<SeqMisMatchgetSeqMisMatches()
        Gets annotated sequence mismatches for this chain. This is based on the STRUCT_REF_SEQ_DIF mmCif category
        Returns:
        a list of sequence mismatches (or null if none found)
      • isWaterOnly

        boolean isWaterOnly()
        Tests if a chain is consisting of water molecules only
        Returns:
        true if there are only solvent molecules in this chain.
      • isPureNonPolymer

        boolean isPureNonPolymer()
        Returns true if the given chain is composed of non-polymeric (including water) groups only.
        Returns:
        true if only non-polymeric groups in this chain.
Returns:
the predominant group type