nmodl.js is a project aimed at providing a NEURON simulator implemented in JavaScript. This project leverages the capabilities of JavaScript to create a flexible and interactive environment for simulating neuronal models defined using the NEURON Model Description Language (NMODL).
With nmodl.js, developers can utilize modern web technologies to run simulations directly in the browser, enabling real-time visualization and manipulation of neuronal models.
- Browser-Based Simulation: Run NEURON simulations directly in your web browser without the need for additional software installations.
- Interactive Visualization: Utilize JavaScript libraries for dynamic visualization of neuronal activity and model parameters.
- Integration with Web Technologies: Easily integrate with other JavaScript libraries and frameworks to enhance functionality and user experience.
- Support for NMODL: Parse and execute NMODL code using the ANTLR4 grammar for accurate model representation.
To get started with nmodl.js, follow these steps:
-
Clone the Repository: Clone the repository containing the nmodl.js files.
git clone https://github.com/vahidgh/nmodljs.git cd nmodljs -
Install Dependencies: Install the required dependencies using npm.
npm install
-
Run the Simulator: Start the development server to run the simulator.
npm start
NMODL (NEURON Model Description Language) is a domain-specific language used to define models for the NEURON simulator. This ANTLR4 grammar provides a formal specification for parsing NMODL code, enabling syntax highlighting, code analysis, and other tooling for developers working with NEURON.
To run and test NMODL grammar with ANTLR4, follow these steps:
-
Install ANTLR4: Ensure you have ANTLR4 installed. You can download it from ANTLR's official website.
-
Generate the Parser: Use ANTLR4 to generate the parser and lexer from the grammar file.
cd src/grammar antlr4 nmodl.g4 -
Test: Use
src/grammar/rule_test.shto test.modfiles in theexamplesdirectory. Make sure you have theantlrjarfile in thedev/g4-outputdirectory.bash rule_test.shOr
cat examples/isi.mod | bash rule_test.shAn output like this can be seen:
-
Install ANTLR4ts:
npm install antlr4ts -
Generate the Parser:
cd src/grammar antlr4ts nmodl.g4 -
Test: Uder development...
Run the following command to run all the tests:
npm test
Or for testing a specific test file in debug mode:
npm run test:debug src/compiler/__tests__/ModToTs.test.ts
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
NEURON Simulator: https://neuron.yale.edu/neuron/
ANTLR: https://www.antlr.org/