Skip to main content

Python implementation of the kinetic model of neuromuscular transmission dynamics.

Project description

Dynamics of Neuromuscular Transmission Reproduced by Calcium-Dependent and Reversible Serial Transitions in the Vesicle Fusion Complex

KiNeuron: Python implementation of the kinetic model of neuromuscular transmission dynamics.

KiNeuron is an open-source implementation of our mechanistic kinetic model of neuromuscular transmission based on sequential maturation transitions in the molecular fusion complex.

KiNeuron is:

  • Simple -- It is possible to simulate an alternative kinetic model with a few lines of code. This way, you can focus on the key parts of the problem that really matter.
  • Flexible -- It is possible to customize the kinetic model by adjusting the number of transition states, the kinetic transitions between states, as well as the rate constants. Further, KiNeuron allows the addition of a stimulation protocol.


Requirements

KiNeuron requires:

  • python >= 3.6
  • graphviz >= 0.19.1
  • matplotlib >= 3.3.4
  • numpy >= 1.19.5
  • pandas >= 1.1.5, <1.3.0

To use the graph display functions of the model, it is necessary to install the Graphviz library as described in follow documentation.

Installation

  • Clone this project repository to your local workspace.
  • Create a new Python Virtual Environment with venv or conda.
  • Install the required libraries from the file requeriments.txt into your virtual environment as follow:
$ pip install -r requeriments.txt

You are ready to use our package.

Usage Example

Creating a Model

Create a file main.py and import the following classes:

from kineuron import (KineticModel, RateConstant, Solver, Stimulation,
                      Transition, TransitionState)

After, instance the model objects as follows:

model = KineticModel(name='my-model', vesicles=100)

docked = TransitionState(name='Docked')
fusion = TransitionState(name='Fusion')

alpha = RateConstant(name="α", value=0.3, calcium_dependent=True)
beta = RateConstant(name="β", value=15)

tr1 = Transition(name='Transition 1',
                 rate_constant=alpha,
                 origin="Docked",
                 destination="Fusion")
tr2 = Transition(name='Transition 2',
                 rate_constant=beta,
                 origin="Fusion",
                 destination="Docked")

Add all objects to the model as follow:

model.add_transition_states([docked, fusion])
model.add_rate_constants([alpha, beta])
model.add_transitions([tr1, tr2])

Finally, initialize the model:

model.init()

Likewise, a stimulation protocol should be defined (if the experiment expects it) as follows:

protocol = Stimulation(
     conditional_stimuli=5,
     period=0.03,
     time_start_stimulation=0.1,
     tau_stimulus=0.0013,
     time_wait_test=0.2,
     intensity_stimulus=100.0,
     type_stimulus='exponential_decay',
     name="Custom Stimulation Protocol")

The following lines show the time profile of the stimulation protocol:

import numpy as np

t = np.arange(0, 0.5, 0.0001)
protocol.plot(t)

Stimulation protocol

Model Information (Optional)

General model information can be obtained as follows:

model.get_info()

and run the file main.py:

$ python main.py

==============  MODEL INFORMATION  ===============
MODEL NAME:                   my-model
TOTAL VESICLES:               100

TRANSITION STATES             VESICLES
Docked:                       100
Fusion:                       0
--------------------------------------------------
NAME TRANSITION:              Transition 1
RATE CONSTANT NAME:           α
RATE CONSTANT VALUE:          0.3 s⁻¹
CALCIUM-DEPENDENT:            True
ORIGIN:                       Docked
DESTINATION:                  Fusion
--------------------------------------------------
NAME TRANSITION:              Transition 2
RATE CONSTANT NAME:           β
RATE CONSTANT VALUE:          15 s⁻¹
CALCIUM-DEPENDENT:            False
ORIGIN:                       Fusion
DESTINATION:                  Docked
==================================================

The following lines allow you to visualize the graph of the model:

graph = model.get_graph()
graph.view()

Graph Model

Run It

The Solver object that simulates the time evolution of the model must be instantiated. Here, we use an implementation of the Gillespie Stochastic Algorithm (1977).

experiment = Solver(model=model, stimulation=protocol)

Before initiating the simulation, be sure to obtain the resting state of the model, from which all repetitions of the experiment are starting. This is achieved as follows:

experiment.resting_state()

With the following lines the experiment is run. The results can be obtained and saved in a .csv file for further analysis.

experiment.run(repeat=1)
results = experiment.get_results(mean=True)
results.to_csv("results.csv", index=True)

Finally, the main.py file is executed to perform the complete simulation:

$ python main.py

Release History

  • 0.1.0
    • Stable version released.
  • 0.0.1
    • Work in progress.

Contributing

  • If you are interested in contributing to the project, please follow these guidelines:

    1. Fork it (https://github.com/alexini-mv/kinetic-neurotransmission).
    2. Create your feature branch:
    $ git checkout -b feature/fooBar
    
    1. Commit your changes:
    $ git commit -am 'Add some fooBar'
    
    1. Push to the branch:
    $ git push origin feature/fooBar
    
    1. Create a new Pull Request.
  • If you want to report a bug, please create a new issue here describing the error as clearly as possible.

Correspondence

Author: Alejandro Martínez-Valencia

Email: al.martinez.valencia@gmail.com

Citation

If you use our code for your research or scientific publication, we kindly ask you to refer to our work as follows:

  • Martínez-Valencia A., Ramírez-Santiago G. and De-Miguel F.F. (2022) Dynamics of Neuromuscular Transmission Reproduced by Calcium-Dependent and Reversible Serial Transitions in the Vesicle Fusion Complex. Front. Synaptic Neurosci. 13:785361. DOI: 10.3389/fnsyn.2021.785361

License

Distributed under the GNU General Public License. See LICENSE for more information.

Interesting Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kineuron-0.0.1.tar.gz (27.4 kB view hashes)

Uploaded source

Built Distribution

kineuron-0.0.1-py3-none-any.whl (27.2 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page