Lattice Microbes 2.5
This is for whole cell modeling
Loading...
Searching...
No Matches
jLM.Analysis.TrajAnalysisMixin Class Reference

Public Member Functions

 getNumberTrajectory (self, regex=None, species=None, replicate=None, frameStart=None, frameEnd=None, timeStart=None, timeEnd=None)
 getNumberTrajectoryFromRegion (self, spRegex=None, species=None, regRegex=None, region=None, replicate=None, frameStart=None, frameEnd=None, frameDownScale=None, timeStart=None, timeEnd=None, timeDownScale=None)
 getLatticeTrajectory (self, regex=None, species=None, integrated="", replicate=None, frameStart=None, frameEnd=None, timeStart=None, timeEnd=None)
 getLatticeHistogram (self, regex=None, species=None, integrated="xyz", replicate=None, frameStart=None, frameEnd=None, timeStart=None, timeEnd=None)

Public Attributes

 replicates

Protected Member Functions

 _speciesIdParse (self, regex, species, startIndex=0)
 _regionIdParse (self, regex, region)
 _replicateParse (self, replicate)
 _postprocess_siteparticlecounts (self, rep, reg_num=16384, spe_num=16384, max_regions=16384, max_species=16384)
 _cachedResult (self, key, val=None)

Static Protected Member Functions

 _frameParse (ts, frameStart, frameEnd, timeStart, timeEnd)

Protected Attributes

 _postprocCache = dict()

Member Function Documentation

◆ _cachedResult()

jLM.Analysis.TrajAnalysisMixin._cachedResult ( self,
key,
val = None )
protected
Here is the caller graph for this function:

◆ _frameParse()

jLM.Analysis.TrajAnalysisMixin._frameParse ( ts,
frameStart,
frameEnd,
timeStart,
timeEnd )
staticprotected
Here is the caller graph for this function:

◆ _postprocess_siteparticlecounts()

jLM.Analysis.TrajAnalysisMixin._postprocess_siteparticlecounts ( self,
rep,
reg_num = 16384,
spe_num = 16384,
max_regions = 16384,
max_species = 16384 )
protected
This function is used to generate the site-particle counts for a given replicate.
It is used to cache the results of the site-particle counts so that they can be used
to generate the site-particle counts for a given replicate.
return: 
    sCount: The site counts
    pCounts: The particle counts
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _regionIdParse()

jLM.Analysis.TrajAnalysisMixin._regionIdParse ( self,
regex,
region )
protected
Here is the caller graph for this function:

◆ _replicateParse()

jLM.Analysis.TrajAnalysisMixin._replicateParse ( self,
replicate )
protected
Here is the caller graph for this function:

◆ _speciesIdParse()

jLM.Analysis.TrajAnalysisMixin._speciesIdParse ( self,
regex,
species,
startIndex = 0 )
protected
Parse and convert species identifiers to a list of integer indices.

    This function handles different ways of specifying species:
    1. Using a regex pattern to match species names
    2. A single Species object
    3. A single species name as a string
    4. A list of Species objects
    5. A list of species names as strings
    6. A list of integer indices

    The function returns a list of integer indices representing the species,
    adjusted by the startIndex.

    Args:
        regex (str): A regular expression to match species names
        species (Species, str, list): Species specification
        startIndex (int): An offset to add to the returned indices

    Returns:
        list: A list of integer indices representing the specified species

    Raises:
        RuntimeError: If both or neither regex and species are provided,
                    or if the species specification is unrecognized
Here is the caller graph for this function:

◆ getLatticeHistogram()

jLM.Analysis.TrajAnalysisMixin.getLatticeHistogram ( self,
regex = None,
species = None,
integrated = "xyz",
replicate = None,
frameStart = None,
frameEnd = None,
timeStart = None,
timeEnd = None )
Calculate the spatial distribution of particles over an interval

Species can be selected individually with the species key. If 
a list of species are given instead the sum of the particle 
numbers for those species types will be returned. A regular 
expression can also be used to select the species to return. 
Species types or species names in the form of a string are 
both acceptible to use in the `species` key. The `regex` and 
`species` options are mutually exclusive.  The interval of
time in which the histogram is computed can be selected either
through the frame numbers (`frameStart`, `frameEnd`) or 
through the simulation time (`timeStart`, `timeEnd`). If the 
full 3-D lattice is not needed, any of the directions can be 
integrated out.  

Args:
    regex (str):
        Regular expression matching species names. Multiple 
        matches will be summed.
    species ([:py:class:`~jLM.Types.Species`]):
        Species
    integrated (str):
        Combination of 'x', 'y', 'z' specifying the directions
        to integrate out
    replicate (int):
        Replicate to return, default is current replicate.
    frameStart (int):
        Starting frame
    frameEnd (int):
        Ending frame
    timeStart (int):
        Starting time
    timeEnd (int):
        Ending Time

Returns:
    :py:class:`~numpy.ndarray(dtype=float)`:
        The average particle counts
  
Note:
    Since this calculation requires reading the entire particle 
    lattice trajectory, it can be slow.
Here is the call graph for this function:

◆ getLatticeTrajectory()

jLM.Analysis.TrajAnalysisMixin.getLatticeTrajectory ( self,
regex = None,
species = None,
integrated = "",
replicate = None,
frameStart = None,
frameEnd = None,
timeStart = None,
timeEnd = None )
Calculate the spatial distribution of particles versus time

Species can be selected individually with the species key. If 
a list of species are given instead the sum of the particle 
numbers for those species types will be returned. A regular 
expression can also be used to select the species to return.
Species types or species names in the form of a string are 
both acceptible to use in the `species` key. The `regex` and 
`species` options are mutually exclusive.  Instead of 
returning the entire trajectory, a segment can be selected 
either through the frame numbers (`frameStart`, `frameEnd`) or
through the simulation time (`timeStart`, `timeEnd`). If the 
full 3-D lattice is not needed, any of the directions can be 
integrated out.

Args:
    regex (str):
        Regular expression matching species names. Multiple
        matches will be summed.
    species ([:py:class:`~jLM.Types.Species`]):
        Species
    integrated (str):
        Combination of 'x', 'y', 'z' specifying the directions 
        to integrate out
    replicate (int):
        Replicate to return, default is current replicate.
    frameStart (int):
        Starting frame
    frameEnd (int):
        Ending frame
    timeStart (int):
        Starting time
    timeEnd (int):
        Ending Time

Returns:
    (:py:class:`~numpy.ndarray(shape=(nt,), dtype=float)`, :py:class:`~numpy.ndarray(dtype=float)`):
        The evaluation times and particle counts
  
Note:
    Since this calculation requires reading the entire particle
    lattice trajectory, it can be slow.
Here is the call graph for this function:

◆ getNumberTrajectory()

jLM.Analysis.TrajAnalysisMixin.getNumberTrajectory ( self,
regex = None,
species = None,
replicate = None,
frameStart = None,
frameEnd = None,
timeStart = None,
timeEnd = None )
Calculate particle number trajectories

The time course of the particle numbers in the simulation can 
be queried with this function.  Species can be selected 
individually with the `species` key. If a list of species are 
given instead the sum of the particle numbers for those species 
types will be returned. A regular expression can also be used 
to select the species to return. Species types or species names 
in the form of a string are both acceptible to use in the 
`species` key. The `regex` and `species` options are mutually 
exclusive.  Instead of returning the entire trajectory, a
segment can be selected either through the frame numbers 
(`frameStart`, `frameEnd`) or through the simulation time 
(`timeStart`, `timeEnd`).

Args:
    regex (str):
        Regular expression matching species names. Multiple 
        matches will be summed.
    species ([:py:class:`~jLM.Types.Species`]):
        Species
    replicate (int):
        Replicate to return, default is current replicate.
    frameStart (int):
        Starting frame
    frameEnd (int):
        Ending frame
    timeStart (int):
        Starting time
    timeEnd (int):
        Ending Time

Returns:
    (:py:class:`~numpy.ndarray(shape=(nt,), dtype=float)`, :py:class:`~numpy.ndarray(shape=(nt,), dtype=float)`):
        The evaluation times and particle counts
Here is the call graph for this function:

◆ getNumberTrajectoryFromRegion()

jLM.Analysis.TrajAnalysisMixin.getNumberTrajectoryFromRegion ( self,
spRegex = None,
species = None,
regRegex = None,
region = None,
replicate = None,
frameStart = None,
frameEnd = None,
frameDownScale = None,
timeStart = None,
timeEnd = None,
timeDownScale = None )
Calculate particle number trajectories for specific regions

The time course of the particle numbers in the simulation 
within specific regions can be queried with this function.  
Species can be selected individually with the species key. If 
a list of species are given instead the sum of the particle 
numbers for those species types will be returned. A regular 
expression can also be used to select the species to return. 
Species types or species names in the form of a string are 
both acceptible to use in the `species` key. The `spRegex` and
`species` options are mutually exclusive.  Instead of 
returning the entire trajectory, a segment can be selected 
either through the frame numbers (`frameStart`, `frameEnd`) or 
through the simulation time (`timeStart`, `timeEnd`).If both given, the frame numbers will be used. 
The regions to compute particle numbers over are selected similar 
to the species through the options `regRegex` and `region`.

Args:
    spRegex (str):
        Regular expression matching species names. Multiple 
        matches will be summed.
    species ([:py:class:`~jLM.Types.Species`]):
        Species
    regRegex (str):
        Regular expression matching region names. Multiple 
        matches will be summed.
    region ([:py:class:`~jLM.Types.Region`]):
        Region
    replicate (int):
        Replicate to return, default is current replicate.
    frameStart (int):
        Starting frame
    frameEnd (int):
        Ending frame
    timeStart (int):
        Starting time
    timeEnd (int):
        Ending Time

Returns:
    (:py:class:`~numpy.ndarray(shape=(nt,), dtype=float)`, :py:class:`~numpy.ndarray(shape=(nt,), dtype=float)`):
        The evaluation times and particle counts
  
Note:
    Since this calculation requires reading the entire 
    particle lattice trajectory, it can be slow.
Here is the call graph for this function:

Member Data Documentation

◆ _postprocCache

jLM.Analysis.TrajAnalysisMixin._postprocCache = dict()
protected

◆ replicates

jLM.Analysis.TrajAnalysisMixin.replicates

The documentation for this class was generated from the following file:
  • /data2/LM_zls_github/Lattice-Microbes/src/jlm/jLM/Analysis.py