Skip to main content

A unified set of tools for setting up general organic polymer systems for MD within the OpenFF framework

Project description

Polymer-Oriented LibrarY of Monomer Expression Rules and In-silico Synthesis Tools

GitHub Actions Build Status codecov

A unified set of tools for setting up molecular dynamics simulations of general organic polymer systems. Based upon concepts introduced in "Parameterization of General Organic Polymers within the Open Force Field Framework" (Davel, Connor M., Bernat, Timotej, Wagner, Jeffrey R., and Shirts, Michael R.)

abstract

Features

Includes functionality for:

  • Generating chemical information-rich monomer residue templates
  • Enumeration of all possible repeat units of a polymer ensemble given initial monomers and a target polymerization mechanism
  • Building of linear homopolymers and copolymers (both topologies and coordinates)
  • Solvating polymer systems
  • Packing of many polymer chains into melt-like boxes
  • Force-field parameterization within the OpenFF framework
  • Interfaces to semi-empirical and graph neural network-based atomic partial charge assignment
  • Reproducible simulation specification API
  • Interfaces to OpenMM for running serial simulations with different thermodynamic parameters
  • Much more!

Documentation

Complete documentation for polymerist can be found on the polymerist ReadTheDocs page

Examples

Examples of how to import and invoke the core features of polymerist can be found in the accompanying polymerist_examples repository.

Requirements

OS

polymerist is compatible with Linux (recommended) and Mac machines capable of installing Python 3.11. Due to lack of support from AmberTools, direct installation on Windows machines is not supported; however, this can easily be circumvented by using the Windows Subsystem for Linux (WSL2)

Python package manager

Before proceeding with installation, ensure you have some iteration of a Python package and environment management system installed on your machine. We recommend using mamba, installable via Miniforge. Miniconda and other Anaconda manager also work; however if you opt to use conda over mamba, be prepared for a markedly slower and more tedious install process!

Installation

The distribution for polymerist is hosted on PyPI. For detailed instruction on how to install polymerist and other required toolkits, see the installation docs. Here we provide an abridged summary to get you going

Base install

A fully-featured install in a safe virtual environment (named "polymerist-env", here) can be obtained by running the following terminal commands:

Mamba install (basic)

mamba create -n polymerist-env python=3.11
mamba activate polymerist-env
pip install polymerist
mamba install -c conda-forge openff-toolkit mbuild openbabel "packmol<=20.15.1"

Mamba install (extended)

An extended install with Jupyter Notebook support, molecular visualization capability, and chemical data querying capability can be obtained very similarly:

mamba create -n polymerist-env python=3.11
mamba activate polymerist-env
pip install polymerist[interactive,chemdb]
mamba install -c conda-forge openff-toolkit mbuild openbabel "packmol<=20.15.1"

Testing installation

To see if the installation was successful, one can run the following short set of commands which should yield the outputs shown:

mamba activate polymerist-env; python
>>> import polymerist as ps
>>> print(ps.pascal(5))
    1    
   1 1   
  1 2 1  
 1 3 3 1 
1 4 6 4 1

Parameterization toolkits

Assigning atomic partial charges using some flavor of AM1-BCC and enhanced conformer generation also requires installation of some supplementary toolkits. These can be installed as follows:

mamba activate polymerist-env
mamba install -c openeye openeye-toolkits
mamba install -c conda-forge espaloma_charge "torchdata<=0.9.0"
mamba install -c conda-forge openff-nagl "torchdata<=0.9.0"

Installing from source (optional)

polymerist and all required dependencies can also be installed directly from the source code in this repository. To install, execute the following set of terminal commands in whichever directory you'd like the installation to live on your local machine:

git clone https://github.com/timbernat/polymerist
cd polymerist
mamba env create -n polymerist-env -f devtools/conda-envs/release-build.yml
mamba activate polymerist-env
pip install .

Developer installation (for advanced users only)

Those developing for polymerist may like to have an editable local installation, in which they can make changes to the source code and test behavior changes in real-time. This type of installation proceeds as follows:

git clone https://github.com/timbernat/polymerist
cd polymerist
mamba env create -n polymerist-dev -f devtools/conda-envs/dev-build.yml
mamba activate polymerist-dev
pip install -e . --config-settings editable_mode=strict

The --config-settings editable_mode flag in the final line allows this installation to "play nicely" with PyLance, making auto-completion and navigation to source code much easier for VSCode users. It is optional, and can be removed if this compatibility is not desired

Copyright

Copyright (c) 2024, Timotej Bernat (timotej.bernat@colorado.edu)

Acknowledgements

Project based on the Computational Molecular Science Python Cookiecutter version 1.1.

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

polymerist-1.0.2.tar.gz (266.9 kB view details)

Uploaded Source

Built Distribution

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

polymerist-1.0.2-py3-none-any.whl (360.4 kB view details)

Uploaded Python 3

File details

Details for the file polymerist-1.0.2.tar.gz.

File metadata

  • Download URL: polymerist-1.0.2.tar.gz
  • Upload date:
  • Size: 266.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for polymerist-1.0.2.tar.gz
Algorithm Hash digest
SHA256 63cd5665ec3099831963cd970d3f3560bd9f91398f4487054b5c85199f4ee5eb
MD5 9ae7096fba1d1f583868dad2aa9f36f5
BLAKE2b-256 2860a732e4edf65ac81cb44cb5ab22d3ce00ac6076d45597b2b6acd241b575f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for polymerist-1.0.2.tar.gz:

Publisher: deploy-to-pypi.yml on timbernat/polymerist

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

File details

Details for the file polymerist-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: polymerist-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 360.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for polymerist-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 99468f63b9925cbe304463423786de6bbe2332a7cd697c0f373a698a1ced0ef9
MD5 1954bb547ed5cc65077d9e7973e5b72d
BLAKE2b-256 7ca1c5aabe25db98da6b9aee1c117fd7ac5481be368410593f2698de64cb9b6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for polymerist-1.0.2-py3-none-any.whl:

Publisher: deploy-to-pypi.yml on timbernat/polymerist

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