Class ChainImpl

  • All Implemented Interfaces:
    java.io.Serializable, Chain

    public class ChainImpl
    extends java.lang.Object
    implements Chain, java.io.Serializable
    A Chain in a PDB file. It contains several groups which can be of one of the types defined in the GroupType constants.
    Since:
    1.4
    Author:
    Andreas Prlic, Jules Jacobsen
    See Also:
    Serialized Form
    • Field Detail

      • DEFAULT_CHAIN_ID

        public static java.lang.String DEFAULT_CHAIN_ID
        The default chain identifier used to be an empty space
    • Constructor Detail

      • ChainImpl

        public ChainImpl()
        Constructs a ChainImpl object.
    • Method Detail

      • getId

        public java.lang.Long getId()
        Get the ID used by Hibernate.
        Specified by:
        getId in interface Chain
        Returns:
        the ID used by Hibernate
        See Also:
        Chain.setId(Long)
      • setId

        public void setId​(java.lang.Long id)
        Set the ID used by Hibernate.
        Specified by:
        setId in interface Chain
        Parameters:
        id - assigned by Hibernate
        See Also:
        Chain.getId()
      • setParent

        @Deprecated
        public void setParent​(Structure parent)
        Deprecated.
        Sets the back-reference to its parent Structure.
        Specified by:
        setParent in interface Chain
        Parameters:
        parent - the parent Structure object for this Chain
        See Also:
        Chain.getStructure()
      • setStructure

        public void setStructure​(Structure parent)
        Sets the back-reference to its parent Structure.
        Specified by:
        setStructure in interface Chain
      • clone

        public java.lang.Object clone()
        Returns an identical copy of this Chain .
        Specified by:
        clone in interface Chain
        Overrides:
        clone in class java.lang.Object
        Returns:
        an identical copy of this Chain
      • setSwissprotId

        public void setSwissprotId​(java.lang.String sp_id)
        set the Swissprot id of this chains .
        Specified by:
        setSwissprotId in interface Chain
        Parameters:
        sp_id - a String specifying the swissprot id value
        See Also:
        getSwissprotId()
      • addGroup

        public 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.
        Specified by:
        addGroup in interface Chain
        Parameters:
        group - a Group object
      • setAtomGroups

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

        @Deprecated
        public Group[] getGroupsByPDB​(ResidueNumber start,
                                      ResidueNumber end,
                                      boolean ignoreMissing)
                               throws StructureException
        Deprecated.
        Description copied from interface: Chain
        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.
        Specified by:
        getGroupsByPDB in interface Chain
        Parameters:
        start - PDB residue number of start
        end - PDB residue number of 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
      • getGroupByPDB

        public Group getGroupByPDB​(ResidueNumber resNum)
                            throws StructureException
        Get a group by its PDB residue numbering. If the PDB residue number is not known, throws a StructureException.
        Specified by:
        getGroupByPDB in interface Chain
        Parameters:
        resNum - the PDB residue number of the group
        Returns:
        the matching group
        Throws:
        StructureException
      • getGroupsByPDB

        public Group[] getGroupsByPDB​(ResidueNumber start,
                                      ResidueNumber end)
                               throws StructureException
        Get all groups that are located between two PDB residue numbers.
        Specified by:
        getGroupsByPDB in interface Chain
        Parameters:
        start - PDB residue number of start
        end - PDB residue number of end
        Returns:
        Groups in between. or throws a StructureException if either start or end can not be found,
        Throws:
        StructureException
      • setChainID

        public void setChainID​(java.lang.String nam)
        Sets the name of this chain (Chain id in PDB file ).
        Specified by:
        setChainID in interface Chain
        Parameters:
        nam - a String specifying the name value
        See Also:
        Chain.getChainID()
      • getChainID

        public java.lang.String getChainID()
        Gets the name of this chain (Chain id in PDB file ).
        Specified by:
        getChainID in interface Chain
        Returns:
        a String representing the name value
        See Also:
        Chain.setChainID(String)
      • toString

        public java.lang.String toString()
        String representation.
        Specified by:
        toString in interface Chain
        Overrides:
        toString in class java.lang.Object
        Returns:
        String representation of the Chain
      • getBJSequence

        public Sequence<?> getBJSequence()
        Converts the SEQRES groups of a Chain to a Biojava Sequence object.
        Specified by:
        getBJSequence in interface Chain
        Returns:
        the SEQRES groups of the Chain as a Sequence object.
      • getAtomSequence

        public java.lang.String getAtomSequence()
        Returns the sequence of amino acids as it has been provided in the ATOM records. Non-standard residues will be present in the string only if the property has been set.
        Specified by:
        getAtomSequence in interface Chain
        Returns:
        amino acid sequence as string
        See Also:
        Chain.getSeqResSequence()
      • getSeqResSequence

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

        public void setSeqResGroups​(java.util.List<Group> groups)
        Sets the list of SeqResGroups for this chain.
        Specified by:
        setSeqResGroups in interface Chain
        Parameters:
        groups - a List of Group objects that from the SEQRES groups of this chain.
        See Also:
        Chain.getSeqResGroups()
      • addSeqResGroup

        protected void addSeqResGroup​(Group g)
      • getAtomLength

        public 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
        Specified by:
        getAtomLength in interface Chain
        Returns:
        the length
        See Also:
        Chain.getAtomGroup(int), Chain.getAtomGroups()
      • getAtomLigands

        public java.util.List<Group> getAtomLigands()
        Gets all groups that are not polymer groups and that are not solvent groups. Will automatically fetch Chemical Component files from the PDB web site, even if FileParsingParameters#setLoadChemCompInfo(boolean) has not been set to true. Otherwise the Ligands could not correctly be identified.
        Specified by:
        getAtomLigands in interface Chain
        Returns:
        list of Groups that are ligands
      • getInternalChainID

        public java.lang.String getInternalChainID()
        Description copied from interface: Chain
        If available, returns the internal chain ID that is used in mmCIF files (asym_id), otherwise null
        Specified by:
        getInternalChainID in interface Chain
        Returns:
        String or null
      • setInternalChainID

        public void setInternalChainID​(java.lang.String internalChainID)
        Description copied from interface: Chain
        Sets the internal chain ID that is used in mmCif files
        Specified by:
        setInternalChainID in interface Chain
      • toPDB

        public java.lang.String toPDB()
        Description copied from interface: Chain
        Convert this Chain to a String in PDB format
        Specified by:
        toPDB in interface Chain
        Returns:
      • toMMCIF

        public java.lang.String toMMCIF()
        Description copied from interface: Chain
        Convert this Chain to a String in mmCIF format
        Specified by:
        toMMCIF in interface Chain
        Returns:
      • setSeqMisMatches

        public void setSeqMisMatches​(java.util.List<SeqMisMatch> seqMisMatches)
        Description copied from interface: Chain
        Set annotated sequence mismatches for this chain. This is based on the STRUCT_REF_SEQ_DIF mmCif category
        Specified by:
        setSeqMisMatches in interface Chain
      • getSeqMisMatches

        public java.util.List<SeqMisMatch> getSeqMisMatches()
        Description copied from interface: Chain
        Get annotated sequence mismatches for this chain. This is based on the STRUCT_REF_SEQ_DIF mmCif category
        Specified by:
        getSeqMisMatches in interface Chain