ProGAL.proteins
Class PDBFile

java.lang.Object
  extended by java.io.File
      extended by ProGAL.proteins.PDBFile
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<java.io.File>
Direct Known Subclasses:
PDBFile

public class PDBFile
extends java.io.File

A class for reading and representing a PDB-file. All lines are read but not all are parsed. All the records can be retrieved as they are shown in the PDB-file. The ATOM-records, however, can also be accessed according to model and chain id. If a model-number and chain id are not specified the method will assume that the first chain of the first model is meant. In some files there are multiple suggestions for atom-placements. This is resolved by only reading the first suggested atom-placement. The other atom-placements are added to the alternativeCoords LinkedList in the first atom-record. The four-letter PDB id and chain id are guessed based on the filename. TODO: Represent ligands, heterogens and secondary structure. TODO: Check the integrity of different models, e.g. that the sequences are the same.

Author:
R. Fonseca
See Also:
Serialized Form

Nested Class Summary
static class PDBFile.AnisouRecord
           
static class PDBFile.AtomRecord
           
static class PDBFile.EndModelRecord
           
static class PDBFile.HelixRecord
           
static class PDBFile.HetatmRecord
           
static class PDBFile.ModelRecord
           
static class PDBFile.OtherRecord
           
static class PDBFile.ParentRecord
           
static class PDBFile.PDBChain
           
static class PDBFile.PDBModel
           
static interface PDBFile.PDBRecord
           
static class PDBFile.RemarkRecord
           
static class PDBFile.SheetRecord
           
static class PDBFile.TerRecord
           
 
Field Summary
 java.lang.String name
          The name of this PDB-file.
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
PDBFile(java.io.File f)
          Construct a PDB-file from the specified file
PDBFile(java.lang.String path)
          Construct a PDB-file from the specified file-path
 
Method Summary
static PDBFile downloadPDBFile(java.lang.String pdbId)
          Read a PDB-file from www.pdb.org.
 PDBFile.AtomRecord getAtom(int res, java.lang.String atomType)
           
 java.util.List<Point> getAtomCoords()
          Returns all atom-coordinates in the first chain in the first model.
 java.util.List<Point> getAtomCoords(int modelNum, int chainNum)
          Returns all atom-coordinates of the specified model and chain.
 java.util.List<Point> getAtomCoords(java.lang.String atomTypes)
          Returns the coordinates of the specified atom types.
 java.util.List<PDBFile.AtomRecord> getAtomRecords()
          Returns the ATOM-records.
 java.util.List<PDBFile.AtomRecord> getAtomRecords(int modelNum, int chainNum)
          Returns the ATOM-records of the specified model and chain.
 java.util.List<PDBFile.AtomRecord> getAtomRecords(java.lang.String atomTypes)
          Returns the ATOM-records.
 java.util.List<Point> getCACoords()
          Returns the CA-coordinates of atoms in the first chain in the first model.
 java.util.List<Point> getCACoords(int modelNum, int chainNum)
          Returns the CA-coordinates of the specified model and chain.
 java.util.List<PDBFile.AtomRecord> getCARecords()
          Returns the ATOM-records of CA-atoms.
 java.util.List<PDBFile.AtomRecord> getCARecords(int modelNum, int chainNum)
          Returns the CA ATOM-records of the specified model and chain.
 AminoAcidChain getChain(int modelNum, int chainNum)
           
 java.util.List<PDBFile.HetatmRecord> getHetatmRecords()
           
 java.util.List<PDBFile.HetatmRecord> getHetatmRecords(int modelNum, int chainNum)
          Returns the HETATM-records of the specified model and chain.
 java.util.List<PDBFile.PDBModel> getModels()
           
 java.util.List<PDBFile.PDBRecord> getRecords()
          Returns all records of the specified model and chain.
 java.util.List<PDBFile.RemarkRecord> getRemarkRecords()
          Returns all REMARK records.
 double getResolution()
           
 java.lang.String getSequence()
           
static void main(java.lang.String[] args)
           
 void setIncludeHetatms(boolean b)
           
 void setIncludeHydrogens(boolean b)
           
 void setStandardChain(char c)
           
 void setStandardChain(int c)
           
 void setStandardModel(int m)
           
 double superposeOnto(PDBFile f)
           
 
Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toString, toURI, toURL
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public java.lang.String name
The name of this PDB-file. Typically the PDB-id.

Constructor Detail

PDBFile

public PDBFile(java.lang.String path)
Construct a PDB-file from the specified file-path


PDBFile

public PDBFile(java.io.File f)
Construct a PDB-file from the specified file

Method Detail

downloadPDBFile

public static PDBFile downloadPDBFile(java.lang.String pdbId)
Read a PDB-file from www.pdb.org.


setStandardModel

public void setStandardModel(int m)

setStandardChain

public void setStandardChain(int c)

setIncludeHydrogens

public void setIncludeHydrogens(boolean b)

setIncludeHetatms

public void setIncludeHetatms(boolean b)

setStandardChain

public void setStandardChain(char c)

getModels

public java.util.List<PDBFile.PDBModel> getModels()

getAtomRecords

public java.util.List<PDBFile.AtomRecord> getAtomRecords()
Returns the ATOM-records. Only the records in the first chain of the first model are returned.


getAtomRecords

public java.util.List<PDBFile.AtomRecord> getAtomRecords(java.lang.String atomTypes)
Returns the ATOM-records. Only the records with the types specified in the comma-separated string are returned.

Parameters:
atomTypes - A comma separated list of atom types. Could, for example, be "CA,C,N,O" to specify backbone atoms only.

getCARecords

public java.util.List<PDBFile.AtomRecord> getCARecords()
Returns the ATOM-records of CA-atoms. Only the records in the first chain of the first model are returned.


getCACoords

public java.util.List<Point> getCACoords()
Returns the CA-coordinates of atoms in the first chain in the first model.


getAtomCoords

public java.util.List<Point> getAtomCoords()
Returns all atom-coordinates in the first chain in the first model.


getAtomCoords

public java.util.List<Point> getAtomCoords(java.lang.String atomTypes)
Returns the coordinates of the specified atom types.

Parameters:
atomTypes - A comma separated list of atom types. Could, for example, be "CA,C,N,O" to specify backbone atoms only.

getAtomRecords

public java.util.List<PDBFile.AtomRecord> getAtomRecords(int modelNum,
                                                         int chainNum)
Returns the ATOM-records of the specified model and chain.


getHetatmRecords

public java.util.List<PDBFile.HetatmRecord> getHetatmRecords()

getHetatmRecords

public java.util.List<PDBFile.HetatmRecord> getHetatmRecords(int modelNum,
                                                             int chainNum)
Returns the HETATM-records of the specified model and chain.


getRecords

public java.util.List<PDBFile.PDBRecord> getRecords()
Returns all records of the specified model and chain.


getCARecords

public java.util.List<PDBFile.AtomRecord> getCARecords(int modelNum,
                                                       int chainNum)
Returns the CA ATOM-records of the specified model and chain.


getCACoords

public java.util.List<Point> getCACoords(int modelNum,
                                         int chainNum)
Returns the CA-coordinates of the specified model and chain.


getAtomCoords

public java.util.List<Point> getAtomCoords(int modelNum,
                                           int chainNum)
Returns all atom-coordinates of the specified model and chain.


getChain

public AminoAcidChain getChain(int modelNum,
                               int chainNum)

getRemarkRecords

public java.util.List<PDBFile.RemarkRecord> getRemarkRecords()
Returns all REMARK records.


getAtom

public PDBFile.AtomRecord getAtom(int res,
                                  java.lang.String atomType)

getSequence

public java.lang.String getSequence()

getResolution

public double getResolution()

superposeOnto

public double superposeOnto(PDBFile f)

main

public static void main(java.lang.String[] args)