Welcome to MyoGen Logo

The modular and extensible simulation toolkit for neurophysiology

Documentation Python 3.12+ Version

Installation โ€ข Documentation โ€ข Examples โ€ข How to Cite

Overview#

MyoGen is a modular and extensible neuromuscular simulation framework for generating physiologically grounded motor-unit activity, muscle force, and surface EMG signals.

It supports end-to-end modeling of the neuromuscular pathway, from descending neural drive and spinal motor neuron dynamics to muscle activation and bioelectric signal formation at the electrode level. MyoGen is designed for algorithm validation, hypothesis-driven research, and education, providing configurable building blocks that can be independently combined and extended.

Highlights#

๐Ÿงฌ Biophysically inspired neuron models โ€” NEURON-based motor neurons with validated calcium dynamics and membrane properties

๐ŸŽฏ Everything is inspectable โ€” Complete access to every motor unit, spike time, fiber location etc. for rigorous algorithm testing

โšก๏ธ Vectorized & parallel โ€” Multi-core CPU processing with NumPy/Numba vectorization for fast computation

๐Ÿ”ฌ End-to-end simulation โ€” From motor unit recruitment to high-density surface EMG in a single framework

๐Ÿ“Š Reproducible science โ€” Deterministic random seeds and standardized Neo Block outputs for exact replication

๐Ÿ“ฆ NWB export โ€” Optional export to Neurodata Without Borders format for data sharing via DANDI

๐Ÿงฐ Comprehensive toolkit โ€” Surface EMG, intramuscular EMG, force generation, and spinal network modeling

Installation#

Requires Python 3.12+ โ€” Check your version with python --version

System Requirements#

Platform

Before Installing MyoGen

Windows

NEURON 8.2.7 - Download, run installer, select โ€œAdd to PATHโ€

Linux

sudo apt install libopenmpi-dev (Ubuntu/Debian) or sudo dnf install openmpi-devel (Fedora)

macOS

brew install open-mpi

[!CAUTION]

Windows Users: Prerequisites

You MUST install the following before installing MyoGen on Windows:

1. Visual C++ Build Tools

Download and install Visual C++ Build Tools.

During installation, select these components:

  • MSVC Build Tools for x64/x86 (Latest)

  • MSVC v143 โ€“ VS 2022 C++ x64/x86 build tools

  • Windows 11 SDK (latest)

  • C++ core desktop features

2. NEURON Simulator

  1. Download: NEURON 8.2.7 Installer

  2. Run the installer and select โ€œAdd to PATHโ€ when prompted

  3. Restart your terminal (close and reopen)

  4. Then continue with the installation below


Step 1: Install uv (Package Manager)#

We use uv - a fast Python package manager. Install it first:

Windows (open PowerShell):

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Linux/macOS:

curl -LsSf https://astral.sh/uv/install.sh | sh

After installing, restart your terminal (close and reopen it).


Step 2: Create a New Project#

Open a terminal and navigate to where you want your project:

# Create a new folder for your project
mkdir my_emg_project
cd my_emg_project

# Initialize a Python project
uv init

# Add MyoGen to your project
uv add myogen

Thatโ€™s it! MyoGen is now installed and ready to use.


Step 3: Verify Installation#

Create a test file to make sure everything works:

# Create a test script
uv run python -c "from myogen import simulator; print('MyoGen installed successfully!')"

If you see MyoGen installed successfully! - youโ€™re all set!


Alternative: pip install#

If you prefer pip over uv:

pip install myogen

For Developers (From Source)#

git clone https://github.com/NsquaredLab/MyoGen.git
cd MyoGen
uv sync
uv run poe setup_myogen

Optional: GPU Acceleration#

For 5-10ร— faster convolutions (requires NVIDIA GPU):

uv add cupy-cuda12x

Documentation#

๐Ÿ“– Read the full documentation

  • User Guide โ€” Working with simulation outputs

  • API Reference โ€” Complete class documentation

  • Examples โ€” Step-by-step tutorials from recruitment to EMG

How to Cite#

If you use MyoGen in your research, please cite:

@article{simpetru_molinari_2026_myogen,
  title   = {MyoGen: Unified Biophysical Modeling of Human Neuromotor Activity and Resulting Signals},
  author  = {S{\^i}mpetru, Raul C. and Molinari, Ricardo G. and Rohlf, Devon R. and
             Batichotti, Rebeka L. and Watanabe, Renato N. and
             Elias, Leonardo A. and Del Vecchio, Alessandro},
  journal = {bioRxiv},
  note    = {preprint},
  year    = {2026},
  doi     = {10.64898/2026.01.01.697284},
  url     = {https://www.biorxiv.org/content/10.64898/2026.01.01.697284}
}

Contributing#

Contributions welcome! See issues if you want to add a feature or fix a bug.

Contributors#

MyoGen is authored by Raul C. Sรฎmpetru and Ricardo G. Molinari. It is a joint project of the Nsquared Lab (Neuromuscular Physiology and Neural Interfacing Laboratory) at FAU Erlangen-Nรผrnberg, the NER Lab (Neural Engineering Research Laboratory) at the University of Campinas, and the BMClab (Biomechanics and Motor Control Laboratory) at the Federal University of ABC.

Thanks goes to these wonderful people (emoji key):

All Contributors

Raul C. Sรฎmpetru
Raul C. Sรฎmpetru

๐Ÿ’ป ๐Ÿค” ๐Ÿšง ๐Ÿ“† ๐Ÿ”ฌ
Ricardo G. Molinari
Ricardo G. Molinari

๐Ÿค” ๐Ÿšง ๐Ÿ”ฌ
Devon R. Rohlf
Devon R. Rohlf

๐Ÿ’ป ๐Ÿšง ๐Ÿ”ฌ
Renato N. Watanabe
Renato N. Watanabe

๐Ÿ’ป ๐Ÿค” ๐Ÿง‘โ€๐Ÿซ ๐Ÿ”ฌ
Alessandro Del Vecchio
Alessandro Del Vecchio

๐Ÿค” ๐Ÿง‘โ€๐Ÿซ ๐Ÿ”ฌ
Leonardo A. Elias
Leonardo A. Elias

๐Ÿค” ๐Ÿง‘โ€๐Ÿซ ๐Ÿ”ฌ
Joรฃo Bittar
Joรฃo Bittar

๐Ÿ› ๐Ÿค”
BraveUnicorn
BraveUnicorn

๐Ÿ’ป
Add your contributions

This project follows the all-contributors specification. Contributions of any kind welcome!

License#

MyoGen is AGPL licensed. See LICENSE for details.


Package Structure#

MyoGen/
โ”œโ”€โ”€ myogen/              # Main package source code
โ”‚   โ”œโ”€โ”€ simulator/       # Core simulation functionality
โ”‚   โ”‚   โ”œโ”€โ”€ core/        # Core simulation components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ emg/     # EMG signal generation
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ muscle/  # Muscle modeling
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ spike_train/ # Motor neuron simulation
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ utils/           # Utility functions and tools
โ”‚   โ”‚   โ”œโ”€โ”€ plotting/    # Visualization utilities
โ”‚   โ”‚   โ”œโ”€โ”€ currents.py  # Current generation
โ”‚   โ”‚   โ””โ”€โ”€ nmodl.py     # NMODL file handling
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ examples/            # Example scripts and tutorials
โ”œโ”€โ”€ docs/                # Documentation source
โ”œโ”€โ”€ pyproject.toml       # Project metadata and dependencies
โ””โ”€โ”€ uv.lock              # Pinned versions of dependencies