Simularium Conversion helps convert ssimulation outputs to the format consumed by the Simularium viewer.
Project description
SimulariumIO
Simulariumio converts simulation outputs to the format consumed by the Simularium viewer.
Features
- Converts 3D spatiotemporal trajectories to .simularium JSON format
- Accepts spatial trajectories from the following biological simulation engines:
- CytoSim (https://gitlab.com/f.nedelec/cytosim)
- ReaDDy (https://readdy.github.io/)
- PhysiCell (http://physicell.org/)
- Conversions for data from custom engines can be implemented using the CustomConverter class
- Also accepts metrics data for plots to display alongside spatial data
Quick Start
Convert spatial trajectory from a supported engine
See the Tutorial for the simulation engine you're using for details:
An overview for data from ReaDDy:
from simulariumio import ReaddyConverter, ReaddyData
# see ReaDDy Tutorial for parameter details
input_data = ReaddyData(
box_size=BOX_SIZE,
timestep=TIMESTEP,
path_to_readdy_h5=PATH_TO_H5_FILE,
)
ReaddyConverter(input_data).write_JSON("output_file_name")
Convert spatial trajectory from a custom engine
See the Custom Data Tutorial for details. An overview:
from simulariumio import CustomConverter, CustomData, AgentData
# see Custom Data Tutorial for parameter details
input_data = CustomData(
box_size=BOX_SIZE,
agent_data=AgentData(
times=TIMES,
n_agents=N_AGENTS,
viz_types=VIZ_TYPES,
unique_ids=UNIQUE_IDS,
types=TYPE_IDS,
positions=POSITIONS,
radii=RADII,
)
)
CustomConverter(input_data).write_JSON("output_file_name")
Add metrics data to plot
See the Plots Tutorial for details. An overview:
from simulariumio import ScatterPlotData
# see Plots Tutorial for parameter details
example_scatter_plot = ScatterPlotData(
title=TITLE,
xaxis_title=X_TITLE,
yaxis_title=Y_TITLE,
xtrace=X_VALUES,
ytraces=Y_VALUES,
)
converter = CustomConverter(input_data) # see above to create converter
converter.add_plot(example_scatter_plot, "scatter")
converter.write_JSON("output_file_name")
Installation
Install Requires: If ReaDDy trajectories will be converted, the ReaDDy python package must be installed:
(add conda forge channel if it's not already: conda config --add channels conda-forge
)
conda install -c readdy readdy
Stable Release: pip install simulariumio
Development Head: pip install git+https://github.com/allen-cell-animated/simulariumio.git
Documentation
For full package documentation please visit allen-cell-animated.github.io/simulariumio.
Development
See CONTRIBUTING.md for information related to developing the code.
Free software: Allen Institute Software License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for simulariumio-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c62cc22904ec6b8fd1937dfdf67115269656ae7fc13d152586ec4074a3477d8e |
|
MD5 | cf401ba4f0d5a78b067a26d962d381fc |
|
BLAKE2b-256 | cc49e24ea735fed9c8857001bcb77557853bbae9cbf56cf4f8c148b08b445e4c |