fluopy.prediction

Compute a prediction for a photophysical system.

Classes

Prediction

Container of mathematically derived statistical attributes and methods.

Module Contents

class fluopy.prediction.Prediction(transition_set: fluopy.transitions.TransitionSet, accuracy: float = 1000000000.0)[source]

Container of mathematically derived statistical attributes and methods.

Variables:
  • energy_transfer (bool) – Whether the prediction was carried out on energy transfer systems.

  • absorbing_chain (bool) – Whether the prediction was carried out on an absorbing Markov chain. Absorbing states have a lifetime of inf and a frequency / occupation of 0. Absorbing transitions have a frequency of 0.

  • transition_set (fluopy.transitions.TransitionSet) – Collection of all relevant transitions and related attributes.

  • frequency_transitions (npt.NDArray[np.float64]) – Expected relative frequencies of each transition.

  • frequency_states (dict[str, float]) – Name of fluorophores as keys and their state’s expected relative frequencies (array) as values.

  • transition_time_distributions (npt.NDArray[object] | None) – Expected distributions of time until transition. Contains objects of type scipy.stats.*.rv_frozen for each transition. None if energy transfer is True.

  • lifetime_distributions (dict[str, npt.NDArray[object]] | None) – Name of fluorophores as keys and their state’s expected lifetime distributions (objects of type scipy.stats.*.rv_frozen) (array) as values. None if energy transfer is True.

  • mean_transition_times (npt.NDArray[np.float64] | None) – Expected means of time until transition. None if energy transfer is True.

  • mean_lifetimes (dict[str, npt.NDArray[np.float64]] | None) – Name of fluorophores as keys and their state’s expected lifetime means (array) as values. None if energy transfer is True.

  • state_occupations (dict[str, npt.NDArray[np.float64]] | None) – Name of fluorophores as keys and their state’s expected probability of being occupied at any given point in time (array) as values. None if energy transfer is True.

energy_transfer = False
absorbing_chain = False
transition_set
frequency_states
predict_transition_occurrences(accuracy: int) numpy.typing.NDArray[numpy.float64][source]

Predict the relative frequencies of transitions. Each different type of fluorophore’s transitions frequencies sum up to 1.

Parameters:

accuracy – Determines the exponent of matrix power. The higher, the more accurate up to the point floating point precision impairs the result.

Returns:

Expected relative frequencies of each transition.

Return type:

npt.NDArray[np.float64]

predict_transition_occurrences_abs() numpy.typing.NDArray[numpy.float64][source]

Predict the relative frequencies of transitions. Absorbing transitions will have the value 0.

Returns:

Expected relative frequencies of each transition.

Return type:

npt.NDArray[np.float64]

predict_state_occurrences() dict[str, numpy.typing.NDArray[numpy.float64]][source]

Predict the relative frequencies of states. Each different type of fluorophore’s states frequencies sum up to 1.

Returns:

frequency_states – Name of fluorophores as keys and their state’s expected relative frequencies (array) as values.

Return type:

dict[str, npt.NDArray[np.float64]]

predict_lifetimes() tuple[numpy.typing.NDArray[numpy.float64], dict[str, numpy.typing.NDArray[numpy.float64]]][source]

Predict the lifetime distributions of states and the time until occurrence distributions of transitions.

Returns:

  • transition_time_distributions (npt.NDArray[np.float64]) – Expected distributions of time until transition. Contains objects of type scipy.stats.*.rv_frozen for each transition.

  • lifetime_distributions (dict[str, npt.NDArray[np.float64]]) – Name of fluorophores as keys and their state’s expected lifetime distributions (objects of type scipy.stats.*.rv_frozen) (array) as values.

infer_stats() tuple[dict[str, numpy.typing.NDArray[numpy.float64]], dict[str, numpy.typing.NDArray[numpy.float64]]][source]

Infers statistics of states based on lifetime distributions and frequencies.

Returns:

  • mean_lifetimes (dict[str, npt.NDArray[np.float64]]) – Name of fluorophores as keys and their state’s expected lifetime means (array) as values.

  • state_occupations (dict[str, npt.NDArray[np.float64]]) – Name of fluorophores as keys and their state’s expected probability of being occupied at any given point in time (array) as values.

plot_frequency_transitions(**kwargs: Any) numpy.typing.NDArray[matplotlib.axes.Axes][source]

Plot frequencies of transitions.

Parameters:

kwargs – kwargs for fluopy.figure.universal_figure

Returns:

Contains matplotlib.axes._subplots.AxesSubplots.

Return type:

npt.NDArray[mplAxes]

plot_frequency_states(**kwargs: Any) numpy.typing.NDArray[matplotlib.axes.Axes][source]

Plot frequencies of states.

Parameters:

kwargs – kwargs for fluopy.figure.universal_figure

Returns:

Contains matplotlib.axes._subplots.AxesSubplots.

Return type:

npt.NDArray[mplAxes]

plot_mean_transition_times(**kwargs: Any) numpy.typing.NDArray[matplotlib.axes.Axes][source]

Plot mean times until transitions occur.

Parameters:

kwargs – kwargs for fluopy.figure.universal_figure

Returns:

Contains matplotlib.axes._subplots.AxesSubplots.

Return type:

npt.NDArray[mplAxes]

plot_mean_lifetimes(**kwargs: Any) numpy.typing.NDArray[matplotlib.axes.Axes][source]

Plot mean lifetimes of states.

Parameters:

kwargs – kwargs for fluopy.figure.universal_figure

Returns:

Contains matplotlib.axes._subplots.AxesSubplots.

Return type:

npt.NDArray[mplAxes]

plot_state_occupations(**kwargs: Any) numpy.typing.NDArray[matplotlib.axes.Axes][source]

Plot state occupation times (relative total time spent in state).

Parameters:

kwargs – kwargs for fluopy.figure.universal_figure

Returns:

Contains matplotlib.axes._subplots.AxesSubplots.

Return type:

npt.NDArray[mplAxes]

plot_lifetime_distributions(fluorophore: str, state_identity: int, x: numpy.typing.ArrayLike | None = None, **kwargs: Any) numpy.typing.NDArray[matplotlib.axes.Axes][source]

Plot lifetime distributions of states.

Parameters:
  • fluorophore – The name of the fluorophore whose state’s distribution is to be shown.

  • state_identity – The identity of the state whose distribution is to be shown.

  • x – The x values for which the distribution is to be shown.

  • kwargs – kwargs for fluopy.figure.universal_figure

Returns:

Contains matplotlib.axes._subplots.AxesSubplots.

Return type:

npt.NDArray[mplAxes]

plot_transition_time_distributions(fluorophore: str, transition_id: int, x: numpy.typing.ArrayLike | None = None, **kwargs: Any) numpy.typing.NDArray[matplotlib.axes.Axes][source]

Plot distributions of time until transition occurs.

Parameters:
  • fluorophore – The name of the fluorophore whose transition’s distribution is to be shown.

  • transition_id – The identity of the transition whose distribution is to be shown.

  • x – The x values for which the distribution is to be shown.

  • kwargs – kwargs for fluopy.figure.universal_figure

Returns:

Contains matplotlib.axes._subplots.AxesSubplots.

Return type:

npt.NDArray[mplAxes]