Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

License: Apache 2.0 Build Status codecov PyPI version Pydantic v2

MolTopolParser, abbreviated from Molecular Topology Parser, is a lightweight, open-source Python package designed for accessing, validating, and processing files or data from various molecular simulation and modeling software. It simplifies interfacing between different simulation software and is pivotal in building computational pipelines for molecular simulations.

Installation

Requirements

  • Python 3.6 or newer

  • pip package manager

Quick Start

To install MolTopolParser, run the following command:

pip install moltopolparser

Dependencies

MolTopolParser requires the following Python packages:

These dependencies are automatically installed during the MolTopolParser installation process.

Features

  • Modular Design: Structured around specific file formats from various simulation software, enhancing maintainability and scalability.

  • Pydantic Dataclasses: Ensures robust data validation and type checking across the package.

  • Parsing as Class Methods: Facilitates easy access to and manipulation of simulation files through well-defined class methods.

  • Exposed Modules and Dataclasses: Enables advanced users to extend functionality or integrate with other tools.

When To Use

MolTopolParser is designed for developers to manage hierarchical data structures commonly used in molecular simulations. It provides a robust foundation for building advanced simulation tools and pipelines.

Use Cases:

  • Accessing and manipulating simulation files beyond mere coordinate data.

  • Interfacing between different molecular simulation software.

  • Building and managing computational pipelines.

Not Suitable For:

  • Simple parsing of structural data.

  • Basic analysis of simulation outputs. (Consider using Biopython , MDAanalysis etc.)

Usage Examples

Parsing Gromacs Files

import moltopolparser as mtp

# Validate base data directly
atom_data = {
    "id": 10, "atom_type": "C", "resnr": 100,
    "residu": "UREA", "atom": "C1", "cgnr": 1, "charge": -0.683,
}
atom = mtp.gmx.MolTopAtom(**atom_data)
print(atom.charge)

# Parsing a single .gro file
gro_file = '../tests/data/gmx/two_water.gro'
gro = mtp.gmx.GroFile.parser(gro_file)
print(gro.box_size)

# Parsing and accessing a top file
top_file = '../tests/data/gmx/membrane-martini-charmmgui/system.top'
sys_top = mtp.gmx.Topology.parser(top_file)
print(sys_top.system)

sys_top.pull_forcefield()
print(sys_top.forcefield.atomtypes[0])  # Output: name='P5' at_num=None mass=72.0 charge=0.0 ptype='A' sigma=0.0 epsilon=0.0

sys_top.pull_molecule_topologies()
print(sys_top.molecule_topologies[0])

Contributing

We encourage contributions from the community! Whether you are fixing bugs, proposing new features, or improving the documentation, your help is welcome.

Versioning and Changelog

For details on the latest changes and version history, please refer to the full Change Log on GitHub.

License

MolTopolParser is released under the Apache License. See the LICENSE file for more details.


Metadata

Release files for moltopolparser 0.0.1a3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moltopolparser 0.0.1a3
File Size Uploaded Provenance
moltopolparser-0.0.1a3.tar.gz 20.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for moltopolparser 0.0.1a3
File Interpreter ABI Platform
moltopolparser-0.0.1a3-py3-none-any.whl Python 3 none any Details

Total release size: 36.6 kB

Release files / moltopolparser-0.0.1a3.tar.gz

Download URL moltopolparser-0.0.1a3.tar.gz
Size 20.0 kB
Tags Source
SHA-256 checksum
How to use checksums
29ea3247cc896b4d94b2fa0328f195d1ee6547e6f8bf2296b0822c3687e8b7e2
BLAKE2b-256 checksum
How to use checksums
a6282aa7c22bce6fe18bb9288f5e1b4c7233c8faccee949447cab60b4e1970d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.12

Release files / moltopolparser-0.0.1a3-py3-none-any.whl

Download URL moltopolparser-0.0.1a3-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1d1e9b694b32da9df42006846e1de8a4de208dd89f090e7b8ffa1cde3885118
BLAKE2b-256 checksum
How to use checksums
6b0de9dc715af89887b89020a41152f1e2a4f9448b6e2e0aafbaca5a8e9f4e42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.12

Security for moltopolparser 0.0.1a3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page