org.proteinshader.structure.io
Class PDBBetaStrandFieldExtractor

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

public class PDBBetaStrandFieldExtractor
extends Object

Extracts fields from a PDB SHEET record.

The line must be a PDB SHEET 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 (strandNo field: 8-10) would be in columns 7-9 in a String.


Constructor Summary
PDBBetaStrandFieldExtractor()
          Constructs a PDBBetaStrandFieldExtractor.
 
Method Summary
 String extractBetaStrandNumber(String line)
          Obtains the betaStrandNumber from (strandNo field: 8-10).
 String extractChainID(String line)
          Obtains the chainID from (initChainID field: 22).
 String extractEndResidueID(String line)
          Obtains the endResidueID by combining (endResName field: 29-31), (endSeqNum field: 34-37), and the optional (endICode field: 38).
 int extractSense(String line)
          Obtains the sense (orientation) from (sense field: 39-40).
 String extractSheetID(String line)
          Obtains the sheetID from (sheetID field: 12-14).
 String extractStartResidueID(String line)
          Obtains the startResidueID by combining (initResName field: 18-20), (initSeqNum field: 23-26), and the optional (initICode field: 27).
 int extractStrandsInSheet(String line)
          Obtains the number of strands in the sheet from (numStrands field: 15-16).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDBBetaStrandFieldExtractor

public PDBBetaStrandFieldExtractor()
Constructs a PDBBetaStrandFieldExtractor.

Method Detail

extractBetaStrandNumber

public String extractBetaStrandNumber(String line)
                               throws PDBFieldExtractorException
Obtains the betaStrandNumber from (strandNo field: 8-10). Leading and trailing whitespace are removed.

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

extractSheetID

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

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

extractStrandsInSheet

public int extractStrandsInSheet(String line)
                          throws PDBFieldExtractorException
Obtains the number of strands in the sheet from (numStrands field: 15-16).

Parameters:
line - a SHEET record at least 80 characters in length.
Returns:
The number of strands in the sheet.
Throws:
PDBFieldExtractorException - if the number of strands cannot be obtained or the\ number is less than 2.

extractChainID

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

Parameters:
line - a SHEET 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: 18-20), (initSeqNum field: 23-26), and the optional (initICode field: 27). A blank space is placed between these fields, and leading and trailing whitespace are removed.

Parameters:
line - a SHEET 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: 29-31), (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 SHEET 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.

extractSense

public int extractSense(String line)
                 throws PDBFieldExtractorException
Obtains the sense (orientation) from (sense field: 39-40).

Parameters:
line - a SHEET record at least 80 characters in length.
Returns:
The sense as an int (0, 1, or -1).
Throws:
PDBFieldExtractorException - if the sense is not 0, 1, or -1.


Copyright © 2007-2008