Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.
/ vermillion Public archive

Fastest stochastic simulator in the West.

License

Notifications You must be signed in to change notification settings

syedtaz/vermillion

Repository files navigation

vermillion logo
Vermillion

mrna-plot repressilator-plot
Average of the stochastic behavior of the MRNA degradation and the Repressilator system.

Quickstart

vermillion 0.1.0
Tazmilur Saad
Fastest stochastic simulator in the west.

USAGE:
    vermillion [OPTIONS] --time <TIME> [ALGORITHMS]...

ARGS:
    <ALGORITHMS>...    List of algorithms to run [possible values: direct, direct-jump]

OPTIONS:
    -g, --granularity <GRANULARITY>    Set the timestep in seconds
    -h, --help                         Print help information
    -r, --repeats <REPEATS>            Set number of repeats [default: 1]
    -t, --time <TIME>                  Set the end time for the simulations
    -V, --version                      Print version information
    -w, --write                        Write to disk

Installation

  • Download and install Rust from here.
  • Install git if you don't have it.
  • Clone the repository by running git clone https://github.com/syedtaz/vermillion.git
  • cd into the repository
  • Run cargo build

The first time you run build it will take some time since the package manager will download and build packages for numpy-style arrays, data wrangling, random numbers, etc. However, subsequent builds should not take long.

Examples

MRNA Degradation

The package comes with two systems preloaded. For example, if you want to simulate a simple MRNA degradation model with a degradation rate of 1.0.

  • Edit the main.rs file and uncomment the mrna degradation block.
  • Open a terminal and cd to the main directory.
  • Run cargo build to compile.
  • cd to /target/debug/
  • If you want to run a single simulation for 10.0 seconds and save every timestep
    • Run ./vermillion -t 10. -w direct
  • Or if you want an average of 5 different repeats of the simulations for 10. seconds with a granularity of 0.5 seconds:
    • Run ./vermillion -a -g 0.5 -r 5 -t 10. -w direct-jump
  • The results should be saved in a /data/ folder.
  • Go back to the main directory and run python3 plotter.py. You will need to have pandas and matplotlib installed.
  • A plot.png file will be created in your data directory.

Repressilator

If you want to simulate the repressilator system:

  • Edit the main.rs file and uncomment the repressilator block.
  • Open a terminal and cd to the main directory.
  • Run cargo build to compile.
  • cd to /target/debug/
  • If you want to run a single simulation for 1000.0 seconds and save every timestep
    • Run ./vermillion -t 10. -w direct
    • Note that the resulting log file can be very large, so this method is not recommended.
  • If you want an average of 5 different repeats of the simulations for 1000. seconds with a granularity of 60 seconds:
    • Run ./vermillion -a -g 60. -r 5 -t 1000. -w direct-jump
  • The results should be saved in a /data/ folder.
  • Go back to the main directory and run python3 plotter.py. You will need to have pandas and matplotlib installed.
  • A plot.png file will be created in your data directory.

Usage

Vermillion can simulate a system in two ways: it can run a complete simulation of every time jump, or you can specify a granularity g and it will only save the results at every g timestep. In the main.rs file, you will have to specify a system and its initial conditions and then from the command line pass in arguments that will define how long you want to simulate, the granularity, whether to save the results or not and so on.

In order to write your own system called mysystem:

  • Go to the examples directory.
  • Create a mysystem.rs file.
  • Edit the examples.rs file by adding pub mod mysystem;
  • In your mysystem.rs file, import the System trait by adding to the top use crate::system::System;
  • Add a struct pub struct MySystem {}
  • Implement the functionality described the System trait.
    • Essentially your system must have four specific functions:
      • A propensity function that takes in the current state and mutates it with the new propensities.
      • An update function that takes in a reaction that fired and the state, and applies the changes.
      • A name function that returns the name of the system to be used when logging the results.
      • A size function that returns the number of reactions in the system.
  • Compile by running cargo build and edit the main.rs file to call your system.

Releases

No releases published

Packages