Package src :: Package toplevel :: Module IO :: Class IO
[hide private]
[frames] | no frames]

Class IO

source code

Controls output, for data analysis purposes. Flexible and can output several different types of observables, in formats such as screen, plots, and output files.

Instance Methods [hide private]
 
__init__(self) source code
 
__setattr__(self, att, val) source code
 
reset(self)
Reset the state of the IO object.
source code
 
nextLargest(self, step, freq) source code
 
computeNext(self, currentstep, remcom, remang) source code
string
checkPath(self, filename)
If the passed filename does not exist, append the MDL root directory to it.
source code
 
readPSF(self, phys, psfname)
Read a PSF file and populate atomic positions.
source code
 
readPAR(self, phys, parname)
Read a CHARMM parameter file and populate the topology.
source code
 
readGromacs(self, phys, topname, parname, gbname="")
Read Gromacs input files, and convert them
source code
 
readPDBPos(self, phys, pdbname)
Read a PDB position file and populate atomic positions.
source code
 
readPDBVel(self, phys, pdbname)
Read a PDB velocity file and populate atomic velocities.
source code
 
readXYZPos(self, phys, xyzname)
Read a XYZ position file and populate atomic positions.
source code
 
readXYZBinPos(self, phys, xyzname)
Read a XYZ position file and populate atomic positions.
source code
 
readXYZVel(self, phys, xyzname)
Read a XYZ velocity file and populate atomic velocities.
source code
 
readXYZBinVel(self, phys, xyzname)
Read a XYZ velocity file and populate atomic velocities.
source code
 
readDCDTrajectoryPos(self, phys, dcdname)
Read a DCD trajectory file and populate atomic positions.
source code
 
readDCDTrajectoryVel(self, phys, dcdname)
Read a DCD trajectory file and populate atomic positions.
source code
 
readEigenvectors(self, phys, eigname)
Read a eigenvector file and populate normal mode data.
source code
 
writePDBPos(self, phys, pdbname)
Write atomic positions to a PDB file.
source code
 
writePDBVel(self, phys, pdbname)
Write atomic velocities to a PDB file.
source code
 
writeXYZPos(self, phys, xyzname)
Write atomic positions to a XYZ file.
source code
 
writeXYZVel(self, phys, xyzname)
Write atomic velocities to a XYZ file.
source code
 
runOutput(self, phys, forces, step, ts, *args)
Run all registered outputs For propagator objects this is called automatically, but for propagator functions it needs to be called from within.
source code
 
newGraph(self, xlab, ylab)
Create and return a new Gnuplot or Matplotlib graph object (thus return type is flexible depending on which is used).
source code
 
plotVector(self, prop, graph, vec, rangex=[], rangey=[])
Plot a vector of (x,y) data of the form [[x1,y1],[x2,y2],...]
source code
 
plotQuantity(self, step, quantity, name)
Plot the passed step and quantity using a specific graph name.
source code
 
plotPotential(self, phys, forces, step)
Instantaneously plot the potential energy of the system.
source code
 
plotKinetic(self, phys, forces, step)
Similar, for kinetic energy
source code
 
plotTotal(self, phys, forces, step)
Similar, for total energy
source code
 
plotTemperature(self, phys, forces, step)
Similar, for temperature
source code
 
plotPressure(self, phys, forces, step)
Similar, for pressure
source code
 
plotVolume(self, phys, forces, step)
Similar, for system volume
source code
 
plotCoulombEnergy(self, phys, forces, step)
Similar, for electrostatic energy
source code
 
plotLJEnergy(self, phys, forces, step)
Similar, for van der Waals energy
source code
 
plotBondEnergy(self, phys, forces, step)
Similar, for energy between two-atom bonds
source code
 
plotAngleEnergy(self, phys, forces, step)
Similar, for energy between three-atom angles
source code
 
plotDihedralEnergy(self, phys, forces, step)
Similar, for energy between four-atom dihedrals
source code
 
plotImproperEnergy(self, phys, forces, step)
Similar, for energy between four-atom impropers
source code
 
plotShadowEnergy(self, phys, forces, step)
Similar, for shadow energy
source code
 
runPlots(self, phys, forces, step, ts)
Run all plots registered in the plots dictionary.
source code
 
build(self)
Instantiate all file I/O and plots.
source code
 
recache(self, phys)
Restore the output cache.
source code
 
run(self, phys, forces, step, ts, *args)
Run all plots registered in the plots dictionary.
source code
Instance Variables [hide private]
  myOutputs
List of desired outputs
  myPlots
List of plots (Python functions)
  doMPL
Using Matplotlib?
  pause
Pause frequency (0=Never)
  graphLabelsX
Array of x-axis graph labels
  graphLabelsY
Array of y-axis graph labels
  xyData
Maps graph name to xy data
  graphs
Maps graph name to Gnuplot object
  xData
Maps graph name to x data
  yData
Maps graph name to y data
  figures
Maps graph name to Matplotlib object
  mplFigCount
Number of figures
  dcdfiles
Array of DCD filenames
  screen
Frequency to perform screen output
  plots
Map of plot names to frequency, all default to -1 (never)
  files
Map of file output names to (filename freq), default is ('', -1) - no file, never
  plotFunctions
Map of plot names to functions which perform the plotting.
  dirty
Dirty bit, set to 1 if data members have been modified since the last propagation
Method Details [hide private]

checkPath(self, filename)

source code 

If the passed filename does not exist, append the MDL root directory to it. This allows users to specify either absolute or relative paths for their input files.

Parameters:
  • filename (string) - Absolute or relative path to a file.
Returns: string
Absolute path to the file (MDL root directory appended if the supplied path was relative).

readPSF(self, phys, psfname)

source code 

Read a PSF file and populate atomic positions.

Parameters:
  • phys (Physical) - The physical system.
  • psfname (string) - PSF file name.

readPAR(self, phys, parname)

source code 

Read a CHARMM parameter file and populate the topology.

Parameters:
  • phys (Physical) - The physical system.
  • parname (string) - CHARMM parameter file name.

readGromacs(self, phys, topname, parname, gbname="")

source code 

Read Gromacs input files, and convert them

Parameters:
  • phys (Physical) - The physical system.
  • topname (string) - Gromacs Topology file name.
  • parname (string) - AMBER parameter file name.

readPDBPos(self, phys, pdbname)

source code 

Read a PDB position file and populate atomic positions.

Parameters:
  • phys (Physical) - The physical system.
  • pdbname (string) - PDB file name.

readPDBVel(self, phys, pdbname)

source code 

Read a PDB velocity file and populate atomic velocities.

Parameters:
  • phys (Physical) - The physical system.
  • pdbname (string) - PDB file name.

readXYZPos(self, phys, xyzname)

source code 

Read a XYZ position file and populate atomic positions.

Parameters:
  • phys (Physical) - The physical system.
  • xyzname (string) - XYZ file name.

readXYZBinPos(self, phys, xyzname)

source code 

Read a XYZ position file and populate atomic positions.

Parameters:
  • phys (Physical) - The physical system.
  • xyzname (string) - XYZ file name.

readXYZVel(self, phys, xyzname)

source code 

Read a XYZ velocity file and populate atomic velocities.

Parameters:
  • phys (Physical) - The physical system.
  • xyzname (string) - XYZ file name.

readXYZBinVel(self, phys, xyzname)

source code 

Read a XYZ velocity file and populate atomic velocities.

Parameters:
  • phys (Physical) - The physical system.
  • xyzname (string) - XYZ file name.

readDCDTrajectoryPos(self, phys, dcdname)

source code 

Read a DCD trajectory file and populate atomic positions. This routine saves state, so that upon the next invocation the next trajectory will be read.

Parameters:
  • phys (Physical) - The physical system.
  • dcdname (string) - DCD trajectory file name.

readDCDTrajectoryVel(self, phys, dcdname)

source code 

Read a DCD trajectory file and populate atomic positions. This routine saves state, so that upon the next invocation the next trajectory will be read.

Parameters:
  • phys (Physical) - The physical system.
  • dcdname (string) - DCD trajectory file name.

readEigenvectors(self, phys, eigname)

source code 

Read a eigenvector file and populate normal mode data.

Parameters:
  • phys (Physical) - The physical system.
  • eigname (string) - Eigenvector file name.

writePDBPos(self, phys, pdbname)

source code 

Write atomic positions to a PDB file.

Parameters:
  • phys (Physical) - The physical system.
  • pdbname (string) - PDB file name.

writePDBVel(self, phys, pdbname)

source code 

Write atomic velocities to a PDB file.

Parameters:
  • phys (Physical) - The physical system.
  • pdbname (string) - PDB file name.

writeXYZPos(self, phys, xyzname)

source code 

Write atomic positions to a XYZ file.

Parameters:
  • phys (Physical) - The physical system.
  • xyzname (string) - XYZ file name.

writeXYZVel(self, phys, xyzname)

source code 

Write atomic velocities to a XYZ file.

Parameters:
  • phys (Physical) - The physical system.
  • xyzname (string) - XYZ file name.

runOutput(self, phys, forces, step, ts, *args)

source code 

Run all registered outputs For propagator objects this is called automatically, but for propagator functions it needs to be called from within.

Parameters:
  • phys (Physical) - Physical system
  • forces (Forces) - MDL forces object
  • step (int) - Step number
  • ts (float) - Timestep

newGraph(self, xlab, ylab)

source code 

Create and return a new Gnuplot or Matplotlib graph object (thus return type is flexible depending on which is used).

Parameters:
  • xlab (string) - Label for x-axis
  • ylab (string) - Label for y-axis

plotVector(self, prop, graph, vec, rangex=[], rangey=[])

source code 

Plot a vector of (x,y) data of the form [[x1,y1],[x2,y2],...]

Parameters:
  • prop (Propagator) - MDL Propagator object
  • graph (Gnuplot or Matplotlib graph object) - Gnuplot or Matplotlib graph
  • vec (list) - (x, y) data
  • rangex (pair) - Plotting range for x-axis (default is to dynamically adjust to the data)
  • rangey (pair) - Plotting range for y-axis (default is to dynamically adjust to the data)

plotQuantity(self, step, quantity, name)

source code 

Plot the passed step and quantity using a specific graph name.

Parameters:
  • step (int) - Simulation step number
  • quantity (float) - Observable value
  • name (string) - Observable name

plotPotential(self, phys, forces, step)

source code 

Instantaneously plot the potential energy of the system. Note: this function is invoked automatically if a plot for the potential energy was registered in the plots dictionary. Thus, the user more often than not will not call this explicitly, since this assumes a plot for potential energy has been created already.

Parameters:
  • phys (Physical) - The physical system
  • forces (Forces) - MDL Forces object
  • step (int) - Simulation step number

plotKinetic(self, phys, forces, step)

source code 

Similar, for kinetic energy

Parameters:
  • phys (Physical) - The physical system
  • forces (Forces) - MDL Forces object
  • step (int) - Simulation step number

plotTotal(self, phys, forces, step)

source code 

Similar, for total energy

Parameters:
  • phys (Physical) - The physical system
  • forces (Forces) - MDL Forces object
  • step (int) - Simulation step number

plotTemperature(self, phys, forces, step)

source code 

Similar, for temperature

Parameters:
  • phys (Physical) - The physical system
  • forces (Forces) - MDL Forces object
  • step (int) - Simulation step number

plotPressure(self, phys, forces, step)

source code 

Similar, for pressure

Parameters:
  • phys (Physical) - The physical system
  • forces (Forces) - MDL Forces object
  • step (int) - Simulation step number

plotVolume(self, phys, forces, step)

source code 

Similar, for system volume

Parameters:
  • phys (Physical) - The physical system
  • forces (Forces) - MDL Forces object
  • step (int) - Simulation step number

plotCoulombEnergy(self, phys, forces, step)

source code 

Similar, for electrostatic energy

Parameters:
  • phys (Physical) - The physical system
  • forces (Forces) - MDL Forces object
  • step (int) - Simulation step number

plotLJEnergy(self, phys, forces, step)

source code 

Similar, for van der Waals energy

Parameters:
  • phys (Physical) - The physical system
  • forces (Forces) - MDL Forces object
  • step (int) - Simulation step number

plotBondEnergy(self, phys, forces, step)

source code 

Similar, for energy between two-atom bonds

Parameters:
  • phys (Physical) - The physical system
  • forces (Forces) - MDL Forces object
  • step (int) - Simulation step number

plotAngleEnergy(self, phys, forces, step)

source code 

Similar, for energy between three-atom angles

Parameters:
  • phys (Physical) - The physical system
  • forces (Forces) - MDL Forces object
  • step (int) - Simulation step number

plotDihedralEnergy(self, phys, forces, step)

source code 

Similar, for energy between four-atom dihedrals

Parameters:
  • phys (Physical) - The physical system
  • forces (Forces) - MDL Forces object
  • step (int) - Simulation step number

plotImproperEnergy(self, phys, forces, step)

source code 

Similar, for energy between four-atom impropers

Parameters:
  • phys (Physical) - The physical system
  • forces (Forces) - MDL Forces object
  • step (int) - Simulation step number

plotShadowEnergy(self, phys, forces, step)

source code 

Similar, for shadow energy

Parameters:
  • phys (Physical) - The physical system
  • forces (Forces) - MDL Forces object
  • step (int) - Simulation step number

runPlots(self, phys, forces, step, ts)

source code 

Run all plots registered in the plots dictionary.

Parameters:
  • phys (Physical) - The physical system
  • forces (Forces) - MDL Forces object
  • step (int) - Simulation step number
  • ts (float) - Simulation timestep

recache(self, phys)

source code 

Restore the output cache.

Parameters:
  • phys (Physical) - The physical system

run(self, phys, forces, step, ts, *args)

source code 

Run all plots registered in the plots dictionary.

Parameters:
  • phys (Physical) - The physical system
  • forces (Forces) - MDL Forces object
  • step (int) - Simulation step number
  • ts (float) - Simulation timestep
  • args (tuple) - Extra parameters (if necessary)