Stochastic simulation (SSA) of microtubules in neurites, implemented using jit from numba (numba.cuda.jit) for fast parallel processing on a GPU. Programmed in a generalized fashion, to be used for stochastically simulating any model with different species, with optional properties for each species member, in an arbitrary spatial domain.
The example under \scripts contains a simple simulation of MTs in the neurite running on a GPU.
In order to run scripts, an NVIDIA GPU must be available at the machine.
Note: Execution on CPUs currently not supported. Will be added in the future.
The package was developed and tested in Windows.
Installation via Mamba (using the conda-forge channel) is recommended.
- If you don't already have Mamba installed: Download and install Mamba from https://github.com/conda-forge/miniforge.
- If you don't already have git installed: Download and install git from https://git-scm.com/downloads
- Open an Anaconda terminal, navigate to the folder where you want to put cytotorch and clone the cytostoch repository:
- Navigate into the folder of the repository (cytostoch):
cd cytostoch
- Create environment for cytostoch with Anaconda:
mamba env create -f environment.yml
- Activate environment in anaconda:
conda activate cytostoch
- Install cytostoch locally using pip:
pip install -e .
- Optional: If needed, install spyder to create, edit and run scripts:
mamba install spyder
- Optional: start spyder
spyder
- You can now import cytotorch to build and simulate your model:
import cytostoch
The installation should take several minutes, if mamba and git have already been installed.
A script to run simulations corresponding to Fig. 4a is included in the \script folder ("Figure4a_simulation.py").
In line 407 you should enter an absolute path for where you want the simulation data to be saved.
Cytostoch will create the folder "Fig4a_simulation" at your defined path and will save all the output files in there.
Cytostoch also saves different meta data including a pickled simulation object.
The data extractions defined in the script will extract the following data from the endpoint of the simulation - all saved as "data.feather" in the respective folders:
- Global statistics (e.g. number of MTs) in folder "global"
- Density across simulated neurite from all states summed in the folder "local_density_all"
- Density of stable MTs across simulated neurite from all states summed in the folder "local_stable_density"
- Density of unstable MTs across simulated neurite from all states summed in the folder "local_unstable_density"
The data is saved for the 2000 simulations run in the script.
Using an NVIDIA RTX4090 GPU the run time should be around 9 min.
This data can then be further processed in Python using pandas.