chemaxon.marvin.modules
Class MacroMolecule.Polymer

java.lang.Object
  extended bychemaxon.marvin.modules.MacroMolecule.Component
      extended bychemaxon.marvin.modules.MacroMolecule.Polymer
Direct Known Subclasses:
MacroMolecule.NucleicAcid, MacroMolecule.Protein
Enclosing class:
MacroMolecule

public class MacroMolecule.Polymer
extends MacroMolecule.Component

The Polymer class represents nucleic acid and amino acid chains. The sequence is stored along with atom coordinates. Missing residues as well as residues with the same residue number but different insertion code are represented.
The entire chain is not represented as one Molecule instance for the sake of speed and small storage space usage.


Nested Class Summary
 class MacroMolecule.Polymer.AtomIterator
          Enumerates all atoms of a polymer chain.
 class MacroMolecule.Polymer.AtomProperty
          Provides polymorphic access to atom properties of polymer atoms.
 class MacroMolecule.Polymer.BondIterator
          Iterates all bonds of the pylomer.
 class MacroMolecule.Polymer.Model
           
 
Field Summary
protected  char currentICode
           
protected  int currentModelSerial
          these are used in build-up phase
protected  int currentResidueIndex
           
protected  int currentResidueType
           
protected  int currentSeqNo
           
protected  int currentSequenceIndex
           
protected  char[] iCode
          insertion code of residues
protected  MacroMolecule.Polymer.Model[] models
           
protected  int molId
           
protected  int[] residueOffset
          index of the first atom of the residue in the atom coordinate arrays
protected  int[] residues
          residue type ids as defined by the ATOM/HETATOM records
protected  int seqBegin
           
protected  int seqEnd
           
protected  int[] seqNo
          sequence number of residues
protected  int[] sequence
          residue type ids as defined in the SEQRES records
 
Fields inherited from class chemaxon.marvin.modules.MacroMolecule.Component
atomCount, bondCount, chainId, definedAtomCount, definedHCount, hCount, name
 
Constructor Summary
MacroMolecule.Polymer(char chainId, int modelCount, int residueCount, int atomCount)
          Creates an amino acid or nucleic acid polymer with the given name and chain identifier.
 
Method Summary
 void addAtom(int serial, int residueTypeId, int residueAtomIndex, int resSeqNo, char iCode, float x, float y, float z, float bFactor)
          Adds a residue atom to the chain.
 void addModelAtom(int modelSerial, int residueTypeId, int residueAtomIndex, int resSeqNo, char iCode, float x, float y, float z, float bFactor)
           
 void addModRes(int residueTypeId, int residueAtomCount, int resSeqNo)
           
 void addSeqRange(int seqBegin, int seqEnd)
          Specifies residue sequence number range within which residue sequence numbers in the ATOM records should fall.
 void addSequenceResidue(int residueTypeId)
          Adds a new residue to the current chain.
 MoleculeIterators.AtomIteratorInterface getAtomIterator(boolean enumerateHydrogens)
          Gets a new iterator that can enumerate all atoms of the Component.
 MoleculeIterators.AtomIteratorInterface getAtomIterator(int fromResidue, int toResidue)
           
 java.lang.String getAtomLabel(int atomIndex)
          Gets the label of the specified atom.
 MoleculeIterators.AtomPropertyInterface getAtomProperty()
          Gets a new AtomPropertyInterface that can retrieve various atom related properties.
 MoleculeIterators.BondIteratorInterface getBondIterator(boolean enumerateHydrogens)
          Gets a new iterator that can enumerate all bonds of the Component.
 int getResidueCount()
          Gets the nuber of residues defined by ATOM/HETATM records in the current chain.
 int getSequenceResidueCount()
          Gets the nuber of residues defined by SEQRES records in the current chain.
 float getX(int index)
          Gets the first coordinate of the spacified residue atom.
 float getY(int index)
          Gets the second coordinate of the spacified residue atom.
 float getZ(int index)
          Gets the third coordinate of the spacified residue atom.
 boolean hasChain(char chainId)
          Checks if this component represents the specified chain.
 void setSequenceResidueCount(int residueCount)
          Specifies the total number of residues in the given chain.
 
Methods inherited from class chemaxon.marvin.modules.MacroMolecule.Component
addToMolecule, containsAtom, getAtomCount, getChainId, getDefinedAtomCount, getHydrogenCount, getICode, getName, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

molId

protected int molId

seqBegin

protected int seqBegin

seqEnd

protected int seqEnd

sequence

protected int[] sequence
residue type ids as defined in the SEQRES records


residues

protected int[] residues
residue type ids as defined by the ATOM/HETATOM records


seqNo

protected int[] seqNo
sequence number of residues


iCode

protected char[] iCode
insertion code of residues


residueOffset

protected int[] residueOffset
index of the first atom of the residue in the atom coordinate arrays


models

protected MacroMolecule.Polymer.Model[] models

currentModelSerial

protected int currentModelSerial
these are used in build-up phase


currentSequenceIndex

protected int currentSequenceIndex

currentResidueIndex

protected int currentResidueIndex

currentResidueType

protected int currentResidueType

currentSeqNo

protected int currentSeqNo

currentICode

protected char currentICode
Constructor Detail

MacroMolecule.Polymer

public MacroMolecule.Polymer(char chainId,
                             int modelCount,
                             int residueCount,
                             int atomCount)
Creates an amino acid or nucleic acid polymer with the given name and chain identifier.

Parameters:
chainId - chain identifier
residueCount - number of residues constituting the polymer chain
atomCount - number of atoms in the polymer
Method Detail

setSequenceResidueCount

public void setSequenceResidueCount(int residueCount)
Specifies the total number of residues in the given chain. Residues not represented in the PDB file by ATOM records are also considered.

Parameters:
residueCount - number of residues in the current component

addSeqRange

public void addSeqRange(int seqBegin,
                        int seqEnd)
Specifies residue sequence number range within which residue sequence numbers in the ATOM records should fall.

Parameters:
seqBegin - smallest sequence number on this chain
seqEnd - largest sequence number on this chain

addSequenceResidue

public void addSequenceResidue(int residueTypeId)
Adds a new residue to the current chain. This method is called when a residue type name is read from a SEQRES record processed.

Parameters:
residueTypeId - internal index of type of the residue (as determined by PDBResidues)

addModRes

public void addModRes(int residueTypeId,
                      int residueAtomCount,
                      int resSeqNo)

addAtom

public void addAtom(int serial,
                    int residueTypeId,
                    int residueAtomIndex,
                    int resSeqNo,
                    char iCode,
                    float x,
                    float y,
                    float z,
                    float bFactor)
             throws MacroMolecule.BadMoleculeException
Adds a residue atom to the chain.

Parameters:
serial - serial atom index in PDB
residueTypeId - internal index of type of the residue
residueAtomIndex - internal index of the atom in the residue
resSeqNo - sequence number as specified in the PDB file
iCode - insertion code as specified in the PDB file
x - atom coordinate x
y - atom coordinate y
z - atom coordinate z
Throws:
BadMoleculeException - not thrown, though it should be implemented later
MacroMolecule.BadMoleculeException

addModelAtom

public void addModelAtom(int modelSerial,
                         int residueTypeId,
                         int residueAtomIndex,
                         int resSeqNo,
                         char iCode,
                         float x,
                         float y,
                         float z,
                         float bFactor)
                  throws MacroMolecule.BadMoleculeException
Throws:
MacroMolecule.BadMoleculeException

hasChain

public boolean hasChain(char chainId)
Checks if this component represents the specified chain.

Parameters:
chainId - one letter chain identifier
Returns:
true if given chain is part of this Component

getSequenceResidueCount

public int getSequenceResidueCount()
Gets the nuber of residues defined by SEQRES records in the current chain.

Returns:
total number of residues, including missing residues

getResidueCount

public int getResidueCount()
Gets the nuber of residues defined by ATOM/HETATM records in the current chain.

Returns:
total number of residues, including missing residues

getAtomLabel

public java.lang.String getAtomLabel(int atomIndex)
Description copied from class: MacroMolecule.Component
Gets the label of the specified atom.

Overrides:
getAtomLabel in class MacroMolecule.Component
Parameters:
atomIndex - index of the atom quiried
Returns:
label of the specified atom

getX

public float getX(int index)
Gets the first coordinate of the spacified residue atom.

Parameters:
index - internal atom index as returned by an AtomIteratorInterface
Returns:
x coordinate

getY

public float getY(int index)
Gets the second coordinate of the spacified residue atom.

Parameters:
index - internal atom index as returned by an AtomIteratorInterface
Returns:
y coordinate

getZ

public float getZ(int index)
Gets the third coordinate of the spacified residue atom.

Parameters:
index - internal atom index as returned by an AtomIteratorInterface
Returns:
z coordinate

getAtomIterator

public MoleculeIterators.AtomIteratorInterface getAtomIterator(boolean enumerateHydrogens)
Description copied from class: MacroMolecule.Component
Gets a new iterator that can enumerate all atoms of the Component.

Overrides:
getAtomIterator in class MacroMolecule.Component
Parameters:
enumerateHydrogens - indicates if hydrogen atoms are enumerated or not
Returns:
an initialized atom iterator

getAtomIterator

public MoleculeIterators.AtomIteratorInterface getAtomIterator(int fromResidue,
                                                               int toResidue)

getBondIterator

public MoleculeIterators.BondIteratorInterface getBondIterator(boolean enumerateHydrogens)
Description copied from class: MacroMolecule.Component
Gets a new iterator that can enumerate all bonds of the Component.

Overrides:
getBondIterator in class MacroMolecule.Component
Parameters:
enumerateHydrogens - indicates if bonds to hydrogen atoms are enumerated or not
Returns:
an initialized bond iterator

getAtomProperty

public MoleculeIterators.AtomPropertyInterface getAtomProperty()
Description copied from class: MacroMolecule.Component
Gets a new AtomPropertyInterface that can retrieve various atom related properties.

Overrides:
getAtomProperty in class MacroMolecule.Component
Returns:
an atom property interface