org.proteinshader.structure.io
Class PDBHelixFieldExtractor

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

public class PDBHelixFieldExtractor
extends Object

Extracts fields from a PDB HELIX record.

The line must be a PDB HELIX record as specified in the 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 (helixID field: 12-14) would be in columns 11-13 in a String.


Constructor Summary
PDBHelixFieldExtractor()
          Constructs a PDBHelixFieldExtractor.
 
Method Summary
 String extractChainID(String line)
          Obtains the chainID from (initChainID field: 20).
 String extractEndResidueID(String line)
          Obtains the endResidueID by combining (endResName field: 28-30), (endSeqNum field: 34-37), and the optional (endICode field: 38).
 String extractHelixID(String line)
          Obtains the helixID from (helixID field: 12-14).
 String extractSerialNo(String line)
          Obtains the helix serial number from (serial field: 8-10).
 String extractStartResidueID(String line)
          Obtains the startResidueID by combining (initResName field: 16-18), (initSeqNum field: 22-25), and the optional (initICode field: 26).
 HelixEnum extractType(String line)
          Extracts the helix type from (helixClass field: 39-40).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDBHelixFieldExtractor

public PDBHelixFieldExtractor()
Constructs a PDBHelixFieldExtractor.

Method Detail

extractSerialNo

public String extractSerialNo(String line)
                       throws PDBFieldExtractorException
Obtains the helix serial number from (serial field: 8-10).

Parameters:
line - a HELIX record at least 80 characters in length.
Returns:
The helix serial number as a String
Throws:
PDBFieldExtractorException - if the helix serial number field cannot be converted to an integer.

extractHelixID

public String extractHelixID(String line)
                      throws PDBFieldExtractorException
Obtains the helixID from (helixID field: 12-14). Leading and trailing whitespace are removed.

Parameters:
line - a HELIX record at least 80 characters in length.
Returns:
The helixID as a String.
Throws:
PDBFieldExtractorException - if a helixID cannot be obtained.

extractChainID

public String extractChainID(String line)
                      throws PDBFieldExtractorException
Obtains the chainID from (initChainID field: 20). If the chainID field is blank, the default chainID from PDBLineParser will be used.

Parameters:
line - a HELIX record at least 80 characters in length.
Returns:
The chainID as a String.
Throws:
PDBFieldExtractorException - if a chainID cannot be obtained.

extractStartResidueID

public String extractStartResidueID(String line)
                             throws PDBFieldExtractorException
Obtains the startResidueID by combining (initResName field: 16-18), (initSeqNum field: 22-25), and the optional (initICode field: 26). A blank space is placed between these fields, and leading and trailing whitespace are removed.

Parameters:
line - a HELIX record at least 80 characters in length.
Returns:
The startResidueID as a String.
Throws:
PDBFieldExtractorException - if the line is too short or either the initResName field or the initSeqNum field is blank.

extractEndResidueID

public String extractEndResidueID(String line)
                           throws PDBFieldExtractorException
Obtains the endResidueID by combining (endResName field: 28-30), (endSeqNum field: 34-37), and the optional (endICode field: 38). A blank space is placed between these fields, and leading and trailing whitespace are removed.

Parameters:
line - a HELIX record at least 80 characters in length.
Returns:
The startResidueID as a String.
Throws:
PDBFieldExtractorException - if the line is too short or either the endResName field or the endSeqNum field is blank.

extractType

public HelixEnum extractType(String line)
                      throws PDBFieldExtractorException
Extracts the helix type from (helixClass field: 39-40). If the field is blank, null will be returned (the Helix constructor will use a default HelixEnum if given null as the type). Otherwise, the number in the helixClass field will be converted to a HelixEnum type.

Parameters:
line - a HELIX record at least 80 characters in length.
Returns:
The helix type as a HelixEnum.
Throws:
PDBFieldExtractorException - if the char in the helixClass field cannot be matched to a known type or if the record is too short.


Copyright © 2007-2008