Code Monkey home page Code Monkey logo

openff-interchange's Introduction

OpenFF Interchange

Test status CI Status pre-commit.ci status
Code quality pre-commit Codecov coverage
Latest release GitHub release (latest by date including pre-releases)
User support Documentation Status Discussions

A project (and object) for storing, manipulating, and converting molecular mechanics data.

Documentation

Documentation for Interchange, including examples, a brief user guide, release history, and API docs, is available on the OpenFF website. Example notebooks are rendered online among examples from other projects in the OpenFF ecosysytem docs

How to cite

Please cite Interchange using the Zenodo record of the latest release or the version that was used. The BibTeX reference of the latest release can be found here.

Installation

Recent versions of the OpenFF Toolkit (0.11.0+, released August 2022) install Interchange by default through its conda package.

Interchange can also be installed manually via conda (or mamba):

conda install openff-interchange -c conda-forge

Getting started

The Iterchange object serves primarily as a container object for parametrized data. It can currently take in SMIRNOFF or Foyer force fields and chemical topologies prepared via the OpenFF Toolkit. The resulting object stores parametrized data and provides APIs for export to common formats.

from openff.toolkit import ForceField, Molecule
from openff.units import unit

from openff.interchange import Interchange


# Use the OpenFF Toolkit to generate a molecule object from a SMILES pattern
molecule = Molecule.from_smiles("CCO")

# Generate a conformer to be used as atomic coordinates
molecule.generate_conformers(n_conformers=1)

# Convert this molecule to a topology
topology = molecule.to_topology()

# Define periodicity via box vectors
topology.box_vectors = unit.Quantity([4, 4, 4], unit.nanometer)

# Load OpenFF 2.0.0 "Sage"
sage = ForceField("openff-2.0.0.offxml")

# Create an Interchange object
out = Interchange.from_smirnoff(force_field=sage, topology=topology)

# Convert the Interchnage object to an OpenMM System
system = out.to_openmm()

# or write to GROMACS files
out.to_gro("out.gro")
out.to_top("out.top")

# or store as JSON
json_blob = out.json()

For more information, please consult the full documentation.

For more examples specific to Interchange, navigate to the examples/ directory.

Please note that this software in an early and experimental state without a stable API or guarantees of long-term stability.

Copyright

Copyright (c) 2020, Open Force Field Initiative

License

The source code of Interchange is hosted on GitHub and is available under the MIT license (see the file LICENSE). Some parts inherit from code distributed under other licenses, as detailed in LICENSE-3RD-PARTY.

Acknowledgements

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.