Package jgromacs.analysis
Class Distances
- java.lang.Object
-
- jgromacs.analysis.Distances
-
public class Distances extends java.lang.Object
Collection of methods for analysing distances
-
-
Field Summary
Fields Modifier and Type Field Description static int
ALPHACARBON
static int
CLOSEST
static int
CLOSESTHEAVY
-
Constructor Summary
Constructors Constructor Description Distances()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Atom
findClosestAtom(Structure s, IndexSet atomset, IndexSet referenceset)
Returns the atom from a given atom set that is closest to a reference set of atomsstatic PointList
findFrameWhereClosest(Trajectory t, int atomindex1, int atomindex2)
Returns the frame in which two atoms are closest to each other in a simulationstatic PointList
findFrameWhereMostDistant(Trajectory t, int atomindex1, int atomindex2)
Returns the frame in which two atoms are most distant from each other in a simulationstatic Jama.Matrix
getAtomicDistanceMatrix(Structure s)
Calculates the distance matrix of all atoms in a structurestatic Jama.Matrix
getAtomicDistanceMatrix(Structure s, IndexSet indices)
Calculates the distance matrix of atoms of given indices in a structurestatic Jama.Matrix
getAtomicDistanceMatrix(Structure s, IndexSet indices1, IndexSet indices2)
Calculates the distance matrix between two sets of atomsstatic IndexSet
getAtomIndicesInRadius(Structure s, Atom atom, double radius)
Returns the index set of atoms in a structure that are closer to a reference atom than a given radiusstatic IndexSet
getAtomIndicesInRadius(Structure s, IndexSet referenceindices, double radius)
Returns the index set of atoms in a structure that are closer to a reference set of atoms than a given radiusstatic IndexSet
getAtomIndicesInRadius(Structure s, IndexSet atomIndices, IndexSet referenceIndices, double radius)
Returns the index set of atoms from a set of atoms that are closer to a reference set than a given radiusstatic IndexSet
getAtomIndicesInRadius(Structure s, Point3D point, double radius)
Returns the index set of atoms in a structure that are closer to a reference point than a given radiusstatic Jama.Matrix
getContactMatrix(PointList points, double cutoff)
Calculates the contact matrix from a point liststatic Jama.Matrix
getContactMatrix(Structure s, int distanceBetween, double cutoff)
Calculates the contact matrix of residues in a structure by the given methodstatic Jama.Matrix
getContactOfMeanMatrix(Trajectory t, int distanceBetween, double cutoff)
Calculates the contact matrix based on the mean residue distance matrix in a trajectorystatic Jama.Matrix
getDistanceMatrix(PointList points)
Calculates the distance matrix from a point liststatic double
getDistanceOfAtomToAtomSet(Structure s, int atomindex, IndexSet referenceset)
Calculates the distance of an atom to a reference set of atoms (i.e.static double
getDistanceOfTwoAtomSets(Structure s, IndexSet indices1, IndexSet indices2)
Calculates the distance between two sets of atoms (i.e.static double
getDistanceRange(Trajectory t, int atomindex1, int atomindex2)
Returns the range (max-min) of the distance of two atoms in a trajectorystatic java.util.ArrayList<java.lang.Double>
getDistanceTimeSeries(Trajectory t, int atomindex1, int atomindex2)
Returns the time series of the distance of two atoms in a trajectorystatic java.util.ArrayList<java.lang.Double>
getDistanceTimeSeries(Trajectory t, int atomindex, IndexSet referenceset)
Returns the time series of the distance of a single atom and a set of atoms in a trajectorystatic java.util.ArrayList<java.lang.Double>
getDistanceTimeSeries(Trajectory t, IndexSet indices1, IndexSet indices2)
Returns the time series of the distance of two sets of atoms in a trajectorystatic FrameIndexSet
getFramesWhereAtomIsCloseToPoint(Trajectory t, int atomindex, Point3D point, double cutoff)
Returns the list of frames in the trajectory where an atoms is closer to a reference point than a given cutoffstatic FrameIndexSet
getFramesWhereAtomIsDistantFromPoint(Trajectory t, int atomindex, Point3D point, double cutoff)
Returns the list of frames in the trajectory where an atoms is more distant from a reference point than a given cutoffstatic FrameIndexSet
getFramesWhereAtomsAreClose(Trajectory t, int atomindex1, int atomindex2, double cutoff)
Returns the list of frames in a trajectory where two atoms are closer to each other than the given cutoffstatic FrameIndexSet
getFramesWhereAtomsAreDistant(Trajectory t, int atomindex1, int atomindex2, double cutoff)
Returns the list of frames in a trajectory where two atoms are more distant from each other than the given cutoffstatic Jama.Matrix
getFrequencyContactMatrix(Trajectory t, int distanceBetween, double cutoff, double frequency)
Calculates the contact matrix of residues where two residues are said to be in contact if they are in contact in at least the given percentage of frames of the trajectorystatic double
getMaximalDistance(Trajectory t, int atomindex1, int atomindex2)
Returns the maximal distance of two atoms in a trajectorystatic Jama.Matrix
getMeanAtomicDistanceMatrix(Trajectory t)
Calculates the mean distance matrix of all atoms in a trajectorystatic Jama.Matrix
getMeanAtomicDistanceMatrix(Trajectory t, IndexSet indices)
Calculates the mean distance matrix of atoms of given indices in a trajectorystatic double
getMeanDistance(Trajectory t, int atomindex1, int atomindex2)
Returns the mean of the distance of two atoms in a trajectorystatic Jama.Matrix
getMeanResidueDistanceMatrix(Trajectory t, int distanceBetween)
Calculates the mean distance matrix of residues in a trajectory by the given methodstatic double
getMinimalDistance(Trajectory t, int atomindex1, int atomindex2)
Returns the minimal distance of two atoms in a trajectorystatic Jama.Matrix
getResidueDistanceMatrix(Structure s, int distanceBetween)
Calculates the distance matrix of residues in a structure by the given methodstatic double
getVarianceOfDistance(Trajectory t, int atomindex1, int atomindex2)
Returns the variance of the distance of two atoms in a trajectory
-
-
-
Field Detail
-
ALPHACARBON
public static final int ALPHACARBON
- See Also:
- Constant Field Values
-
CLOSEST
public static final int CLOSEST
- See Also:
- Constant Field Values
-
CLOSESTHEAVY
public static final int CLOSESTHEAVY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDistanceMatrix
public static Jama.Matrix getDistanceMatrix(PointList points)
Calculates the distance matrix from a point list- Parameters:
points
- point list- Returns:
- distance matrix
-
getAtomicDistanceMatrix
public static Jama.Matrix getAtomicDistanceMatrix(Structure s)
Calculates the distance matrix of all atoms in a structure- Parameters:
s
- structure- Returns:
- distance matrix
-
getAtomicDistanceMatrix
public static Jama.Matrix getAtomicDistanceMatrix(Structure s, IndexSet indices)
Calculates the distance matrix of atoms of given indices in a structure- Parameters:
s
- structureindices
- index set- Returns:
- distance matrix
-
getAtomicDistanceMatrix
public static Jama.Matrix getAtomicDistanceMatrix(Structure s, IndexSet indices1, IndexSet indices2)
Calculates the distance matrix between two sets of atoms- Parameters:
s
- structureindices1
- index set 1indices2
- index set 2- Returns:
- distance matrix
-
getResidueDistanceMatrix
public static Jama.Matrix getResidueDistanceMatrix(Structure s, int distanceBetween)
Calculates the distance matrix of residues in a structure by the given method- Parameters:
s
- structuredistanceBetween
- which atoms are used for calculating the distances (ALPHACARBON: alpha carbon atoms, CLOSEST: closest atoms of two residues, CLOSESTHEAVY: closest heavy atoms of two residues)- Returns:
- distance matrix
-
getMeanAtomicDistanceMatrix
public static Jama.Matrix getMeanAtomicDistanceMatrix(Trajectory t)
Calculates the mean distance matrix of all atoms in a trajectory- Parameters:
t
- trajecotry- Returns:
- mean distance matrix
-
getMeanAtomicDistanceMatrix
public static Jama.Matrix getMeanAtomicDistanceMatrix(Trajectory t, IndexSet indices)
Calculates the mean distance matrix of atoms of given indices in a trajectory- Parameters:
t
- trajecotryindices
- index set- Returns:
- mean distance matrix
-
getMeanResidueDistanceMatrix
public static Jama.Matrix getMeanResidueDistanceMatrix(Trajectory t, int distanceBetween)
Calculates the mean distance matrix of residues in a trajectory by the given method- Parameters:
t
- trajectorydistanceBetween
- which atoms are used for calculating the distances (ALPHACARBON: alpha carbon atoms, CLOSEST: closest atoms of two residues, CLOSESTHEAVY: closest heavy atoms of two residues)- Returns:
- mean distance matrix
-
getContactMatrix
public static Jama.Matrix getContactMatrix(PointList points, double cutoff)
Calculates the contact matrix from a point list- Parameters:
points
- point listcutoff
- distance cutoff- Returns:
- contact matrix
-
getContactMatrix
public static Jama.Matrix getContactMatrix(Structure s, int distanceBetween, double cutoff)
Calculates the contact matrix of residues in a structure by the given method- Parameters:
s
- structuredistanceBetween
- which atoms are used for calculating the distances (ALPHACARBON: alpha carbon atoms, CLOSEST: closest atoms of two residues, CLOSESTHEAVY: closest heavy atoms of two residues)cutoff
- distance cutoff- Returns:
- contact matrix
-
getContactOfMeanMatrix
public static Jama.Matrix getContactOfMeanMatrix(Trajectory t, int distanceBetween, double cutoff)
Calculates the contact matrix based on the mean residue distance matrix in a trajectory- Parameters:
t
- trajectorydistanceBetween
- which atoms are used for calculating the distances (ALPHACARBON: alpha carbon atoms, CLOSEST: closest atoms of two residues, CLOSESTHEAVY: closest heavy atoms of two residues)cutoff
- distance cutoff- Returns:
- contact matrix
-
getFrequencyContactMatrix
public static Jama.Matrix getFrequencyContactMatrix(Trajectory t, int distanceBetween, double cutoff, double frequency)
Calculates the contact matrix of residues where two residues are said to be in contact if they are in contact in at least the given percentage of frames of the trajectory- Parameters:
t
- trajectorydistanceBetween
- which atoms are used for calculating the distances (ALPHACARBON: alpha carbon atoms, CLOSEST: closest atoms of two residues, CLOSESTHEAVY: closest heavy atoms of two residues)cutoff
- distance cutofffrequency
- minimal frequency of frames in which two residues are in contact- Returns:
- contact matrix
-
getDistanceTimeSeries
public static java.util.ArrayList<java.lang.Double> getDistanceTimeSeries(Trajectory t, int atomindex1, int atomindex2)
Returns the time series of the distance of two atoms in a trajectory- Parameters:
t
- trajectoryatomindex1
- index of first atomatomindex2
- index of second atom- Returns:
- time series of distance
-
getDistanceTimeSeries
public static java.util.ArrayList<java.lang.Double> getDistanceTimeSeries(Trajectory t, int atomindex, IndexSet referenceset)
Returns the time series of the distance of a single atom and a set of atoms in a trajectory- Parameters:
t
- trajectoryatomindex
- index of atomreferenceset
- index set of reference atoms- Returns:
- time series of distance
-
getDistanceTimeSeries
public static java.util.ArrayList<java.lang.Double> getDistanceTimeSeries(Trajectory t, IndexSet indices1, IndexSet indices2)
Returns the time series of the distance of two sets of atoms in a trajectory- Parameters:
t
- trajectoryindices1
- first index setindices2
- second index set- Returns:
- time series of distance
-
getMeanDistance
public static double getMeanDistance(Trajectory t, int atomindex1, int atomindex2)
Returns the mean of the distance of two atoms in a trajectory- Parameters:
t
- trajectoryatomindex1
- index of first atomatomindex2
- index of second atom- Returns:
- mean of distance
-
getVarianceOfDistance
public static double getVarianceOfDistance(Trajectory t, int atomindex1, int atomindex2)
Returns the variance of the distance of two atoms in a trajectory- Parameters:
t
- trajectoryatomindex1
- index of first atomatomindex2
- index of second atom- Returns:
- variance of distance
-
getMinimalDistance
public static double getMinimalDistance(Trajectory t, int atomindex1, int atomindex2)
Returns the minimal distance of two atoms in a trajectory- Parameters:
t
- trajectoryatomindex1
- index of first atomatomindex2
- index of second atom- Returns:
- minimal distance
-
getMaximalDistance
public static double getMaximalDistance(Trajectory t, int atomindex1, int atomindex2)
Returns the maximal distance of two atoms in a trajectory- Parameters:
t
- trajectoryatomindex1
- index of first atomatomindex2
- index of second atom- Returns:
- maximal distance
-
getDistanceRange
public static double getDistanceRange(Trajectory t, int atomindex1, int atomindex2)
Returns the range (max-min) of the distance of two atoms in a trajectory- Parameters:
t
- trajectoryatomindex1
- index of first atomatomindex2
- index of second atom- Returns:
- size of distance interval
-
getAtomIndicesInRadius
public static IndexSet getAtomIndicesInRadius(Structure s, Point3D point, double radius)
Returns the index set of atoms in a structure that are closer to a reference point than a given radius- Parameters:
s
- structurepoint
- reference pointradius
- distance radius- Returns:
- atom indices
-
getAtomIndicesInRadius
public static IndexSet getAtomIndicesInRadius(Structure s, Atom atom, double radius)
Returns the index set of atoms in a structure that are closer to a reference atom than a given radius- Parameters:
s
- structureatom
- reference atomradius
- distance radius- Returns:
- atom indices
-
getAtomIndicesInRadius
public static IndexSet getAtomIndicesInRadius(Structure s, IndexSet referenceindices, double radius)
Returns the index set of atoms in a structure that are closer to a reference set of atoms than a given radius- Parameters:
s
- structurereferenceindices
- index set of reference atomsradius
- distance radius- Returns:
- atom indices
-
getAtomIndicesInRadius
public static IndexSet getAtomIndicesInRadius(Structure s, IndexSet atomIndices, IndexSet referenceIndices, double radius)
Returns the index set of atoms from a set of atoms that are closer to a reference set than a given radius- Parameters:
s
- structureatomIndices
- index set of atoms testedreferenceIndices
- index set of reference atomsradius
- distance radius- Returns:
- atom indices
-
findFrameWhereClosest
public static PointList findFrameWhereClosest(Trajectory t, int atomindex1, int atomindex2)
Returns the frame in which two atoms are closest to each other in a simulation- Parameters:
t
- trajectoryatomindex1
- index of first atomatomindex2
- index of second atom- Returns:
- frame of trajectory
-
findFrameWhereMostDistant
public static PointList findFrameWhereMostDistant(Trajectory t, int atomindex1, int atomindex2)
Returns the frame in which two atoms are most distant from each other in a simulation- Parameters:
t
- trajectoryatomindex1
- index of first atomatomindex2
- index of second atom- Returns:
- frame of trajectory
-
getDistanceOfAtomToAtomSet
public static double getDistanceOfAtomToAtomSet(Structure s, int atomindex, IndexSet referenceset)
Calculates the distance of an atom to a reference set of atoms (i.e. the minimum of all pairwise distances)- Parameters:
s
- structureatomindex
- index of atomreferenceset
- index set of reference atoms- Returns:
- minimal distance
-
getDistanceOfTwoAtomSets
public static double getDistanceOfTwoAtomSets(Structure s, IndexSet indices1, IndexSet indices2)
Calculates the distance between two sets of atoms (i.e. the minimum of all pairwise distances)- Parameters:
s
- structureindices1
- first index setindices2
- second index set- Returns:
- minimal distance
-
findClosestAtom
public static Atom findClosestAtom(Structure s, IndexSet atomset, IndexSet referenceset)
Returns the atom from a given atom set that is closest to a reference set of atoms- Parameters:
s
- structureatomset
- index set of atomsreferenceset
- index set of reference atoms- Returns:
- closest atom
-
getFramesWhereAtomsAreClose
public static FrameIndexSet getFramesWhereAtomsAreClose(Trajectory t, int atomindex1, int atomindex2, double cutoff)
Returns the list of frames in a trajectory where two atoms are closer to each other than the given cutoff- Parameters:
t
- trajectoryatomindex1
- index of first atomatomindex2
- index of second atomcutoff
- distance cutoff- Returns:
- frame list
-
getFramesWhereAtomsAreDistant
public static FrameIndexSet getFramesWhereAtomsAreDistant(Trajectory t, int atomindex1, int atomindex2, double cutoff)
Returns the list of frames in a trajectory where two atoms are more distant from each other than the given cutoff- Parameters:
t
- trajectoryatomindex1
- index of first atomatomindex2
- index of second atomcutoff
- distance cutoff- Returns:
- frame list
-
getFramesWhereAtomIsCloseToPoint
public static FrameIndexSet getFramesWhereAtomIsCloseToPoint(Trajectory t, int atomindex, Point3D point, double cutoff)
Returns the list of frames in the trajectory where an atoms is closer to a reference point than a given cutoff- Parameters:
t
- trajectoryatomindex
- index of atompoint
- reference pointcutoff
- distance cutoff- Returns:
- frame list
-
getFramesWhereAtomIsDistantFromPoint
public static FrameIndexSet getFramesWhereAtomIsDistantFromPoint(Trajectory t, int atomindex, Point3D point, double cutoff)
Returns the list of frames in the trajectory where an atoms is more distant from a reference point than a given cutoff- Parameters:
t
- trajectoryatomindex
- index of atompoint
- reference pointcutoff
- distance cutoff- Returns:
- frame list
-
-