Class StructureImpl

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Structure

    public class StructureImpl
    extends java.lang.Object
    implements Structure, java.io.Serializable
    Implementation of a PDB Structure. This class provides the data contained in a PDB file. to get structure objects from different sources see io package.
    Since:
    1.4
    Version:
    %I% %G%
    Author:
    Andreas Prlic, Jules Jacobsen
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      StructureImpl()
      Constructs a StructureImpl object.
      StructureImpl​(Chain c)
      construct a Structure object that contains a particular chain
      StructureImpl​(Group g)
      construct a Structure object that only contains a single group
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addChain​(Chain chain)
      Add a new chain.
      void addChain​(Chain chain, int modelnr)
      Add a new chain, if several models are available.
      void addCompound​(Compound compound)
      Add a Compound to this Structure
      void addModel​(java.util.List<Chain> model)
      Add a new model.
      void addSSBond​(Bond ssbond)
      Adds a single disulfide Bond to this structure
      Structure clone()
      returns an identical copy of this structure .
      Chain findChain​(java.lang.String chainId)
      Request a particular chain from a structure.
      Chain findChain​(java.lang.String chainId, int modelnr)
      Request a particular chain from a particular model
      Group findGroup​(java.lang.String chainName, java.lang.String pdbResnum)
      Request a particular group from a structure.
      Group findGroup​(java.lang.String chainId, java.lang.String pdbResnum, int modelnr)
      Request a particular group from a structure.
      Chain getChain​(int number)
      Retrieve a chain by its position within the Structure .
      Chain getChain​(int modelnr, int number)
      Retrieve a chain by its position within the Structure and model number.
      Chain getChainByPDB​(java.lang.String chainId)
      Request a chain by its PDB code by default takes only the first model
      Chain getChainByPDB​(java.lang.String chainId, int modelnr)
      Request a chain by its PDB code by default takes only the first model
      java.util.List<Chain> getChains()
      Retrieve all chains - if it is a NMR structure will return the chains of the first model.
      java.util.List<Chain> getChains​(int modelnr)
      retrieve all chains of a model.
      Compound getCompoundById​(int molId)
      Request a particular compound by its molId (entity_id in mmCIF dictionary)
      java.util.List<Compound> getCompounds()
      Get all the Compounds for this Structure.
      java.util.List<java.util.Map<java.lang.String,​java.lang.Integer>> getConnections()
      Return the connections value.
      PDBCrystallographicInfo getCrystallographicInfo()
      Gets crystallographic information for this structure
      java.util.List<DBRef> getDBRefs()
      Get the list of database references
      java.util.List<Group> getHetGroups()
      Caution: we should probably remove this to avoid confusion.
      java.lang.Long getId()
      get the ID used by Hibernate
      java.lang.String getIdentifier()
      Get a string representing this structure's contents.
      JournalArticle getJournalArticle()
      get the associated publication as defined by the JRNL records in a PDB file.
      java.util.List<Chain> getModel​(int modelnr)
      retrieve all Chains belonging to a model .
      java.lang.String getName()
      Get biological name of Structure.
      java.lang.String getPDBCode()
      Get PDB code of structure.
      PDBHeader getPDBHeader()
      Return the header information for this PDB file
      java.lang.String getPdbId()
      Deprecated.
      java.util.List<java.lang.String> getRanges()
      Deprecated.
      java.util.List<ResidueRange> getResidueRanges()
      Deprecated.
      java.util.List<Site> getSites()  
      java.util.List<Bond> getSSBonds()
      Get the list of disulfide Bonds as they have been defined in the PDB files
      StructureIdentifier getStructureIdentifier()
      Get an identifier corresponding to this structure
      boolean hasChain​(java.lang.String chainId)
      Check if a chain with the id chainId is contained in this structure.
      boolean hasJournalArticle()
      Return whether or not the entry has an associated journal article or publication.
      boolean isBiologicalAssembly()
      Gets flag that indicates if this structure is a biological assembly
      boolean isCrystallographic()
      Whether this Structure is a crystallographic structure or not.
      boolean isNmr()
      Whether this Structure is a NMR structure or not.
      int nrModels()
      return number of models.
      void resetModels()
      Resets all models of this Structure
      void setBiologicalAssembly​(boolean biologicalAssembly)
      Sets a flag to indicate if this structure is a biological assembly
      void setChains​(int modelnr, java.util.List<Chain> chains)
      Set the chains for a model
      void setChains​(java.util.List<Chain> chains)
      Set the chains of a structure, if this is a NMR structure, this will only set model 0.
      void setCompounds​(java.util.List<Compound> molList)
      Set the Compounds
      void setConnections​(java.util.List<java.util.Map<java.lang.String,​java.lang.Integer>> conns)
      sets/gets an List of Maps which corresponds to the CONECT lines in the PDB file:
      void setCrystallographicInfo​(PDBCrystallographicInfo crystallographicInfo)
      Sets crystallographic information for this structure
      void setDBRefs​(java.util.List<DBRef> dbrefs)
      Set the list of database references for this structure
      void setId​(java.lang.Long id)
      set the ID used by Hibernate
      void setJournalArticle​(JournalArticle journalArticle)
      set the associated publication as defined by the JRNL records in a PDB file.
      void setModel​(int position, java.util.List<Chain> model)
      A convenience function if one wants to edit and replace the models in a structure.
      void setName​(java.lang.String nam)
      Set biological name of Structure .
      void setNmr​(boolean nmr)
      Deprecated.
      void setPDBCode​(java.lang.String pdb_id_)
      Set PDB code of structure .
      void setPDBHeader​(PDBHeader pdbHeader)
      Set the the header information for this PDB file
      void setSites​(java.util.List<Site> sites)  
      void setSSBonds​(java.util.List<Bond> ssbonds)
      Set the list of SSBonds for this structure
      void setStructureIdentifier​(StructureIdentifier structureIdentifier)
      Set the identifier corresponding to this structure
      int size()
      return number of chains , if NMR return number of chains of first model .
      int size​(int modelnr)
      return number of chains of model.
      java.lang.String toMMCIF()
      Create a String that contains this Structure's contents in MMCIF file format.
      java.lang.String toPDB()
      Create a String that contains this Structure's contents in PDB file format.
      java.lang.String toString()
      string representation.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • StructureImpl

        public StructureImpl()
        Constructs a StructureImpl object.
      • StructureImpl

        public StructureImpl​(Group g)
        construct a Structure object that only contains a single group
        Parameters:
        g -
      • StructureImpl

        public StructureImpl​(Chain c)
        construct a Structure object that contains a particular chain
        Parameters:
        c -
    • Method Detail

      • getId

        public java.lang.Long getId()
        get the ID used by Hibernate
        Specified by:
        getId in interface Structure
        Returns:
        the ID used by Hibernate
      • setId

        public void setId​(java.lang.Long id)
        set the ID used by Hibernate
        Specified by:
        setId in interface Structure
        Parameters:
        id -
      • clone

        public Structure clone()
        returns an identical copy of this structure .
        Specified by:
        clone in interface Structure
        Overrides:
        clone in class java.lang.Object
        Returns:
        an identical Structure object
      • findGroup

        public Group findGroup​(java.lang.String chainId,
                               java.lang.String pdbResnum,
                               int modelnr)
                        throws StructureException
        Request a particular group from a structure. considers only model nr X. count starts with 0.
        Specified by:
        findGroup in interface Structure
        Parameters:
        chainId - the ID of the chain to use
        pdbResnum - the PDB residue number of the requested group
        modelnr - the number of the model to use
        Returns:
        Group the requested Group
        Throws:
        StructureException
      • findGroup

        public Group findGroup​(java.lang.String chainName,
                               java.lang.String pdbResnum)
                        throws StructureException
        Request a particular group from a structure. by default considers only the first model in the structure.
        Specified by:
        findGroup in interface Structure
        Parameters:
        chainName - the ID of the chain to use
        pdbResnum - the PDB residue number of the requested group
        Returns:
        Group the requested Group
        Throws:
        StructureException
      • findChain

        public Chain findChain​(java.lang.String chainId,
                               int modelnr)
                        throws StructureException
        Request a particular chain from a particular model
        Specified by:
        findChain in interface Structure
        Parameters:
        chainId - the ID of a chain that should be returned
        modelnr - the number of the model to use
        Returns:
        Chain the requested chain
        Throws:
        StructureException
      • findChain

        public Chain findChain​(java.lang.String chainId)
                        throws StructureException
        Request a particular chain from a structure. by default considers only the first model.
        Specified by:
        findChain in interface Structure
        Parameters:
        chainId - the ID of a chain that should be returned
        Returns:
        Chain the requested chain
        Throws:
        StructureException
      • setPDBCode

        public void setPDBCode​(java.lang.String pdb_id_)
        Set PDB code of structure .
        Specified by:
        setPDBCode in interface Structure
        Parameters:
        pdb_id_ - a String specifying the PDBCode
        See Also:
        Structure.getPDBCode()
      • setName

        public void setName​(java.lang.String nam)
        Set biological name of Structure .
        Specified by:
        setName in interface Structure
        Parameters:
        nam - a String specifying the biological name of the Structure
        See Also:
        Structure.getName()
      • getStructureIdentifier

        public StructureIdentifier getStructureIdentifier()
        Description copied from interface: Structure
        Get an identifier corresponding to this structure
        Specified by:
        getStructureIdentifier in interface Structure
        Returns:
        The StructureIdentifier used to create this structure
      • setStructureIdentifier

        public void setStructureIdentifier​(StructureIdentifier structureIdentifier)
        Description copied from interface: Structure
        Set the identifier corresponding to this structure
        Specified by:
        setStructureIdentifier in interface Structure
        Parameters:
        structureIdentifier - the structureIdentifier corresponding to this structure
      • setConnections

        public void setConnections​(java.util.List<java.util.Map<java.lang.String,​java.lang.Integer>> conns)
        sets/gets an List of Maps which corresponds to the CONECT lines in the PDB file:
                   COLUMNS         DATA TYPE        FIELD           DEFINITION
                   ---------------------------------------------------------------------------------
                        1 -  6         Record name      "CONECT"
                        7 - 11         Integer          serial          Atom serial number
                   12 - 16         Integer          serial          Serial number of bonded atom
                   17 - 21         Integer          serial          Serial number of bonded atom
                   22 - 26         Integer          serial          Serial number of bonded atom
                   27 - 31         Integer          serial          Serial number of bonded atom
                   32 - 36         Integer          serial          Serial number of hydrogen bonded
                   atom
                   37 - 41         Integer          serial          Serial number of hydrogen bonded
                   atom
                   42 - 46         Integer          serial          Serial number of salt bridged
                   atom
                   47 - 51         Integer          serial          Serial number of hydrogen bonded
                   atom
                   52 - 56         Integer          serial          Serial number of hydrogen bonded
                   atom
                   57 - 61         Integer          serial          Serial number of salt bridged
                   atom
                   
        the HashMap for a single CONECT line contains the following fields:
      • atomserial (mandatory) : Atom serial number
      • bond1 .. bond4 (optional): Serial number of bonded atom
      • hydrogen1 .. hydrogen4 (optional):Serial number of hydrogen bonded atom
      • salt1 .. salt2 (optional): Serial number of salt bridged atom
Specified by:
setConnections in interface Structure
Parameters:
conns - a List object specifying the connections
See Also:
Structure.getConnections()