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.CloneableObjects 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 voidaddFrame(PointList frame)Adds a new frame to the trajectoryjava.lang.Objectclone()Returns an identical Trajectory objectdoubleconvertFrameIndexToTime(int frameindex)Converts frame index to simulation timeintconvertTimeToFrameIndex(double time)Converts simulation time to frame indexbooleanequals(java.lang.Object other)Returns true if the two trajectories are identicalPointListgetFirstFrameAsPointList()Returns the initial frame of trajectory as a PointListStructuregetFirstFrameAsStructure()Returns the initial frame of trajectory as a StructurePointListgetFrameAsPointList(int i)Returns frame #i of the trajectory as a PointList objectStructuregetFrameAsStructure(int i)Returns frame #i of the trajectory as a Structure objectjava.util.ArrayList<PointList>getFrames()Returns frames of the trajectory as an ArrayList objectPointListgetLastFrameAsPointList()Returns the last frame of trajectory as a PointListStructuregetLastFrameAsStructure()Returns the last frame of trajectory as a StructurePointListgetMeanFrame()Returns the mean frame of trajectoryjava.lang.StringgetName()Returns the name of trajectoryintgetNumberOfAtoms()Returns the number of atoms in the trajectoryintgetNumberOfFrames()Returns the number of frames in the trajectoryintgetNumberOfResidues()Returns the number of residues in the trajectorydoublegetStartTime()Returns the start time of trajectoryTrajectorygetSubTrajectory(int startframe, int endframe)Returns the subtrajectory between the given start and end framesTrajectorygetSubTrajectory(int startframe, int endframe, int frequency)Returns the subtrajectory between the given start and end frames using the given sampling frequencyTrajectorygetSubTrajectory(FrameIndexSet framelist)Returns the subtrajectory defined by the given frame listTrajectorygetSubTrajectory(IndexSet indices)Returns the subtrajectory defined by the given index setdoublegetTimeStep()Returns the time step of trajectoryinthashCode()Returns hash codevoidremoveFrame(int i)Removes frame #i from the trajectoryvoidsetFrame(int i, PointList frame)Replaces frame #i with a new framevoidsetName(java.lang.String name)Sets the name of trajectoryvoidsetStartTime(double startTime)Sets the start time of trajectoryvoidsetStructure(Structure structure)Sets the structure described by the trajectoryvoidsetTimeStep(double timeStep)Sets the time step of trajectoryjava.lang.StringtoString()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:
toStringin classjava.lang.Object- Returns:
- String representation
-
equals
public boolean equals(java.lang.Object other)
Returns true if the two trajectories are identical- Overrides:
equalsin classjava.lang.Object- Parameters:
other- the other trajectory
-
hashCode
public int hashCode()
Returns hash code- Overrides:
hashCodein classjava.lang.Object
-
clone
public java.lang.Object clone()
Returns an identical Trajectory object- Overrides:
clonein classjava.lang.Object- Returns:
- clone of the trajectory
-
-