Simulator of viral infection spread and containment in cell monolayer.

Overview

Overview

VIS-A-VIS is an agent-based simulator of viral infection spread and viral infection self-containment in a monolayer of cell.

The simulation mimics the innate immune response to an infection with an RNA virus. The hard-coded and externally parametrized interactions between the host cell and virus are specific to the respiratory syncytial virus (RSV) and human alveolar epithelial cells (A549 cell line). Infected cells attempt to produce and secrete an interferon, which alerts the non-infected bystander cells about the nearby threat.

VIS-A-VIS is a hybrid simulator as it executes alternating phases of interferon diffusion and chemical kinetics. The interferon diffuses between compartments above neighboring lattice nodes and its local concentrations are expressed using real variables. The nodes are occupied by cells, in which stochastic chemical kinetics (Gillespie algorithm) causes transitions within a predefined set of states for molecules of several chemical species. Some of these states are associated with higher level or higher activity of these molecules. The lattice has periodic boundary conditions.

VIS-A-VIS was used in the paper "Antagonism between viral infection and innate immunity at the single-cell level", TODO:JOURNAL (2022). See citing section below.

Compilation

The simulator has been implemented in Rust. If your Rust toolchain has been set up via rustup, then prior to compilation in the command line you may want to issue:

$ rustup update

To compile the source code, enter the visavis-1.0.0 folder and type:

$ cargo build --release

The software has been tested to successfully compile under the current stable toolchain (shipping rustc version 1.64.0). If libglib-2.0-dev and libcairo2-dev are installed, all dependencies (rust crates) should be retrieved and compiled on the fly.

Running

To run a simulation using default parameters and stimulation protocol, you may invoke the simulator with:

$ cargo run --release parameters/default.json protocols/default.protocol --images

which is equivalent to:

$ target/release/vis-a-vis parameters/default.json protocols/default.protocol --images

At simulated-time intervals prescribed in the protocol, the simulator produces CSV-formatted files with the current state of all molecules in the lattice. Generating PNG images with lattice snapshots (turned on when using the --images argument) is optional.

Output

CSV: Each generated CSV file fully describes the state of the simulated system in the time point specified in the file name. Each row of the file corresponds to a lattice node that contains a cell, whose molecular internal state is given in comma-separated entries corresponding to molecules as given in the file header. States of molecules are discrete (and are in the range MIN..MAX defined in respective arrays in src/cell.rs). Last two columns give the amount of the extracellular interferon in the cell culture medium above the cell-node (in the lower and in the upper subcompartment separately).

PNG: Lattice images depict cells as circles inscribed in hexagons. The more yellow is the hexagon fill, the higher is the amount of the extracellular interferon in the lower medium subcompartment above the cell. Pinkish outer cell ring indicates viral infection; reddish color of the inner circle corresponds to a high level of p-IRF3, whereas greenish inner circle shows STAT1/2 activity.

If in module lattice (src/lattice.rs) the boolean variable Lattice::NEIGHS_TO_FILE is set to true, then additionally a file neighbors.csv with complete information about lattice node neighborhoods is dumped.

All the output files are generated in the current working directory.

Tweaking

Changes in stimulation protocols (provided as text files, see included examples in protocols/) or in parameter values (provided as JSON-formatted text files, see examples included in parameters/) do not require the code to be recompiled.

Modifications of the wiring of the molecular virus--host and intra-host interactions require changes in module simulation (src/simulation.rs) and code recompilation.

To change lattice size, you need not only to change Lattice::WIDTH, Lattice::HEIGHT in module lattice (src/lattice.rs), but also likely tweak the THREAD_STACK_SIZE parameter in module config (src/config.rs), and then recompile the code.

Extra: Python wrapper

Since running many simulations from terminal can be cumbersome, in extra/ we provide a simple Python wrapper and associated convenience code for working with Vis-A-Vis:

  • visavis.py: the Vis-A-Vis client,
  • simulation_result.py: class wrapping the result of a simulation,
  • annotate.py: script for annotating lattice snapshots,
  • parameters/default.py: Python format for parameters.

Script extra/example.py demonstrates concisely how the convenience code may be used. The script can be run with:

$ cd extra/
$ python example.py

Citing

The simulator, written by Marek Kochanczyk and Frederic Grabowski from the Institute of Fundamental Technological Research of the Polish Academy of Sciences (IPPT PAN, Warsaw, Poland), features the research article "Antagonism between viral infection and innate immunity at the single-cell level" published in TODO:JOURNAL (2022). If you use the code for research purposes, please consider citing this work.

License

The code is open source under the 3-Clause BSD license (see file LICENSE or visit https://opensource.org/licenses/BSD-3-Clause).

You might also like...
A tray application for Windows that gives you push notifications and instant downloads of new posts, messages and stories posted by models you subscribe to on Onlyfans.

OF-notifier A tray application for Windows that gives you push notifications and instant downloads of new posts, messages and stories posted by models

A simpler and 5x faster alternative to HashMap in Rust, which doesn't use hashing and doesn't use heap

At least 5x faster alternative of HashMap, for very small maps. It is also faster than FxHashMap, hashbrown, ArrayMap, and nohash-hasher. The smaller

A comprehensive and FREE Online Rust hacking tutorial utilizing the x64, ARM64 and ARM32 architectures going step-by-step into the world of reverse engineering Rust from scratch.
A comprehensive and FREE Online Rust hacking tutorial utilizing the x64, ARM64 and ARM32 architectures going step-by-step into the world of reverse engineering Rust from scratch.

FREE Reverse Engineering Self-Study Course HERE Hacking Rust A comprehensive and FREE Online Rust hacking tutorial utilizing the x64, ARM64 and ARM32

Leetcode Solutions in Rust, Advent of Code Solutions in Rust and more

RUST GYM Rust Solutions Leetcode Solutions in Rust AdventOfCode Solutions in Rust This project demostrates how to create Data Structures and to implem

:crab: Small exercises to get you used to reading and writing Rust code!
:crab: Small exercises to get you used to reading and writing Rust code!

rustlings 🦀 ❤️ Greetings and welcome to rustlings. This project contains small exercises to get you used to reading and writing Rust code. This inclu

A catalogue of Rust design patterns, anti-patterns and idioms

Rust Design Patterns An open source book about design patterns and idioms in the Rust programming language that you can read here. Contributing You ar

Simple and performant hot-reloading for Rust

reloady Simple, performant hot-reloading for Rust. Requires Rust nightly and only works on Linux for now. installing CLI To install the CLI helper car

Rust library for hardware accelerated drawing of 2D shapes, images, and text, with an easy to use API.
Rust library for hardware accelerated drawing of 2D shapes, images, and text, with an easy to use API.

Speedy2D Hardware-accelerated drawing of shapes, images, and text, with an easy to use API. Speedy2D aims to be: The simplest Rust API for creating a

Compare the size of v8 and quickjs
Compare the size of v8 and quickjs

rust_v8_and_quickjs Size debug release quickjs 1,758,728 1,281,104 v8 40,047,648 20,956,816 Chart License rust_v8_and_quickjs is released under the MI

Owner
Frederic Grabowski
Frederic Grabowski
Simulator for the pioneering TX-2 computer

TX-2 Simulator We are trying to create a simulator for Lincoln Lab's historic TX-2 computer. Notably, this is the computer on which Ivan Sutherland's

TX-2 Simulator Project 10 Dec 6, 2022
A Cortex-M simulator written in Rust

cmsim - A Cortex-M Simulator I had a need to run a Rust program (well, an OS) which was compiled for an Arm Cortex-M0+ on my Windows/Linux/macOS deskt

Jonathan 'theJPster' Pallant 4 Sep 14, 2023
An API for getting questions from http://either.io implemented fully in Rust, using reqwest and some regex magic. Provides asynchronous and blocking clients respectively.

eithers_rust An API for getting questions from http://either.io implemented fully in Rust, using reqwest and some regex magic. Provides asynchronous a

null 2 Oct 24, 2021
Safe, efficient, and ergonomic bindings to Wolfram LibraryLink and the Wolfram Language

wolfram-library-link Bindings to the Wolfram LibraryLink interface, making it possible to call Rust code from the Wolfram Language. This library is us

Wolfram Research, Inc. 28 Dec 6, 2022
This blog provides detailed status updates and useful information about Theseus OS and its development

The Theseus OS Blog This blog provides detailed status updates and useful information about Theseus OS and its development. Attribution This blog was

Theseus OS 1 Apr 14, 2022
Omeglib, a portmanteau of "omegle" and "library", is a crate for interacting with omegle, simply and asynchronously

Omeglib, a portmanteau of "omegle" and "library", is a crate for interacting with omegle, simply and asynchronously. It is intended to suit one's every requirement regarding chat on omegle.

null 1 May 25, 2022
Fast and simple datetime, date, time and duration parsing for rust.

speedate Fast and simple datetime, date, time and duration parsing for rust. speedate is a lax† RFC 3339 date and time parser, in other words, it pars

Samuel Colvin 43 Nov 25, 2022
In this repository you can find modules with code and comments that explain rust syntax and all about Rust lang.

Learn Rust What is this? In this repository you can find modules with code and comments that explain rust syntax and all about Rust lang. This is usef

Domagoj Ratko 5 Nov 5, 2022
A tool and library to losslessly join multiple .mp4 files shot with same camera and settings

mp4-merge A tool and library to losslessly join multiple .mp4 files shot with same camera and settings. This is useful to merge multiple files that ar

Gyroflow 7 Jan 2, 2023