Package jgromacs.data
Class Structure
- java.lang.Object
-
- jgromacs.data.Structure
-
- All Implemented Interfaces:
java.lang.Cloneable
public class Structure extends java.lang.Object implements java.lang.Cloneable
Objects of this class represent a single structure
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAtomToResidue(int i, Atom atom)
Adds the given atom to residue #ivoid
addAtomToResidueOfIndex(int index, Atom atom)
Adds the given atom to the residue of given indexvoid
addResidue(Residue residue)
Adds a new residue to the structurejava.lang.Object
clone()
Returns an identical Structure objectjava.util.ArrayList<java.lang.Integer>
convertIndicesToArrayListIndices(IndexSet indices)
Converts atomic indices into list indicesboolean
equals(java.lang.Object other)
Returns true if the two structures are identicalPointList
getAllAtomCoordinates()
Returns the coordinates of all atomsIndexSet
getAlphaCarbonIndexSet()
Returns the index set of alpha carbon atomsAtom
getAtom(int i)
Returns atom #i of the structureAtom
getAtomByIndex(int index)
Returns the atom of given indexAtom
getAtomInResidueOfIndex(int residueindex, int i)
Returns atom #i of the residue of given indexAtom
getAtomInResidueOfIndex(int residueindex, java.lang.String chainID, int i)
Returns atom #i of the residue of given index and chain IDIndexSet
getBackboneIndexSet()
Returns the index set of backbone atomsjava.util.ArrayList<java.lang.String>
getChainIDs()
Returns the list of chain IDs in the structureStructure[]
getChains()
Returns all chains in an array of Structure objectsIndexSetList
getDefaultIndexSetList()
Returns the list of default index setsIndexSet
getHeavyProteinIndexSet()
Returns the index set of protein atoms except of hydrogen atomsIndexSet
getIndexSetOfChainID(java.lang.String chainID)
Returns the index set of atoms of a given chain IDIndexSet
getMainChainIndexSet()
Returns the index set of main chain atomsIndexSet
getMainChainPlusCbIndexSet()
Returns the index set of main chain plus beta carbon atomsIndexSet
getMainChainPlusHIndexSet()
Returns the index set of main chain plus hydrogen atomsjava.lang.String
getName()
Returns the name of structureIndexSet
getNonProteinIndexSet()
Returns the index set of non-protein atomsint
getNumberOfAtoms()
Returns the number of atoms in the structureint
getNumberOfChains()
Returns the number of chains in the structureint
getNumberOfResidues()
Returns the number of residues in the structureIndexSet
getProteinIndexSet()
Returns the index set of protein atomsResidue
getResidue(int i)
Returns residue #i of the structureResidue
getResidueByIndex(int index)
Returns the residue of given indexResidue
getResidueByIndex(int index, java.lang.String chainID)
Returns the residue of given index and given chain IDjava.util.ArrayList<Residue>
getResiduesAsArrayList()
Returns residues as an ArrayList objectSequence
getSequence()
Returns the amino acid sequence of the structureIndexSet
getSideChainIndexSet()
Returns the index set of side chain atomsIndexSet
getSideChainMinusHIndexSet()
Returns the index set of side chain atoms except of hydrogen atomsStructure
getSubStructure(IndexSet indices)
Returns the substructure defined by the given index setIndexSet
getSystemIndexSet()
Returns the index set of all atoms in the systemIndexSet
getWaterIndexSet()
Returns the index set of water atomsint
hashCode()
Returns hash codejava.util.ArrayList<java.lang.Integer>
mapAtomIndicesToResidueIndices(IndexSet indices)
Maps atomic indices to residue indices (i.e.IndexSet
mapResidueIndicesToAtomIndices(java.util.ArrayList<java.lang.Integer> indices)
Maps residue indices to atomic indices (i.e.void
removeAtom(int i)
Removes atom #i from the structurevoid
removeAtom(Atom atom)
Removes the given atom from the structurevoid
removeAtomByIndex(int index)
Removes the atom of given index from the structurevoid
removeResidue(int i)
Removes residue #i from the structurevoid
removeResidue(Residue residue)
Removes a residue from the structurevoid
setAllAtomCoordinates(PointList pointlist)
Sets the coordinates of all atomsvoid
setAtomCoordinates(int i, Point3D coordinates)
Sets the coordinates of atom #ivoid
setAtomInResidue(int i, int j, Atom atom)
Replaces atom #j of residue #i with a new atomvoid
setAtomInResidueOfIndex(int index, int i, Atom atom)
Replaces atom #i of the residue of given index with a new atomvoid
setAtomOfIndexCoordinates(int index, Point3D coordinates)
Sets the coordinates of atom of given indexvoid
setName(java.lang.String name)
Sets the name of structurevoid
setResidue(int i, Residue residue)
Replaces residue #i with a new residuejava.lang.String
toString()
Returns the String representation of structurejava.lang.String
toStringAsGRO()
Returns the String representation of structure in GRO formatjava.lang.String
toStringAsPDB()
Returns the String representation of structure in PDB formatjava.lang.String
toStringInfo()
Returns summary information about the structure
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of structure- Returns:
- name of structure
-
setName
public void setName(java.lang.String name)
Sets the name of structure- Parameters:
name
- of structure
-
getResiduesAsArrayList
public java.util.ArrayList<Residue> getResiduesAsArrayList()
Returns residues as an ArrayList object- Returns:
- residues as an ArrayList
-
getNumberOfResidues
public int getNumberOfResidues()
Returns the number of residues in the structure- Returns:
- number of residues
-
getNumberOfAtoms
public int getNumberOfAtoms()
Returns the number of atoms in the structure- Returns:
- number of atoms
-
getNumberOfChains
public int getNumberOfChains()
Returns the number of chains in the structure- Returns:
- number of chains
-
getChainIDs
public java.util.ArrayList<java.lang.String> getChainIDs()
Returns the list of chain IDs in the structure- Returns:
- list of chain IDs
-
getResidue
public Residue getResidue(int i)
Returns residue #i of the structure- Returns:
- residue #i
-
getResidueByIndex
public Residue getResidueByIndex(int index, java.lang.String chainID)
Returns the residue of given index and given chain ID- Parameters:
index
- index of residuechainID
- chain ID of residue- Returns:
- residue of given index and chain ID
-
getResidueByIndex
public Residue getResidueByIndex(int index)
Returns the residue of given index- Parameters:
index
- index of residue- Returns:
- residue of given index
-
getAtom
public Atom getAtom(int i)
Returns atom #i of the structure- Returns:
- atom #i
-
getAtomByIndex
public Atom getAtomByIndex(int index)
Returns the atom of given index- Parameters:
index
- index of atom- Returns:
- atom of given index
-
getAtomInResidueOfIndex
public Atom getAtomInResidueOfIndex(int residueindex, java.lang.String chainID, int i)
Returns atom #i of the residue of given index and chain ID- Parameters:
residueindex
- index of residuechainID
- chain ID of residue- Returns:
- atom #i in residue of given index and chain ID
-
getAtomInResidueOfIndex
public Atom getAtomInResidueOfIndex(int residueindex, int i)
Returns atom #i of the residue of given index- Parameters:
residueindex
- index of residue- Returns:
- atom #i in residue of given index
-
addResidue
public void addResidue(Residue residue)
Adds a new residue to the structure- Parameters:
residue
- new residue
-
removeResidue
public void removeResidue(Residue residue)
Removes a residue from the structure- Parameters:
residue
- the residue to be removed
-
removeResidue
public void removeResidue(int i)
Removes residue #i from the structure
-
setResidue
public void setResidue(int i, Residue residue)
Replaces residue #i with a new residue- Parameters:
residue
- new residue
-
removeAtom
public void removeAtom(int i)
Removes atom #i from the structure
-
removeAtomByIndex
public void removeAtomByIndex(int index)
Removes the atom of given index from the structure- Parameters:
index
- index of atom
-
removeAtom
public void removeAtom(Atom atom)
Removes the given atom from the structure- Parameters:
atom
- the atom to be removed
-
addAtomToResidue
public void addAtomToResidue(int i, Atom atom)
Adds the given atom to residue #i- Parameters:
atom
- new atom
-
addAtomToResidueOfIndex
public void addAtomToResidueOfIndex(int index, Atom atom)
Adds the given atom to the residue of given index- Parameters:
index
- index of residueatom
- new atom
-
setAtomInResidue
public void setAtomInResidue(int i, int j, Atom atom)
Replaces atom #j of residue #i with a new atom- Parameters:
atom
- new atom
-
setAtomInResidueOfIndex
public void setAtomInResidueOfIndex(int index, int i, Atom atom)
Replaces atom #i of the residue of given index with a new atom- Parameters:
index
- index of residueatom
- new atom
-
getSystemIndexSet
public IndexSet getSystemIndexSet()
Returns the index set of all atoms in the system- Returns:
- index set of all atoms
-
getProteinIndexSet
public IndexSet getProteinIndexSet()
Returns the index set of protein atoms- Returns:
- index set of protein atoms
-
getHeavyProteinIndexSet
public IndexSet getHeavyProteinIndexSet()
Returns the index set of protein atoms except of hydrogen atoms- Returns:
- index set of protein atoms except of hydrogen atoms
-
getAlphaCarbonIndexSet
public IndexSet getAlphaCarbonIndexSet()
Returns the index set of alpha carbon atoms- Returns:
- index set of alpha carbon atoms
-
getBackboneIndexSet
public IndexSet getBackboneIndexSet()
Returns the index set of backbone atoms- Returns:
- index set of backbone atoms
-
getMainChainIndexSet
public IndexSet getMainChainIndexSet()
Returns the index set of main chain atoms- Returns:
- index set of main chain atoms
-
getMainChainPlusCbIndexSet
public IndexSet getMainChainPlusCbIndexSet()
Returns the index set of main chain plus beta carbon atoms- Returns:
- index set of main chain plus beta carbon atoms
-
getMainChainPlusHIndexSet
public IndexSet getMainChainPlusHIndexSet()
Returns the index set of main chain plus hydrogen atoms- Returns:
- index set of main chain plus hydrogen atoms
-
getSideChainIndexSet
public IndexSet getSideChainIndexSet()
Returns the index set of side chain atoms- Returns:
- index set of side chain atoms
-
getSideChainMinusHIndexSet
public IndexSet getSideChainMinusHIndexSet()
Returns the index set of side chain atoms except of hydrogen atoms- Returns:
- index set of side chain atoms except of hydrogen atoms
-
getNonProteinIndexSet
public IndexSet getNonProteinIndexSet()
Returns the index set of non-protein atoms- Returns:
- index set of non-protein atoms
-
getWaterIndexSet
public IndexSet getWaterIndexSet()
Returns the index set of water atoms- Returns:
- index set of water atoms
-
getDefaultIndexSetList
public IndexSetList getDefaultIndexSetList()
Returns the list of default index sets- Returns:
- list of default index sets
-
getIndexSetOfChainID
public IndexSet getIndexSetOfChainID(java.lang.String chainID)
Returns the index set of atoms of a given chain ID- Parameters:
chainID
- selected chain ID- Returns:
- index set defined by chain ID
-
setAtomCoordinates
public void setAtomCoordinates(int i, Point3D coordinates)
Sets the coordinates of atom #i- Parameters:
coordinates
- new atomic coordinates
-
setAtomOfIndexCoordinates
public void setAtomOfIndexCoordinates(int index, Point3D coordinates)
Sets the coordinates of atom of given index- Parameters:
coordinates
- new atomic coordinates
-
setAllAtomCoordinates
public void setAllAtomCoordinates(PointList pointlist)
Sets the coordinates of all atoms- Parameters:
pointlist
- list of new atomic coordinates
-
getAllAtomCoordinates
public PointList getAllAtomCoordinates()
Returns the coordinates of all atoms- Returns:
- list of atomic coordinates
-
getSequence
public Sequence getSequence()
Returns the amino acid sequence of the structure- Returns:
- amino acid sequence
-
getChains
public Structure[] getChains()
Returns all chains in an array of Structure objects- Returns:
- array of chains
-
getSubStructure
public Structure getSubStructure(IndexSet indices)
Returns the substructure defined by the given index set- Parameters:
indices
- index set of substructure- Returns:
- substructure
-
convertIndicesToArrayListIndices
public java.util.ArrayList<java.lang.Integer> convertIndicesToArrayListIndices(IndexSet indices)
Converts atomic indices into list indices- Parameters:
indices
- set of atomic indices- Returns:
- list indices
-
mapAtomIndicesToResidueIndices
public java.util.ArrayList<java.lang.Integer> mapAtomIndicesToResidueIndices(IndexSet indices)
Maps atomic indices to residue indices (i.e. returns which residues contain the given atoms). If an atom is not present in any residue it is mapped to residue index -1- Parameters:
indices
- set of atomic indices- Returns:
- residue indices
-
mapResidueIndicesToAtomIndices
public IndexSet mapResidueIndicesToAtomIndices(java.util.ArrayList<java.lang.Integer> indices)
Maps residue indices to atomic indices (i.e. returns which atoms are present in the given residues).- Parameters:
indices
- ArrayList of residue indices- Returns:
- IndexSet of atomic indices
-
toString
public java.lang.String toString()
Returns the String representation of structure- Overrides:
toString
in classjava.lang.Object
- Returns:
- String representation
-
toStringAsGRO
public java.lang.String toStringAsGRO()
Returns the String representation of structure in GRO format- Returns:
- String representation in GRO format
-
toStringAsPDB
public java.lang.String toStringAsPDB()
Returns the String representation of structure in PDB format- Returns:
- String representation in PDB format
-
toStringInfo
public java.lang.String toStringInfo()
Returns summary information about the structure- Returns:
- summary information
-
clone
public java.lang.Object clone()
Returns an identical Structure object- Overrides:
clone
in classjava.lang.Object
- Returns:
- clone of the structure
-
equals
public boolean equals(java.lang.Object other)
Returns true if the two structures are identical- Overrides:
equals
in classjava.lang.Object
- Parameters:
other
- the other structure
-
hashCode
public int hashCode()
Returns hash code- Overrides:
hashCode
in classjava.lang.Object
-
-