dasp.model
Class DaspStructure

java.lang.Object
  extended by dasp.model.DaspStructure

public class DaspStructure
extends Object


Constructor Summary
DaspStructure(String pdbFile)
          Create a new structure from a pdb file.
DaspStructure(String pdbFile, String chain)
          Create a new structure from a pdb file.
 
Method Summary
 String getPdbId()
          Return the pbd id and chain as a string for this sequence Does not account ofr a possible 'pdb' in front of the pdb id.
 Residue getResidue(String residueID)
          Return a Residue object for a residue within this PDB file.
 int getSeqLength()
          Returns the number of residues in the sequence.
 String getSequence()
          Return the amino acid sequence for this PDB file.
 boolean hasMoreResidues()
          Tests to see if there is at least one more Residue object in the sequence
 Residue nextResidue()
          Enumerates through sequence of residues and returns the next Residue object.
 void resetEnum()
          Resets the enumerator variable to -1
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DaspStructure

public DaspStructure(String pdbFile)
              throws IOException
Create a new structure from a pdb file. If there is a file separator in the PDB file, we assume that the file is a full path to an independent PDB file. If there is no slash, we will use the standard PDB director structure to find the identifier.

Parameters:
pdbFile - the pdb identifier or path to the pdb file
Throws:
IOException

DaspStructure

public DaspStructure(String pdbFile,
                     String chain)
              throws IOException
Create a new structure from a pdb file. If there is a file separator in the PDB file, we assume that the file is a full path to an independent PDB file. If there is no slash, we will use the standard PDB director structure to find the identifier. This form of the constructor takes a chain ID to pull a specific chain from the file

Parameters:
pdbFile - the pdb identifier or path to the pdb file
chain - the chain ID
Throws:
IOException
Method Detail

getSequence

public String getSequence()
Return the amino acid sequence for this PDB file.

Returns:
the sequence

getPdbId

public String getPdbId()
Return the pbd id and chain as a string for this sequence Does not account ofr a possible 'pdb' in front of the pdb id.

Returns:
a String containing the PDB ID and chain

getSeqLength

public int getSeqLength()
Returns the number of residues in the sequence.

Returns:
the length of the sequence

nextResidue

public Residue nextResidue()
Enumerates through sequence of residues and returns the next Residue object. Is there a better way to implement this? Using something already avaliable? I didn't want the other method to have direct access to the residue seqeunce list.

Returns:
the next residue object in the sequence.

hasMoreResidues

public boolean hasMoreResidues()
Tests to see if there is at least one more Residue object in the sequence

Returns:
true if more Residue objects exist, false otherwise.

resetEnum

public void resetEnum()
Resets the enumerator variable to -1


getResidue

public Residue getResidue(String residueID)
Return a Residue object for a residue within this PDB file.

Parameters:
residueID - the ID for the residue to get from the structure. The residue ID can be the residue # as an int, or an amino acid code followed by an integer value (e.g. A123)
Returns:
a residue object corresponding to that residue ID