org.proteinshader.structure.io
Class PDBConnectFieldExtractor

java.lang.Object
  extended by org.proteinshader.structure.io.PDBConnectFieldExtractor

public class PDBConnectFieldExtractor
extends Object

Extracts fields from a PDB CONECT record.

The line given as an argument to any of the extract() methods must be a PDB CONECT record as specified in the PDB Contents Guide (Version 2.2, 20 Dec 1996).

The column numbers specified in the PDB guide start at 1 rather than at 0, so a field written as (serial field: 7-11) would be in columns 6 to 10 in a String.


Constructor Summary
PDBConnectFieldExtractor()
          Constructs a PDBFieldExtractor.
 
Method Summary
 List<Integer> extractDstAtomSerialNo(String line)
          Obtains destination Atom serial number(s) from

field 1 = (serial field: 12-16)
field 2 = (serial field: 17-21)
field 3 = (serial field: 22-26)
field 4 = (serial field: 27-31)

It is legal for any (or even all 4) of these fields to be blank, as the CONECT record may be used to specify salt bridges or hydrogen bonds that are found in other fields.
 int extractSrcAtomSerialNo(String line)
          Obtains the source Atom serial number from (serial field: 7-11)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDBConnectFieldExtractor

public PDBConnectFieldExtractor()
Constructs a PDBFieldExtractor.

Method Detail

extractSrcAtomSerialNo

public int extractSrcAtomSerialNo(String line)
                           throws PDBFieldExtractorException
Obtains the source Atom serial number from (serial field: 7-11)

Parameters:
line - a CONECT record at least 80 characters in length.
Returns:
The the source Atom serial number as an int.
Throws:
PDBFieldExtractorException - if the source Atom serial number cannot be found.

extractDstAtomSerialNo

public List<Integer> extractDstAtomSerialNo(String line)
                                     throws PDBFieldExtractorException
Obtains destination Atom serial number(s) from

field 1 = (serial field: 12-16)
field 2 = (serial field: 17-21)
field 3 = (serial field: 22-26)
field 4 = (serial field: 27-31)

It is legal for any (or even all 4) of these fields to be blank, as the CONECT record may be used to specify salt bridges or hydrogen bonds that are found in other fields. If all 4 fields are blank spaces, then this method will return a List with a size of 0 elements.

Parameters:
line - a CONECT record at least 80 characters in length.
Returns:
The destination Atom serial number(s) as a List of Integers.
Throws:
PDBFieldExtractorException - if the line is too short or if a non-whitespace containing field cannot be converted into an Integer.


Copyright © 2007-2008