A Python tool for converting Biosimulators spatial simulation outputs into a Simularium-compliant format.
Project description
Biosimulators_simularium
Converting Biosimulators spatial simulation outputs into a Simularium-compliant format. This tooling acts as a
superset of Biosimulators_utils
.
PLEASE NOTE: If you are using Apple silicon or Windows, you MUST use the Building from Source installation. Currently, smoldyn is only available on PyPI cleanly on Linux.
Installation with Python(PyPI) (Recommended)
The easiest way to interact with Biosimulators_simularium
is via the Python Package Index and a
virtual environment.
We recommend installing and using Conda:
After you have created the environment...
conda create -n biosimularium python=3.10
conda activate biosimularium
pip install biosimulators-simularium
To verify successfull platform and installation...
python3
import biosimulators_simularium as biosimularium
biosimularium.__version__
should display the most recent version with no errors.
Installation (Building from Source)
BEFORE STARTING: This application uses Smoldyn to generate simulation data. Please install Smoldyn into your local environment. Instructions below use the Mac silicon install and Python 3.10. More information on installing Smoldyn can be found here
-
Set up a virtual environment. We recommend using Conda:
conda create -n biosimularium python=3.10
-
conda activate biosimularium
-
cd {REPO DESTINATION}
-
git clone https://github.com/biosimulators/biosimulators-simularium.git
-
cd Biosimulators_simularium
-
pip install -e .
-
FOR MAC ONLY: Download Smoldyn for your Mac (Silicon or Intel): https://www.smoldyn.org/download.html
cd /path/to/your/download/of/smoldyn-2.72-mac
sudo -H ./install.sh
-
OTHERWISE:
pip install smoldyn
A Jupyter Notebook will soon be available which is based off of the simulariumio tutorial series. This will give users the ability to have a tool that quickly generates simularium files with the click of a button based on a valid COMBINE/OMEX archive.
Getting-Started Example:
import os
from biosimulators_simularium.archives.data_model import SmoldynCombineArchive
from biosimulators_simularium.old_api.converters.data_model import SmoldynDataConverter
# define the combine archive rootpath
crowding_archive_path = os.path.join('biosimulators_simularium', 'tests', 'fixtures', 'archives', 'crowding4')
# construct an archive instance based on the rootpath
archive = SmoldynCombineArchive(
rootpath=crowding_archive_path,
simularium_filename='crowding4'
)
# construct a data converter
converter = SmoldynDataConverter(archive)
# define the agents from the simulation that you are going to visualize.
# The shape of the data is expected to be as follows:
# (agent name, agent radius, agent hex color)
agents = [
('red(up)', 0.2, '#eb1414'),
('green(up)', 0.5, '#5dcf30'),
]
# pass the agents to the converter method
converter.generate_simularium_file(agents=agents, io_format='JSON', box_size=20.0)
You may then navigate to https://simularium.allencell.org/viewer and drag/drop the newly generated simularium file into the GUI window.
We welcome any and all collaborations and/or raising of issues:
To report an issue, please visit our Github issues page.
To contact us, please send an email to apatrie@uchc.edu or info@biosimulators.org
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 biosimulators-simularium-0.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ee57e0c67df15b28bca43f12be3309ec582a1882d7bc7120dbfa8d07a45f214 |
|
MD5 | 9c0b5103f7b8501326b4a72c8708f072 |
|
BLAKE2b-256 | 70704f36271558442a3f23c769406779b92de0aa0783e81d15a0a737bc9a9ad8 |
Hashes for biosimulators_simularium-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c922e5ac4f87d0d6e961bc22a673fd2ae71cbed94859fa2c5c07af405903182f |
|
MD5 | d9b8c3760d0ece9b7d7f32f3335b5f62 |
|
BLAKE2b-256 | 01fb67c3c32a8be146a9902da70362df04551907128928158f5ee226eda9399b |