Interface Structure

  • All Superinterfaces:
    java.lang.Cloneable, java.io.Serializable
    All Known Implementing Classes:
    StructureImpl

    public interface Structure
    extends java.lang.Cloneable, java.io.Serializable
    Interface for a structure object. Provides access to the data of a PDB file. A structure object allows to access the PDB header information as well as to the data from the ATOM records. The header information is currently available through the following objects: The structure object provides access to the data from the ATOM records through a hierarchy of sub-object:
     Structure
             |
             Chain
                 |
                 Group
                     |
                     Atom
     
    For more documentation on how to work with the Structure API please see http://biojava.org/wiki/BioJava:CookBook#Protein_Structure

    The tutorial for the BioJava structure modules can be found at github.


    Q: How can I get a Structure object from a PDB file?

    A:

      Structure loadStructure(String pathToPDBFile){
                    PDBFileReader pdbreader = new PDBFileReader();
    
                    Structure structure = null;
                    try{
                            structure = pdbreader.getStructure(pathToPDBFile);
                            System.out.println(structure);
                    } catch (IOException e) {
                            e.printStackTrace();
                    }
                    return structure;
            }
      

    Q: How can I calculate Phi and Psi angles of AminoAcids?

    A:

      void calcPhiPsi(Structure structure){
    
    
                    // get the first chain from the structure
    
                    Chain chain  = structure.getChain(0);
    
                    // A protein chain consists of a number of groups. These can be either
                    // AminoAcid, Hetatom or Nucleotide groups.
                    //
                    // Note: BioJava provides access to both the ATOM and SEQRES data in a PDB file.
                    // since we are interested in doing calculations here, we only request the groups
                    // from the ATOM records
    
                    //  get the Groups of the chain that are AminoAcids.
                    List groups = chain.getAtomGroups(GroupType.AMINOACID);
    
                    AminoAcid a;
                    AminoAcid b;
                    AminoAcid c ;
    
                    for ( int i=0; i < groups.size(); i++){
    
                            // since we requested only groups of type AMINOACID they will always be amino acids
                            // Nucleotide and Hetatom groups will not be present in the groups list.
    
                            b = (AminoAcid)groups.get(i);
    
                            double phi =360.0;
                            double psi =360.0;
    
                            if ( i > 0) {
                                    a = (AminoAcid)groups.get(i-1) ;
                                    try {
    
                                            // the Calc class provides utility methods for various calculations on
                                            // structures, groups and atoms
    
                                            phi = Calc.getPhi(a,b);
                                    } catch (StructureException e){
                                            e.printStackTrace();
                                            phi = 360.0 ;
                                    }
                            }
                            if ( i < groups.size()-1) {
                                    c = (AminoAcid)groups.get(i+1) ;
                                    try {
                                            psi = Calc.getPsi(b,c);
                                    }catch (StructureException e){
                                            e.printStackTrace();
                                            psi = 360.0 ;
                                    }
                            }
    
                            System.out.print(b.getPDBCode() + " " + b.getPDBName() + ":"  );
    
                            System.out.println(String.format("\tphi: %+7.2f psi: %+7.2f", phi, psi));
    
                    }
     

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

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      void addChain​(Chain chain)
      Add a new chain to the first model
      void addChain​(Chain chain, int modelnr)
      Add a new chain to the model specified by the given index
      void addEntityInfo​(EntityInfo entityInfo)
      Add an EntityInfo to this Structure
      void addModel​(java.util.List<Chain> model)
      Add a new model.
      void addSSBond​(Bond ssbond)
      Add a single disulfide Bond to this structure
      Structure clone()
      Return an identical copy of this Structure object
      Chain findChain​(java.lang.String authId)
      Deprecated.
      Chain findChain​(java.lang.String authId, int modelnr)
      Deprecated.
      Group findGroup​(java.lang.String authId, java.lang.String pdbResnum)
      Request a particular group from a structure.
      Group findGroup​(java.lang.String authId, java.lang.String pdbResnum, int modelnr)
      Request a particular group from a structure.
      Chain getChain​(java.lang.String asymId)
      Retrieve a Chain (polymeric, non-polymeric or water) based on the 'internal' chain id (asymId) for the first model
      Chain getChain​(java.lang.String asymId, int modelIdx)
      Retrieve a Chain (polymeric, non-polymeric or water) based on the 'internal' chain id (asymId) for the given model index
      Chain getChainByIndex​(int chainIndex)
      Retrieve a chain by its index within the Structure .
      Chain getChainByIndex​(int modelnr, int chainIndex)
      Retrieve a chain by its indices within the Structure and model.
      Chain getChainByPDB​(java.lang.String authId)
      Deprecated.
      Chain getChainByPDB​(java.lang.String authId, int modelIdx)
      Deprecated.
      java.util.List<Chain> getChains()
      Retrieve all chains for the first model.
      java.util.List<Chain> getChains​(int modelnr)
      Retrieve all chains of a model.
      EntityInfo getCompoundById​(int entityId)
      Deprecated.
      use getEntityById(int) instead
      PDBCrystallographicInfo getCrystallographicInfo()
      Get crystallographic information for this structure
      java.util.List<DBRef> getDBRefs()
      Get the list of database references
      EntityInfo getEntityById​(int entityId)
      Request a particular entity by its entity id (mol id in legacy PDB format)
      java.util.List<EntityInfo> getEntityInfos()
      Get all the EntityInfo for this Structure.
      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.
      Chain getNonPolyChain​(java.lang.String asymId)
      Retrieve a non-polymeric Chain based on the 'internal' chain id (asymId) for the first model
      Chain getNonPolyChain​(java.lang.String asymId, int modelIdx)
      Retrieve a non-polymeric Chain based on the 'internal' chain id (asymId) for the given model index
      java.util.List<Chain> getNonPolyChains()
      Return all non-polymeric chains for the first model
      java.util.List<Chain> getNonPolyChains​(int modelIdx)
      Return all non-polymeric chains for the given model index.
      java.util.List<Chain> getNonPolyChainsByPDB​(java.lang.String authId)
      Retrieve all non-polymeric Chains corresponding to the given 'public' chain name (authId) for the first model.
      java.util.List<Chain> getNonPolyChainsByPDB​(java.lang.String authId, int modelIdx)
      Retrieve all non-polymeric Chains corresponding to the 'public' chain name (authId) and the given model index.
      java.lang.String getPDBCode()
      Get PDB code of structure.
      PDBHeader getPDBHeader()
      Return the header information for this PDB file
      java.lang.String getPdbId()
      Deprecated.
      From BioJava 4.2, use getPDBCode() or getStructureIdentifier().toCanonical().getPdbId()
      Chain getPolyChain​(java.lang.String asymId)
      Retrieve a polymeric Chain based on the 'internal' chain id (asymId) for the first model
      Chain getPolyChain​(java.lang.String asymId, int modelIdx)
      Retrieve a polymeric Chain based on the 'internal' chain id (asymId) for the given model index
      Chain getPolyChainByPDB​(java.lang.String authId)
      Retrieve a polymeric Chain based on the 'public' chain name (authId) for the first model
      Chain getPolyChainByPDB​(java.lang.String authId, int modelIdx)
      Retrieve a polymeric Chain based on the 'public' chain name (authId) for the given model index.
      java.util.List<Chain> getPolyChains()
      Return all polymeric chains for the first model
      java.util.List<Chain> getPolyChains​(int modelIdx)
      Return all polymeric chains for the given model index.
      java.util.List<java.lang.String> getRanges()
      Deprecated.
      From BioJava 4.2, use getStructureIdentifier().toCanonical().getRanges()
      java.util.List<? extends ResidueRange> getResidueRanges()
      Deprecated.
      From BioJava 4.2, use getStructureIdentifier().toCanonical().getResidueRanges()
      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
      Chain getWaterChain​(java.lang.String asymId)
      Retrieve a water Chain based on the 'internal' chain id (asymId) for the first model
      Chain getWaterChain​(java.lang.String asymId, int modelIdx)
      Retrieve a water chain based on the 'internal' chain id (asymId) for the given model index
      Chain getWaterChainByPDB​(java.lang.String authId)
      Retrieve a water Chain based on the 'public' chain name (authId) for the first model
      Chain getWaterChainByPDB​(java.lang.String authId, int modelIdx)
      Retrieve a water Chain based on the 'public' chain name (authId) for the given model index
      java.util.List<Chain> getWaterChains()
      Return all water chains for the first model
      java.util.List<Chain> getWaterChains​(int modelIdx)
      Return all water chains for the given model index
      boolean hasChain​(java.lang.String asymId)
      Check if a chain with the chainId aymId is contained in this structure.
      boolean hasJournalArticle()
      Return whether or not the entry has an associated journal article or ation.
      boolean hasNonPolyChain​(java.lang.String asymId)
      Check if a non polymeric chain with chainId asymId is contained in the structure.
      boolean hasPdbChain​(java.lang.String authId)
      Check if a chain with chain name authId is contained in the structure
      boolean isBiologicalAssembly()
      Get flag that indicates if this structure is a biological assembly
      boolean isCrystallographic()
      Test if this structure is a crystallographic structure, i.e.
      boolean isNmr()
      Test if this structure is an NMR structure.
      int nrModels()
      Return the number of models .
      void resetModels()
      Resets all models of this Structure
      void setBiologicalAssembly​(boolean biologicalAssembly)
      Set 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 setCrystallographicInfo​(PDBCrystallographicInfo crystallographicInfo)
      Set crystallographic information for this structure
      void setDBRefs​(java.util.List<DBRef> dbrefs)
      Set the list of database references for this structure
      void setEntityInfos​(java.util.List<EntityInfo> molList)
      Set the EntityInfo
      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 name)
      Set biological name of Structure .
      void setPDBCode​(java.lang.String pdb_id)
      Set PDB code of structure .
      void setPDBHeader​(PDBHeader header)
      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 polymer Chains in this Structure for 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 of object.
    • Method Detail

      • clone

        Structure clone()
        Return an identical copy of this Structure object
        Returns:
        identical copy of this Structure object
      • toString

        java.lang.String toString()
        String representation of object.
        Overrides:
        toString in class java.lang.Object
      • setPDBCode

        void setPDBCode​(java.lang.String pdb_id)
        Set PDB code of structure .
        Parameters:
        pdb_id - a String specifying the PDBCode
        See Also:
        getPDBCode()
      • getPDBCode

        java.lang.String getPDBCode()
        Get PDB code of structure.
        Returns:
        a String representing the PDBCode value
        See Also:
        setPDBCode(java.lang.String)
      • setName

        void setName​(java.lang.String name)
        Set biological name of Structure .
        Parameters:
        name - a String specifying the biological name of the Structure
        See Also:
        getName()
      • getName

        java.lang.String getName()
        Get biological name of Structure.
        Returns:
        a String representing the biological name of the Structure
        See Also:
        setName(java.lang.String)
      • getStructureIdentifier

        StructureIdentifier getStructureIdentifier()
        Get an identifier corresponding to this structure
        Returns:
        The StructureIdentifier used to create this structure
      • setStructureIdentifier

        void setStructureIdentifier​(StructureIdentifier structureIdentifier)
        Set the identifier corresponding to this structure
        Parameters:
        structureIdentifier - the structureIdentifier corresponding to this structure
      • size

        int size()
        Return number of polymer Chains in this Structure for first model.
        Returns:
        the number of polymer Chains in this Structure
      • size

        int size​(int modelnr)
        Return number of chains of model.
        Parameters:
        modelnr - an int specifying the number of the Model that should be used
        Returns:
        an int representing the number of Chains in this Model
      • nrModels

        int nrModels()
        Return the number of models . In this implementation also XRAY structures have "1 model", since model is the container for the chains. to test if a Structure is an NMR structure use isNmr().
        Returns:
        an int representing the number of models in this Structure
        See Also:
        isNmr()
      • isNmr

        boolean isNmr()
        Test if this structure is an NMR structure.
        Returns:
        true if this Structure has been solved by NMR
        See Also:
        nrModels()
      • isCrystallographic

        boolean isCrystallographic()
        Test if this structure is a crystallographic structure, i.e. it is an asymmetric unit from which it is possible to reconstruct the crystal lattice given cell parameters and space group.
        Returns:
        true if crystallographic, false otherwise
      • addModel

        void addModel​(java.util.List<Chain> model)
        Add a new model.
        Parameters:
        model - a List object containing the Chains of the new Model
      • setModel

        void setModel​(int position,
                      java.util.List<Chain> model)
        A convenience function if one wants to edit and replace the models in a structure. Allows to set (replace) the model at position with the new List of Chains.
        Parameters:
        position - starting at 0
        model - list of chains representing a model
      • getModel

        java.util.List<Chain> getModel​(int modelnr)
        Retrieve all Chains belonging to a model .
        Parameters:
        modelnr - an int
        Returns:
        a List object containing the Chains of Model nr. modelnr
        See Also:
        getChains(int modelnr)
      • getChains

        java.util.List<Chain> getChains()
        Retrieve all chains for the first model. This is the same as getChains(0);
        Returns:
        a List object containing the Chains of Model nr. modelnr
        See Also:
        getModel(int modelnr), getChains(int modelnr)
      • setChains

        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.
        Parameters:
        chains - the list of chains for this structure.
        See Also:
        setChains(int, List)
      • getChains

        java.util.List<Chain> getChains​(int modelnr)
        Retrieve all chains of a model.
        Parameters:
        modelnr - an int
        Returns:
        a List object containing the Chains of Model nr. modelnr
        See Also:
        getModel(int)
      • setChains

        void setChains​(int modelnr,
                       java.util.List<Chain> chains)
        Set the chains for a model
        Parameters:
        chains - the chains for a model
        modelnr - the number of the model
      • getPolyChains

        java.util.List<Chain> getPolyChains()
        Return all polymeric chains for the first model
        Returns:
        all polymeric chains.
        Since:
        5.0
      • getPolyChains

        java.util.List<Chain> getPolyChains​(int modelIdx)
        Return all polymeric chains for the given model index.
        Parameters:
        modelIdx - the model index
        Returns:
        all polymeric chains.
        Since:
        5.0
      • getNonPolyChains

        java.util.List<Chain> getNonPolyChains()
        Return all non-polymeric chains for the first model
        Returns:
        all non-polymeric chains.
        Since:
        5.0
      • getNonPolyChains

        java.util.List<Chain> getNonPolyChains​(int modelIdx)
        Return all non-polymeric chains for the given model index.
        Parameters:
        modelIdx - the model index
        Returns:
        all non-polymeric chains.
        Since:
        5.0
      • getWaterChains

        java.util.List<Chain> getWaterChains()
        Return all water chains for the first model
        Returns:
        Since:
        5.0
      • getWaterChains

        java.util.List<Chain> getWaterChains​(int modelIdx)
        Return all water chains for the given model index
        Parameters:
        modelIdx -
        Returns:
        Since:
        5.0
      • addChain

        void addChain​(Chain chain)
        Add a new chain to the first model
        Parameters:
        chain - a Chain object
      • addChain

        void addChain​(Chain chain,
                      int modelnr)
        Add a new chain to the model specified by the given index
        Parameters:
        chain - a Chain object
        modelnr - an int specifying to which model the Chain should be added
      • getChainByIndex

        Chain getChainByIndex​(int chainIndex)
        Retrieve a chain by its index within the Structure .
        Parameters:
        chainIndex - the index of the desired chain in the structure
        Returns:
        a Chain object
      • getChainByIndex

        Chain getChainByIndex​(int modelnr,
                              int chainIndex)
        Retrieve a chain by its indices within the Structure and model.
        Parameters:
        chainIndex - the index of the desired chain in the structure
        modelnr - the model the desired chain is in
        Returns:
        a Chain object
      • findChain

        @Deprecated
        Chain findChain​(java.lang.String authId)
                 throws StructureException
        Deprecated.
        Request a particular chain from a structure. by default considers only the first model.
        Parameters:
        authId - name of a chain that should be returned
        Returns:
        Chain the requested chain
        Throws:
        StructureException
      • findChain

        @Deprecated
        Chain findChain​(java.lang.String authId,
                        int modelnr)
                 throws StructureException
        Deprecated.
        Request a particular chain from a particular model
        Parameters:
        authId - the name of a chain that should be returned
        modelnr - the number of the model to use
        Returns:
        Chain the requested chain
        Throws:
        StructureException
      • hasChain

        boolean hasChain​(java.lang.String asymId)
        Check if a chain with the chainId aymId is contained in this structure.
        Parameters:
        asymId - the Id of the chain
        Returns:
        true if a chain with the id asymId is found
      • hasNonPolyChain

        boolean hasNonPolyChain​(java.lang.String asymId)
        Check if a non polymeric chain with chainId asymId is contained in the structure.
        Parameters:
        asymId - the id of the chain
        Returns:
        true if a nonpolymeric chain with the asymId is found
        Since:
        5.0
      • hasPdbChain

        boolean hasPdbChain​(java.lang.String authId)
        Check if a chain with chain name authId is contained in the structure
        Parameters:
        authId - the chain name
        Returns:
        true if a chain with the name authId is found
      • findGroup

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

        Group findGroup​(java.lang.String authId,
                        java.lang.String pdbResnum,
                        int modelnr)
                 throws StructureException
        Request a particular group from a structure. considers only model nr X. count starts with 0.
        Parameters:
        authId - the chain name 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
      • getChainByPDB

        @Deprecated
        Chain getChainByPDB​(java.lang.String authId)
                     throws StructureException
        Deprecated.
        Request a chain by its public id (author id) for the first model. Before 5.0 it returned a Chain that had both polymeric and non-polymeric groups following the PDB-file data model. Since 5.0 it only returns the polymeric part of the chain.
        Parameters:
        authId - the author id (chainName, public chain id)
        Returns:
        the Chain that matches the authId
        Throws:
        StructureException - if chain can't be found
      • getChainByPDB

        @Deprecated
        Chain getChainByPDB​(java.lang.String authId,
                            int modelIdx)
                     throws StructureException
        Deprecated.
        Request a chain by its public id (author id) for the given model index. Before 5.0 it returned a Chain that had both polymeric and non-polymeric groups following the PDB-file data model. Since 5.0 it only returns the polymeric part of the chain.
        Parameters:
        authId - the author id (chainName, public chain id)
        modelIdx - the index of the required model (0-based)
        Returns:
        the Chain that matches the authId in the model
        Throws:
        StructureException - if chain can't be found
      • getPolyChain

        Chain getPolyChain​(java.lang.String asymId)
        Retrieve a polymeric Chain based on the 'internal' chain id (asymId) for the first model

        See getPolyChainByPDB(String) for a similar method using the chain name (authId).

        Parameters:
        asymId - the asymId (chainId)
        Returns:
        a polymeric Chain or null if it can't be found
        Since:
        5.0
      • getPolyChain

        Chain getPolyChain​(java.lang.String asymId,
                           int modelIdx)
        Retrieve a polymeric Chain based on the 'internal' chain id (asymId) for the given model index

        See getPolyChainByPDB(String, int) for a similar method using the chain name (authId).

        Parameters:
        asymId - the asymId (chainId)
        modelIdx - the index of the required model (0-based)
        Returns:
        a polymeric Chain or null if it can't be found
        Since:
        5.0
      • getPolyChainByPDB

        Chain getPolyChainByPDB​(java.lang.String authId)
        Retrieve a polymeric Chain based on the 'public' chain name (authId) for the first model

        See getPolyChain(String) for a similar method using the chain id (asymId).

        Parameters:
        authId - the author id (chainName, public chain id)
        Returns:
        a polymeric Chain or null if it can't be found
        Since:
        5.0
      • getPolyChainByPDB

        Chain getPolyChainByPDB​(java.lang.String authId,
                                int modelIdx)
        Retrieve a polymeric Chain based on the 'public' chain name (authId) for the given model index.

        See getPolyChain(String, int) for a similar method using the chain id (asymId).

        Parameters:
        authId - the author id (chainName, public chain id)
        modelIdx - the index of the required model (0-based)
        Returns:
        a polymeric Chain or null if it can't be found
        Since:
        5.0
      • getNonPolyChain

        Chain getNonPolyChain​(java.lang.String asymId)
        Retrieve a non-polymeric Chain based on the 'internal' chain id (asymId) for the first model
        Parameters:
        asymId - the asymId (chainId)
        Returns:
        a non-polymeric chain or null if it can't be found
        Since:
        5.0
      • getNonPolyChain

        Chain getNonPolyChain​(java.lang.String asymId,
                              int modelIdx)
        Retrieve a non-polymeric Chain based on the 'internal' chain id (asymId) for the given model index
        Parameters:
        asymId - the asymId (chainId)
        modelIdx - the index of the required model (0-based)
        Returns:
        a non-polymeric Chain or null if it can't be found
        Since:
        5.0
      • getNonPolyChainsByPDB

        java.util.List<Chain> getNonPolyChainsByPDB​(java.lang.String authId)
        Retrieve all non-polymeric Chains corresponding to the given 'public' chain name (authId) for the first model.
        Parameters:
        authId - the author id (chainName, public chain id)
        Returns:
        a list of non-polymeric Chains, if none found the list will be empty
        Since:
        5.0
      • getNonPolyChainsByPDB

        java.util.List<Chain> getNonPolyChainsByPDB​(java.lang.String authId,
                                                    int modelIdx)
        Retrieve all non-polymeric Chains corresponding to the 'public' chain name (authId) and the given model index.
        Parameters:
        authId - the author id (chainName, public chain id)
        modelIdx - the index of the required model (0-based)
        Returns:
        a list of non-polymeric Chains, if none found the list will be empty
        Since:
        5.0
      • getWaterChain

        Chain getWaterChain​(java.lang.String asymId)
        Retrieve a water Chain based on the 'internal' chain id (asymId) for the first model
        Parameters:
        asymId - the asymId (chainId)
        Returns:
        a water Chain or null if it can't be found
        Since:
        5.0
      • getWaterChain

        Chain getWaterChain​(java.lang.String asymId,
                            int modelIdx)
        Retrieve a water chain based on the 'internal' chain id (asymId) for the given model index
        Parameters:
        asymId - the asymId (chainId)
        modelIdx - the index of the required model (0-based)
        Returns:
        Since:
        5.0
      • getWaterChainByPDB

        Chain getWaterChainByPDB​(java.lang.String authId)
        Retrieve a water Chain based on the 'public' chain name (authId) for the first model
        Parameters:
        authId - the author id (chainName, public chain id)
        Returns:
        Since:
        5.0
      • getWaterChainByPDB

        Chain getWaterChainByPDB​(java.lang.String authId,
                                 int modelIdx)
        Retrieve a water Chain based on the 'public' chain name (authId) for the given model index
        Parameters:
        authId - the author id (chainName, public chain id)
        modelIdx - the index of the required model (0-based)
        Returns:
        Since:
        5.0
      • toPDB

        java.lang.String toPDB()
        Create a String that contains this Structure's contents in PDB file format.
        Returns:
        a String that looks like a PDB file
        See Also:
        FileConvert
      • toMMCIF

        java.lang.String toMMCIF()
        Create a String that contains this Structure's contents in MMCIF file format.
        Returns:
        a String representation of the Structure object in mmCIF.
      • setEntityInfos

        void setEntityInfos​(java.util.List<EntityInfo> molList)
        Set the EntityInfo
        Parameters:
        molList - list of entityinfo objects
      • getEntityInfos

        java.util.List<EntityInfo> getEntityInfos()
        Get all the EntityInfo for this Structure.
        Returns:
        a list of EntityInfos
      • addEntityInfo

        void addEntityInfo​(EntityInfo entityInfo)
        Add an EntityInfo to this Structure
      • setDBRefs

        void setDBRefs​(java.util.List<DBRef> dbrefs)
        Set the list of database references for this structure
        Parameters:
        dbrefs - list of DBRef objects
      • getDBRefs

        java.util.List<DBRef> getDBRefs()
        Get the list of database references
        Returns:
        list of DBRef objects
      • getCompoundById

        @Deprecated
        EntityInfo getCompoundById​(int entityId)
        Deprecated.
        use getEntityById(int) instead
        Request a particular entity by its entity id (mol id in legacy PDB format)
        Parameters:
        entityId - the number of the entity
        Returns:
        a entityInfo
      • getEntityById

        EntityInfo getEntityById​(int entityId)
        Request a particular entity by its entity id (mol id in legacy PDB format)
        Parameters:
        entityId - the number of the entity
        Returns:
        an entity, or null if the molId was not found
      • getPDBHeader

        PDBHeader getPDBHeader()
        Return the header information for this PDB file
        Returns:
        the PDBHeader object
      • hasJournalArticle

        boolean hasJournalArticle()
        Return whether or not the entry has an associated journal article or ation. The JRNL section is not mandatory and thus may not be present.
        Returns:
        flag if a JournalArticle has been found.
      • getJournalArticle

        JournalArticle getJournalArticle()
        Get the associated publication as defined by the JRNL records in a PDB file.
        Returns:
        a JournalArticle
      • setJournalArticle

        void setJournalArticle​(JournalArticle journalArticle)
        Set the associated publication as defined by the JRNL records in a PDB file.
        Parameters:
        journalArticle - a JournalArticle object
      • getSSBonds

        java.util.List<Bond> getSSBonds()
        Get the list of disulfide Bonds as they have been defined in the PDB files
        Returns:
        a list of Bonds
      • setSSBonds

        void setSSBonds​(java.util.List<Bond> ssbonds)
        Set the list of SSBonds for this structure
        Parameters:
        ssbonds -
      • addSSBond

        void addSSBond​(Bond ssbond)
        Add a single disulfide Bond to this structure
        Parameters:
        ssbond - a disulfide bond
      • setPDBHeader

        void setPDBHeader​(PDBHeader header)
        Set the the header information for this PDB file
        Parameters:
        header - the PDBHeader object
      • getId

        java.lang.Long getId()
        Get the ID used by Hibernate
        Returns:
        the ID used by Hibernate
      • setId

        void setId​(java.lang.Long id)
        set the ID used by Hibernate
        Parameters:
        id - the id
      • setSites

        void setSites​(java.util.List<Site> sites)
        Parameters:
        sites - the sites to set in the structure
      • getSites

        java.util.List<Site> getSites()
        Returns:
        the sites contained in this structure
      • setBiologicalAssembly

        void setBiologicalAssembly​(boolean biologicalAssembly)
        Set a flag to indicate if this structure is a biological assembly
        Parameters:
        biologicalAssembly - true if biological assembly, otherwise false
        Since:
        3.2
      • isBiologicalAssembly

        boolean isBiologicalAssembly()
        Get flag that indicates if this structure is a biological assembly
        Returns:
        true if biological assembly, otherwise false
        Since:
        3.2
      • setCrystallographicInfo

        void setCrystallographicInfo​(PDBCrystallographicInfo crystallographicInfo)
        Set crystallographic information for this structure
        Parameters:
        crystallographicInfo - crystallographic information
        Since:
        3.2
      • getCrystallographicInfo

        PDBCrystallographicInfo getCrystallographicInfo()
        Get crystallographic information for this structure
        Returns:
        PDBCrystallographicInfo crystallographic information
        Since:
        3.2
      • resetModels

        void resetModels()
        Resets all models of this Structure
        Since:
        4.0.1
      • getPdbId

        @Deprecated
        java.lang.String getPdbId()
        Deprecated.
        From BioJava 4.2, use getPDBCode() or getStructureIdentifier().toCanonical().getPdbId()
        Returns the PDB identifier associated with this StructureIdentifier.
      • getResidueRanges

        @Deprecated
        java.util.List<? extends ResidueRange> getResidueRanges()
        Deprecated.
        From BioJava 4.2, use getStructureIdentifier().toCanonical().getResidueRanges()
        Returns the list of ResidueRanges that this StructureIdentifier defines. This is a unique representation.
      • getRanges

        @Deprecated
        java.util.List<java.lang.String> getRanges()
        Deprecated.
        From BioJava 4.2, use getStructureIdentifier().toCanonical().getRanges()
        Returns a list of residue ranges. For example:
         getRanges().get(0): 'A'
         getRanges().get(1): 'B_5-100'
         
        This is a unique representation.
      • getIdentifier

        java.lang.String getIdentifier()
        Get a string representing this structure's contents. The following places are searched for a non-null value, with the first being returned:
        1. getStructureIdentifier().getIdentifier(), which should give the string originally used to create the structure
        2. getName()
        3. A combination of getPDBCode() with a heuristic description of the residue ranges, in SubstructureIdentifier format.
        Returns:
        A SubstructureIdentifier-format string describing the residue ranges in this structure
        Since:
        The behavior of this method changed in BioJava 4.2. Previously it returned the same value as getPDBCode()