Package jgromacs.data
Class Structure
java.lang.Object
jgromacs.data.Structure
- All Implemented Interfaces:
Cloneable
Objects of this class represent a single structure
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 structureclone()
Returns an identical Structure objectconvertIndicesToArrayListIndices
(IndexSet indices) Converts atomic indices into list indicesboolean
Returns true if the two structures are identicalReturns the coordinates of all atomsReturns the index set of alpha carbon atomsgetAtom
(int i) Returns atom #i of the structuregetAtomByIndex
(int index) Returns the atom of given indexgetAtomInResidueOfIndex
(int residueindex, int i) Returns atom #i of the residue of given indexgetAtomInResidueOfIndex
(int residueindex, String chainID, int i) Returns atom #i of the residue of given index and chain IDReturns the index set of backbone atomsReturns the list of chain IDs in the structureReturns all chains in an array of Structure objectsReturns the list of default index setsReturns the index set of protein atoms except of hydrogen atomsgetIndexSetOfChainID
(String chainID) Returns the index set of atoms of a given chain IDReturns the index set of main chain atomsReturns the index set of main chain plus beta carbon atomsReturns the index set of main chain plus hydrogen atomsgetName()
Returns the name of structureReturns the index set of non-protein atomsint
Returns the number of atoms in the structureint
Returns the number of chains in the structureint
Returns the number of residues in the structureReturns the index set of protein atomsgetResidue
(int i) Returns residue #i of the structuregetResidueByIndex
(int index) Returns the residue of given indexgetResidueByIndex
(int index, String chainID) Returns the residue of given index and given chain IDReturns residues as an ArrayList objectReturns the amino acid sequence of the structureReturns the index set of side chain atomsReturns the index set of side chain atoms except of hydrogen atomsgetSubStructure
(IndexSet indices) Returns the substructure defined by the given index setReturns the index set of all atoms in the systemReturns the index set of water atomsint
hashCode()
Returns hash codemapAtomIndicesToResidueIndices
(IndexSet indices) Maps atomic indices to residue indices (i.e.mapResidueIndicesToAtomIndices
(ArrayList<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
Sets the name of structurevoid
setResidue
(int i, Residue residue) Replaces residue #i with a new residuetoString()
Returns the String representation of structureReturns the String representation of structure in GRO formatReturns the String representation of structure in PDB formatReturns summary information about the structure
-
Constructor Details
-
Structure
public Structure()Constructs a new Structure object -
Structure
Constructs a new Structure object of given name
-
-
Method Details
-
getName
Returns the name of structure- Returns:
- name of structure
-
setName
Sets the name of structure- Parameters:
name
- of structure
-
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
Returns the list of chain IDs in the structure- Returns:
- list of chain IDs
-
getResidue
Returns residue #i of the structure- Returns:
- residue #i
-
getResidueByIndex
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
Returns the residue of given index- Parameters:
index
- index of residue- Returns:
- residue of given index
-
getAtom
Returns atom #i of the structure- Returns:
- atom #i
-
getAtomByIndex
Returns the atom of given index- Parameters:
index
- index of atom- Returns:
- atom of given index
-
getAtomInResidueOfIndex
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
Returns atom #i of the residue of given index- Parameters:
residueindex
- index of residue- Returns:
- atom #i in residue of given index
-
addResidue
Adds a new residue to the structure- Parameters:
residue
- new residue
-
removeResidue
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
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
Removes the given atom from the structure- Parameters:
atom
- the atom to be removed
-
addAtomToResidue
Adds the given atom to residue #i- Parameters:
atom
- new atom
-
addAtomToResidueOfIndex
Adds the given atom to the residue of given index- Parameters:
index
- index of residueatom
- new atom
-
setAtomInResidue
Replaces atom #j of residue #i with a new atom- Parameters:
atom
- new atom
-
setAtomInResidueOfIndex
Replaces atom #i of the residue of given index with a new atom- Parameters:
index
- index of residueatom
- new atom
-
getSystemIndexSet
Returns the index set of all atoms in the system- Returns:
- index set of all atoms
-
getProteinIndexSet
Returns the index set of protein atoms- Returns:
- index set of protein atoms
-
getHeavyProteinIndexSet
Returns the index set of protein atoms except of hydrogen atoms- Returns:
- index set of protein atoms except of hydrogen atoms
-
getAlphaCarbonIndexSet
Returns the index set of alpha carbon atoms- Returns:
- index set of alpha carbon atoms
-
getBackboneIndexSet
Returns the index set of backbone atoms- Returns:
- index set of backbone atoms
-
getMainChainIndexSet
Returns the index set of main chain atoms- Returns:
- index set of main chain atoms
-
getMainChainPlusCbIndexSet
Returns the index set of main chain plus beta carbon atoms- Returns:
- index set of main chain plus beta carbon atoms
-
getMainChainPlusHIndexSet
Returns the index set of main chain plus hydrogen atoms- Returns:
- index set of main chain plus hydrogen atoms
-
getSideChainIndexSet
Returns the index set of side chain atoms- Returns:
- index set of side chain atoms
-
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
Returns the index set of non-protein atoms- Returns:
- index set of non-protein atoms
-
getWaterIndexSet
Returns the index set of water atoms- Returns:
- index set of water atoms
-
getDefaultIndexSetList
Returns the list of default index sets- Returns:
- list of default index sets
-
getIndexSetOfChainID
Returns the index set of atoms of a given chain ID- Parameters:
chainID
- selected chain ID- Returns:
- index set defined by chain ID
-
setAtomCoordinates
Sets the coordinates of atom #i- Parameters:
coordinates
- new atomic coordinates
-
setAtomOfIndexCoordinates
Sets the coordinates of atom of given index- Parameters:
coordinates
- new atomic coordinates
-
setAllAtomCoordinates
Sets the coordinates of all atoms- Parameters:
pointlist
- list of new atomic coordinates
-
getAllAtomCoordinates
Returns the coordinates of all atoms- Returns:
- list of atomic coordinates
-
getSequence
Returns the amino acid sequence of the structure- Returns:
- amino acid sequence
-
getChains
Returns all chains in an array of Structure objects- Returns:
- array of chains
-
getSubStructure
Returns the substructure defined by the given index set- Parameters:
indices
- index set of substructure- Returns:
- substructure
-
convertIndicesToArrayListIndices
Converts atomic indices into list indices- Parameters:
indices
- set of atomic indices- Returns:
- list indices
-
mapAtomIndicesToResidueIndices
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
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
Returns the String representation of structure -
toStringAsGRO
Returns the String representation of structure in GRO format- Returns:
- String representation in GRO format
-
toStringAsPDB
Returns the String representation of structure in PDB format- Returns:
- String representation in PDB format
-
toStringInfo
Returns summary information about the structure- Returns:
- summary information
-
clone
Returns an identical Structure object -
equals
Returns true if the two structures are identical -
hashCode
public int hashCode()Returns hash code
-