Skip to main content

Modular and extensible neuromuscular simulation framework for generating physiologically grounded motor-unit activity, muscle force, and EMG signals (surface and intramuscular)

Project description

Welcome to MyoGen Logo

The modular and extensible simulation toolkit for neurophysiology

Documentation Python 3.12+ Version

InstallationDocumentationExamplesHow 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.

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

myogen-0.10.1.tar.gz (4.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

myogen-0.10.1-cp313-cp313-manylinux_2_28_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

myogen-0.10.1-cp313-cp313-macosx_11_0_arm64.whl (5.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

myogen-0.10.1-cp312-cp312-manylinux_2_28_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

myogen-0.10.1-cp312-cp312-macosx_11_0_arm64.whl (5.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file myogen-0.10.1.tar.gz.

File metadata

  • Download URL: myogen-0.10.1.tar.gz
  • Upload date:
  • Size: 4.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for myogen-0.10.1.tar.gz
Algorithm Hash digest
SHA256 024723e7ca42bec23fd4f63274a54d4c63cd85a94a0c59676724bd82d249d9ff
MD5 90bf84f5991aa17876b8a6425eef1f8c
BLAKE2b-256 bde33da4d7676342ae7fc8e34e1420081e3d55a8708c68dcc46e911a0989973d

See more details on using hashes here.

Provenance

The following attestation bundles were made for myogen-0.10.1.tar.gz:

Publisher: build-wheels.yml on NsquaredLab/MyoGen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file myogen-0.10.1-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for myogen-0.10.1-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f0b676809b6376bfd1ba0d7877b656d14e9f5f0b80abe37f697890e11c156b81
MD5 e405b2ec2f3da341af6e8043eba84800
BLAKE2b-256 472acc6f763eaa0a8edabd7e2d7514d36c1f6dc46fa5fe5e9336fd41f2ab4c4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for myogen-0.10.1-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on NsquaredLab/MyoGen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file myogen-0.10.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for myogen-0.10.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f9c040d0d96ba9356575bddd62ebb09fb7888dad84fbc3761f7224c9cada4304
MD5 6137b467252e298daa588f1c23444553
BLAKE2b-256 8bbee90aa44fcdb866e2e11e1b6690858c86ffa8c1087c59465375c60749775e

See more details on using hashes here.

Provenance

The following attestation bundles were made for myogen-0.10.1-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: build-wheels.yml on NsquaredLab/MyoGen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file myogen-0.10.1-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for myogen-0.10.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bd2960706011e53c89cb70e7623eba348ba3e28905513a5ce0d51eddaa0b59ba
MD5 e693a1e6e4cba98f8e1d40d1735c795a
BLAKE2b-256 374d6e4c2522cb493c4d78f8586758010438ab6bd8cf1aa92e346f8ab041c9cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for myogen-0.10.1-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on NsquaredLab/MyoGen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file myogen-0.10.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for myogen-0.10.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dd11cd5df1d948aa85275d4e81ce00bae85b099f752e2e6a6b0f3eb4f48a2333
MD5 0a2df2a76ed3188bd84987953dd98f65
BLAKE2b-256 f43063c8ce93df09f3e7ae0acea6bb2443716bb257d0cc044b5a761a38ad5c0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for myogen-0.10.1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: build-wheels.yml on NsquaredLab/MyoGen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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