
org.biojava.nbio.structure.Structure Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of biojava-structure Show documentation
Show all versions of biojava-structure Show documentation
The protein structure modules of BioJava.
/*
* BioJava development code
*
* This code may be freely distributed and modified under the
* terms of the GNU Lesser General Public Licence. This should
* be distributed with the code. If you do not have a copy,
* see:
*
* http://www.gnu.org/copyleft/lesser.html
*
* Copyright for this code is held jointly by the individual
* authors. These should be listed in @author doc comments.
*
* For more information on the BioJava project and its aims,
* or to join the biojava-l mailing list, visit the home page
* at:
*
* http://www.biojava.org/
*
* Created on 26.04.2004
* @author Andreas Prlic
*
*/
package org.biojava.nbio.structure;
import org.biojava.nbio.structure.io.FileConvert;
import org.biojava.nbio.structure.io.PDBFileReader;
import java.util.List;
import java.util.Map;
/**
*
* 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:
*
* - {@link PDBHeader}
* - {@link DBRef}
* - {@link EntityInfo}
*
*
* The structure object provides access to the data from the ATOM records through
* a hierarchy of sub-object:
*
* Structure
* |
* {@link Chain}
* |
* {@link Group}
* |
* {@link 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:
*
*
* public {@link Structure} loadStructure(String pathToPDBFile){
* {@link PDBFileReader} pdbreader = new {@link PDBFileReader}();
*
* {@link 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:
*
*
* public void calcPhiPsi({@link Structure} structure){
*
*
* // get the first chain from the structure
*
* {@link Chain} chain = structure.getChain(0);
*
* // A protein chain consists of a number of groups. These can be either
* // {@link AminoAcid}, {@link HetatomImpl Hetatom} or {@link NucleotideImpl 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);
*
* {@link AminoAcid} a;
* {@link AminoAcid} b;
* {@link 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 = ({@link AminoAcid})groups.get(i);
*
* double phi =360.0;
* double psi =360.0;
*
* if ( i > 0) {
* a = ({@link AminoAcid})groups.get(i-1) ;
* try {
*
* // the Calc class provides utility methods for various calculations on
* // structures, groups and atoms
*
* phi = {@link Calc}.getPhi(a,b);
* } catch ({@link StructureException} e){
* e.printStackTrace();
* phi = 360.0 ;
* }
* }
* if ( i < groups.size()-1) {
* c = ({@link AminoAcid})groups.get(i+1) ;
* try {
* psi = {@link Calc}.getPsi(b,c);
* }catch ({@link 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));
*
* }
*
*
*
*
*
*
*
* @author Andreas Prlic
* @since 1.4
* @version %I% %G%
*/
public interface Structure extends Cloneable {
/**
* Return an identical copy of this Structure object
*
* @return identical copy of this Structure object
*/
public Structure clone();
/**
* String representation of object.
*/
@Override
public String toString();
/**
* Set PDB code of structure .
*
* @param pdb_id a String specifying the PDBCode
* @see #getPDBCode
*/
public void setPDBCode (String pdb_id) ;
/**
* Get PDB code of structure.
*
* @return a String representing the PDBCode value
* @see #setPDBCode
*/
public String getPDBCode () ;
/**
* Set biological name of Structure .
*
* @param name a String specifying the biological name of the Structure
* @see #getName
*/
public void setName(String name);
/**
* Get biological name of Structure.
*
* @return a String representing the biological name of the Structure
* @see #setName
*/
public String getName();
/**
* Get an identifier corresponding to this structure
* @return The StructureIdentifier used to create this structure
*/
public StructureIdentifier getStructureIdentifier();
/**
* Set the identifier corresponding to this structure
* @param structureIdentifier the structureIdentifier corresponding to this structure
*/
public void setStructureIdentifier(StructureIdentifier structureIdentifier);
/**
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
*
* @param connections a List object specifying the connections
* @see #getConnections
* @deprecated use {@link Atom#addBond(Bond)} instead
*/
@Deprecated
public void setConnections(List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy