A lightweight package to parse and process molecular simulation files
Project description
MolTopolParser, abbreviated for Molecular Topology Parser, is a lightweight Python package designed to read and process file formats used in various molecular simulation and modeling software.
Overview
Each module in MolTopolParser handles file formats specific to a type of software. All file data is mapped to Pydantic dataclasses, ensuring data conforms to expected formats and types. This approach provides a solid foundation for building simulation or pipeline tools, while maintaining simplicity and facilitating integration with other tools.
Features
- Modular Design: Each module corresponds to a specific software's file formats.
- Pydantic Dataclasses: Ensures data validation and type checking.
- Class Methods for Parsing: Includes parser functions as class methods for accessing and processing files.
- Exposed Modules and Dataclasses: All modules and their contained dataclasses are accessible.
Data Hierarchy Model
MolTopolParser provides a three-level data abstraction model to manage the hierarchical nature of simulation data:
Level 1: Base Data
Classes at this level represent individual lines in a file. They focus on the smallest unit of data, providing direct mapping and validation for each line.
Level 2: Aggregation Data (or Aggregation-File Data)
Classes at this level represent a whole section of lines, which could be stored in a standalone file. They group Base Data lines into meaningful sections for easier management and processing.
Level 3: Summarization Data
Classes at this top level usually correspond to an entry or summary file. They gather all available data and provide access to the entire content.
Data Flow Logic
- Data Declaration and Organization: From top-down.
- Data Acquisition and Validation: From bottom-up.
The parsing occurs at their corresponding data levels:
- Summarization Level: Acts as the entry point for the entire system/content. It calls and organizes data from the aggregation level.
- Aggregation Level: Handles the actual parsing. It functions like a component in a framework, being called by the summarization level to parse and organize data.
- Base Data Level: Corresponds to the most basic data records.
Parser functions are included as class methods at the aggregation level, while the summarization level calls these methods to parse and organize data. Additionally, the aggregation level can include methods to convertor write out the data after parsing, once the data is organized.
User Guild
Detailed installation and user guide, together with comprehensive example simulations are located in link
example of calling the package module and dataclasses.
Installation
git clone FOLDER
pip install -r requirements.txt
pip install -e .
Dependencies
pydantic
numpy
Setup for Developing
cd MolTopolParser
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
# run test
pytest tests/test_gmx.py -v -s
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file moltopolparser-0.0.1a2.tar.gz
.
File metadata
- Download URL: moltopolparser-0.0.1a2.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52524576bab162217c768e18441b4def144d6b74e8d63046da7aab17344e23ef |
|
MD5 | 4699652c32d41ac28ffd3a9508edba85 |
|
BLAKE2b-256 | f5acb1346fe9ee9d650cafacf2a0f6f6589ee90ad5d41954e967ad29dc0d9d53 |
File details
Details for the file moltopolparser-0.0.1a2-py3-none-any.whl
.
File metadata
- Download URL: moltopolparser-0.0.1a2-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bbf859beafb0e40f92c1a3c7e8ad09fb0aab806eb2d533e82e912f73ab7a11b |
|
MD5 | 5df3ed08f4d2c5097cba750bc71881c9 |
|
BLAKE2b-256 | 8a9dc983442eb59f73278c72806a7de1f792704f76ab92d8c4c89173d9266525 |