Package jgromacs.data
Class Trajectory
- java.lang.Object
-
- jgromacs.data.Trajectory
-
- All Implemented Interfaces:
java.lang.Cloneable
public class Trajectory extends java.lang.Object implements java.lang.Cloneable
Objects of this class represent a single trajectory
-
-
Constructor Summary
Constructors Constructor Description Trajectory()
Constructs a new Trajectory objectTrajectory(java.lang.String name)
Constructs a new Trajectory object of given nameTrajectory(Structure structure)
Constructs a new Trajectory object of given structureTrajectory(Structure[] ensemble)
Constructs a new Trajectory object made from an ensemble of structures
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFrame(PointList frame)
Adds a new frame to the trajectoryjava.lang.Object
clone()
Returns an identical Trajectory objectdouble
convertFrameIndexToTime(int frameindex)
Converts frame index to simulation timeint
convertTimeToFrameIndex(double time)
Converts simulation time to frame indexboolean
equals(java.lang.Object other)
Returns true if the two trajectories are identicalPointList
getFirstFrameAsPointList()
Returns the initial frame of trajectory as a PointListStructure
getFirstFrameAsStructure()
Returns the initial frame of trajectory as a StructurePointList
getFrameAsPointList(int i)
Returns frame #i of the trajectory as a PointList objectStructure
getFrameAsStructure(int i)
Returns frame #i of the trajectory as a Structure objectjava.util.ArrayList<PointList>
getFrames()
Returns frames of the trajectory as an ArrayList objectPointList
getLastFrameAsPointList()
Returns the last frame of trajectory as a PointListStructure
getLastFrameAsStructure()
Returns the last frame of trajectory as a StructurePointList
getMeanFrame()
Returns the mean frame of trajectoryjava.lang.String
getName()
Returns the name of trajectoryint
getNumberOfAtoms()
Returns the number of atoms in the trajectoryint
getNumberOfFrames()
Returns the number of frames in the trajectoryint
getNumberOfResidues()
Returns the number of residues in the trajectorydouble
getStartTime()
Returns the start time of trajectoryTrajectory
getSubTrajectory(int startframe, int endframe)
Returns the subtrajectory between the given start and end framesTrajectory
getSubTrajectory(int startframe, int endframe, int frequency)
Returns the subtrajectory between the given start and end frames using the given sampling frequencyTrajectory
getSubTrajectory(FrameIndexSet framelist)
Returns the subtrajectory defined by the given frame listTrajectory
getSubTrajectory(IndexSet indices)
Returns the subtrajectory defined by the given index setdouble
getTimeStep()
Returns the time step of trajectoryint
hashCode()
Returns hash codevoid
removeFrame(int i)
Removes frame #i from the trajectoryvoid
setFrame(int i, PointList frame)
Replaces frame #i with a new framevoid
setName(java.lang.String name)
Sets the name of trajectoryvoid
setStartTime(double startTime)
Sets the start time of trajectoryvoid
setStructure(Structure structure)
Sets the structure described by the trajectoryvoid
setTimeStep(double timeStep)
Sets the time step of trajectoryjava.lang.String
toString()
Returns the String representation of trajectory
-
-
-
Constructor Detail
-
Trajectory
public Trajectory()
Constructs a new Trajectory object
-
Trajectory
public Trajectory(java.lang.String name)
Constructs a new Trajectory object of given name
-
Trajectory
public Trajectory(Structure structure)
Constructs a new Trajectory object of given structure
-
Trajectory
public Trajectory(Structure[] ensemble)
Constructs a new Trajectory object made from an ensemble of structures
-
-
Method Detail
-
getFrames
public java.util.ArrayList<PointList> getFrames()
Returns frames of the trajectory as an ArrayList object- Returns:
- frames as an ArrayList
-
getFrameAsPointList
public PointList getFrameAsPointList(int i)
Returns frame #i of the trajectory as a PointList object- Returns:
- frame #i as a PointList
-
getFrameAsStructure
public Structure getFrameAsStructure(int i)
Returns frame #i of the trajectory as a Structure object- Returns:
- frame #i as a Structure
-
getNumberOfFrames
public int getNumberOfFrames()
Returns the number of frames in the trajectory- Returns:
- number of frames
-
getName
public java.lang.String getName()
Returns the name of trajectory- Returns:
- name of trajectory
-
setName
public void setName(java.lang.String name)
Sets the name of trajectory- Parameters:
name
- name of trajectory
-
getStartTime
public double getStartTime()
Returns the start time of trajectory- Returns:
- start time of trajectory
-
setStartTime
public void setStartTime(double startTime)
Sets the start time of trajectory- Parameters:
startTime
- start time of trajectory
-
getTimeStep
public double getTimeStep()
Returns the time step of trajectory- Returns:
- time step of trajectory
-
setTimeStep
public void setTimeStep(double timeStep)
Sets the time step of trajectory- Parameters:
timeStep
- time step of trajectory
-
setStructure
public void setStructure(Structure structure)
Sets the structure described by the trajectory- Parameters:
structure
- structure described by the trajectory
-
getMeanFrame
public PointList getMeanFrame()
Returns the mean frame of trajectory- Returns:
- mean frame
-
getNumberOfAtoms
public int getNumberOfAtoms()
Returns the number of atoms in the trajectory- Returns:
- number of atoms
-
getNumberOfResidues
public int getNumberOfResidues()
Returns the number of residues in the trajectory- Returns:
- number of residues
-
getFirstFrameAsPointList
public PointList getFirstFrameAsPointList()
Returns the initial frame of trajectory as a PointList- Returns:
- initial frame
-
getFirstFrameAsStructure
public Structure getFirstFrameAsStructure()
Returns the initial frame of trajectory as a Structure- Returns:
- initial frame
-
getLastFrameAsPointList
public PointList getLastFrameAsPointList()
Returns the last frame of trajectory as a PointList- Returns:
- last frame
-
getLastFrameAsStructure
public Structure getLastFrameAsStructure()
Returns the last frame of trajectory as a Structure- Returns:
- last frame
-
addFrame
public void addFrame(PointList frame)
Adds a new frame to the trajectory- Parameters:
frame
- new frame
-
removeFrame
public void removeFrame(int i)
Removes frame #i from the trajectory
-
setFrame
public void setFrame(int i, PointList frame)
Replaces frame #i with a new frame- Parameters:
frame
- new frame
-
convertFrameIndexToTime
public double convertFrameIndexToTime(int frameindex)
Converts frame index to simulation time- Parameters:
frameindex
- frame index- Returns:
- simulation time
-
convertTimeToFrameIndex
public int convertTimeToFrameIndex(double time)
Converts simulation time to frame index- Parameters:
time
- simulation time- Returns:
- frame index
-
getSubTrajectory
public Trajectory getSubTrajectory(int startframe, int endframe)
Returns the subtrajectory between the given start and end frames- Parameters:
startframe
- start frameendframe
- end frame- Returns:
- subtrajectory
-
getSubTrajectory
public Trajectory getSubTrajectory(int startframe, int endframe, int frequency)
Returns the subtrajectory between the given start and end frames using the given sampling frequency- Parameters:
startframe
- start frameendframe
- end framefrequency
- sampling frequency- Returns:
- subtrajectory
-
getSubTrajectory
public Trajectory getSubTrajectory(IndexSet indices)
Returns the subtrajectory defined by the given index set- Parameters:
indices
- index set of subtrajectory- Returns:
- subtrajectory
-
getSubTrajectory
public Trajectory getSubTrajectory(FrameIndexSet framelist)
Returns the subtrajectory defined by the given frame list- Parameters:
framelist
- frame list- Returns:
- subtrajectory
-
toString
public java.lang.String toString()
Returns the String representation of trajectory- Overrides:
toString
in classjava.lang.Object
- Returns:
- String representation
-
equals
public boolean equals(java.lang.Object other)
Returns true if the two trajectories are identical- Overrides:
equals
in classjava.lang.Object
- Parameters:
other
- the other trajectory
-
hashCode
public int hashCode()
Returns hash code- Overrides:
hashCode
in classjava.lang.Object
-
clone
public java.lang.Object clone()
Returns an identical Trajectory object- Overrides:
clone
in classjava.lang.Object
- Returns:
- clone of the trajectory
-
-