Giter VIP home page Giter VIP logo

simulated_2d_diffusion's Introduction

Simulated 2D Diffusion in presence of a semi-reflective mesh

Brief description

This source code simulates 2D diffusion (e.g. biological membrane components) under periodic boundary conditions in presence of a partially reflective meshgrid (e.g. actin membrane skeleton).

  • N particles perform a random walk in 2D
  • A meshgrid (repesenting a membrane skeleton) reflects particles, which can only pass with a probability pjump
  • 9 Gaussian shaped detection spots are placed on the membrane and simulated fluorescence traces are aquired
  • The fluorescence traces are autocorrelated using the multiple tau algorithm, resulting in realistic fluorescence correlation spectroscopy (FCS) curves

The code was used to generate simulations published in a Biophysical Journal publication.

Lateral membrane diffusion modulated by a minimal actin cortex, Heinemann F., Vogel SK, Schwille P., 2013 (https://www.cell.com/biophysj/fulltext/S0006-3495(13)00260-9)

The simulation was optimized for performance using a profiler. It is written in C++ (with a small inline assembly part for a much faster floor computation).

The code should be easy to read (three files with lots of comments). I recommend starting with main(), then looking at CSimulatedDiffusion::start() where the simulation takes place.

Who may care?

Simulation_illustration Image: Simulated actin mesh, diffusing particles and 9 confocal detection spots.

Dependencies

Environment

  • Tested under Windows 7 and 10 (should in principle also run under Linux)

Basic usage

  1. Compile the project
  2. Create file(s) decribing meshgrid (see mesh/1-2 mean82 sd31.txt)
  3. Create / edit yaml file configuring the simulation
  4. Open cmd, browse to project folder and run

simulated_diffusion.exe simulation_list.yaml Console screenshot

  1. Drink some coffee and wait...
  2. Analyze simulation results written to text files

Description of configuration yaml

The yaml file contains repeating blocks of 4 parameters. An example is in the repository. Example block:

voronoimesh: ./mesh/1-2 mean82 sd31.txt

resultfile: ./1-2 mean82 sd31_p001.txt

pjump: 0.01

Tmax: 100

Each block is one simulation and will output one result file. All blocks are computed until the end.

Parameter description:

-voronoimesh: A text file with coordinates of the mesh. See example in repository. I used a custom program performing Voronoi tesselation (https://en.wikipedia.org/wiki/Voronoi_diagram), which I can distrubute on request.

-resultfile: Name of output file to write to. Output will be a simple textfile containing the 9 simulated FCS autocorrelation curves and their average.

-p_jump: Probability to cross a mesh fibre.

-Tmax: time in simulated seconds (I recommend 100-300s, with larger values for dense meshes and / or high pjump).

Example result when plotted

A simulated FCS curve (without mesh; with mesh the curve will move to right and a second component may appear, see paper https://www.cell.com/biophysj/fulltext/S0006-3495(13)00260-9).

FCS curve

Note:

CSimulatedDiffusion.cpp contains further physical and simulation parameters, which can be modified, e.g.:

  • Diffusion coefficient: D (default: 10 µm²/s)
  • Confocal spot size: r0 (default: 250 nm)
  • Particle number: nParticles (default: 1000)

Try it out!

simulated_2d_diffusion's People

Contributors

fabianheinemann avatar

Stargazers

 avatar Shivam Chitnis avatar

Watchers

James Cloos avatar  avatar

simulated_2d_diffusion's Issues

To do: Repository

Replace Visual studio solution with makefile
Create minimal working example as demo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.