pyLM  v1.1
A Python Problem Solving Environment for the simulation of stochastic biological systems
 All Classes Namespaces Files Functions Variables Pages
Functions
pySTDLM.PostProcessing Namespace Reference

Functions

def openLMFile
 Open a Lattice Microbes File for reading. More...
 
def closeLMFile
 Close a Lattice Microbes File. More...
 
def showTraceFromFile
 Show species trace from a particular replicate. More...
 
def plotTraceFromFile
 Plot species from an output file. More...
 
def showTrace
 Show a specific species trace. More...
 
def plotTrace
 Plot a specific species trace. More...
 
def showAvgVarFromFile
 Show species from an output file. More...
 
def plotAvgVarFromFile
 Plot species from an output file. More...
 
def showAvgVar
 Show a specific species average over time and variance. More...
 
def plotAvgVar
 Plot a specific species average over time and variance. More...
 
def getOccupancyKymograph
 Compute the specie density(occupancy) among a slice of the simulation domain as a function over time for the given direciton. More...
 
def plotOccupancyKymograph
 Plot a specific specie density(occupancy) among a slice of the simulation domain as a function of a direction over time. More...
 
def showOccupancyKymograph
 Show a specific specie density(occupancy) among a slice of the simulation domain as a function of a direction over time. More...
 
def plotPhaseSpace
 Plot the 2D or 3D phase space associated with the given species over the replicates indicated. More...
 
def getTimesteps
 Extract the timestep times. More...
 
def getSpecieTrace
 Extract data for a particular specie for the specified replicate. More...
 
def getAvgVarTrace
 Get the average and variance of the specie trace over time. More...
 
def getHistogram
 Get the histogram for a specie. More...
 
def getPhaseSpace
 Get the nD phase space associated with the traces of species. More...
 

Function Documentation

def pySTDLM.PostProcessing.closeLMFile (   f)

Close a Lattice Microbes File.

Parameters
fA previously opened lattice microbes file
def pySTDLM.PostProcessing.getAvgVarTrace (   f,
  specie,
  doublingTime = None 
)

Get the average and variance of the specie trace over time.

Parameters
fThe HDF5 file handle to extract from or the name of a file to open
specieThe specie to extract
doublingTimeAn optional doubling time parameter that will normalize average each trace by time in the cell cycle assuming exponentially growing cell (2log2 * x/2^(t/DT)), effectively normalizing against cell size. Default: no averaging is performed
Returns
avg, var, time
def pySTDLM.PostProcessing.getHistogram (   f,
  species 
)

Get the histogram for a specie.

Parameters
fThe HDF5 file handle to extract from or the name of a file to open
specieAn array of specie/s to extract. returns a nD histogram of the data.
Returns
bins, edges (len(bins)+1)
def pySTDLM.PostProcessing.getOccupancyKymograph (   f,
  species = None,
  replicate = 1 
)

Compute the specie density(occupancy) among a slice of the simulation domain as a function over time for the given direciton.

Parameters
filenameName of file to extract data from
specieA particular specie to plot density for
replicateThe replicate to show trace for
def pySTDLM.PostProcessing.getPhaseSpace (   f,
  species,
  replicate 
)

Get the nD phase space associated with the traces of species.

If a single replicate is specified, a single trace will be returned, otherwise a 2/3D density matrix will be returned.

Parameters
fThe HDF5 file handle to extract from or the name of a file to open
specieAn iterable of 2 more specie names
replicateThe replicate for which to extract the phase space
Returns
A numpy array of a trace from a single replicate (specie1, specie2, ...)
def pySTDLM.PostProcessing.getSpecieTrace (   f,
  specie,
  replicate = 1,
  doublingTime = None 
)

Extract data for a particular specie for the specified replicate.

Parameters
fThe HDF5 file handle to extract from or the name of a file to open
specieThe specie to extract data
replicateThe number of the replicate to extract from (default: 1)
doublingTimeAn optional doubling time parameter that will normalize average each trace by time in the cell cycle assuming exponentially growing cell (2log2 * x/2^(t/DT)), effectively normalizing against cell size. Default: no averaging is performed
Returns
The species time trace in a numpy array
def pySTDLM.PostProcessing.getTimesteps (   f)

Extract the timestep times.

Parameters
fThe HDF5 file handle to extract from or the name of a file to open
Returns
The timestep times in a numpy array
def pySTDLM.PostProcessing.openLMFile (   filename)

Open a Lattice Microbes File for reading.

Parameters
filenameName of the file
Returns
a handle to the file
def pySTDLM.PostProcessing.plotAvgVar (   f,
  species = None,
  filename = None,
  kwargs 
)

Plot a specific species average over time and variance.

Parameters
fAn h5py object handle
speciesA list of species to show
filenameA filename to print to (default None, gives the same behavior as showAvgVar(...))
kwargsAdditional arguments to be passed on to matplotlib.plot. These are any arguments that are valid with matplotlib.plot
Returns
A handle to the figure object created which allows customization of plot attributes
def pySTDLM.PostProcessing.plotAvgVarFromFile (   filename,
  species,
  outfile,
  kwargs 
)

Plot species from an output file.

Parameters
filenameThe name of an HDF5 output file generated by LatticeMicrobes
speciesA list of species to plot
kwargsAdditional arguments to be passed on to matplotlib.plot. These are any arguments that are valid with matplotlib.plot
outfileA filename to plot to
def pySTDLM.PostProcessing.plotOccupancyKymograph (   f,
  species = None,
  replicate = 1,
  filename = None 
)

Plot a specific specie density(occupancy) among a slice of the simulation domain as a function of a direction over time.

Parameters
fThe name of the LM file
specieA particular specie to plot density for
filenameA filename to print to (default None, gives the same behavior as showAvgVar(...))
replicateThe replicate to show trace for
def pySTDLM.PostProcessing.plotPhaseSpace (   f,
  species = None,
  replicate = 1,
  withHistogram = False 
)

Plot the 2D or 3D phase space associated with the given species over the replicates indicated.

Parameters
fAn h5py object handle
specieAn iterable of 2 or 3 specie names indicating whether to plot in 2D or 3D space
replicateThe replicate to show trace for
withHistogramIf set to true, a heatmap of the phase space over all replicates will be plotted in the background. (NOTE: this only works in 2D.)
def pySTDLM.PostProcessing.plotTrace (   f,
  species = None,
  replicate = 1,
  filename = None,
  kwargs 
)

Plot a specific species trace.

Parameters
fAn h5py object handle
speciesA specie name or a list of species to show; can be a single string or a iterable list of species
filenameA filename to print to (default None, gives the same behavior as showAvgVar(...))
replicateThe replicate to show trace for. Can be an integer or an iterable list of replicte numbers
kwargsAdditional arguments to be passed on to matplotlib.plot. These are any arguments that are valid with matplotlib.plot
Returns
A handle to the figure object created which allows customization of plot attributes
def pySTDLM.PostProcessing.plotTraceFromFile (   filename,
  species,
  replicate,
  outfile,
  kwargs 
)

Plot species from an output file.

Parameters
filenameThe patch to an HDF5 output file generated by LatticeMicrobes
speciesA list of species to plot
replicateThe replicate to show trace for
kwargsAdditional arguments to be passed on to matplotlib.plot. These are any arguments that are valid with matplotlib.plot
outfileA filename to plot to
def pySTDLM.PostProcessing.showAvgVar (   f,
  species,
  kwargs 
)

Show a specific species average over time and variance.

Parameters
fAn h5py object handle
speciesA list of species to show
kwargsAdditional arguments to be passed on to matplotlib.plot. These are any arguments that are valid with matplotlib.plot
def pySTDLM.PostProcessing.showAvgVarFromFile (   filename,
  species,
  kwargs 
)

Show species from an output file.

Parameters
filenameThe name of an HDF5 output file generated by LatticeMicrobes
speciesA list of species to plot
kwargsAdditional arguments to be passed on to matplotlib.plot. These are any arguments that are valid with matplotlib.plot
def pySTDLM.PostProcessing.showOccupancyKymograph (   f,
  species = None,
  replicate = 1 
)

Show a specific specie density(occupancy) among a slice of the simulation domain as a function of a direction over time.

Parameters
fAn h5py object handle
specieA particular specie to plot density for
replicateThe replicate to show trace for
def pySTDLM.PostProcessing.showTrace (   f,
  species,
  replicate,
  kwargs 
)

Show a specific species trace.

Parameters
fAn h5py object handle
speciesA list of species to show
replicateThe replicate to show trace for
kwargsAdditional arguments to be passed on to matplotlib.plot. These are any arguments that are valid with matplotlib.plot
def pySTDLM.PostProcessing.showTraceFromFile (   filename,
  species,
  replicate,
  kwargs 
)

Show species trace from a particular replicate.

Parameters
filenameThe patch to an HDF5 output file generated by LatticeMicrobes
speciesA list of species to plot
replicateThe replicate to show trace for
kwargsAdditional arguments to be passed on to matplotlib.plot. These are any arguments that are valid with matplotlib.plot