.. NICE Lab Molecule Editor documentation master file, created by sphinx-quickstart on Tue Mar 27 12:13:57 2018. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. NICE Lab Molecule Editor ======================== For full documentation, see `Arcas.github.io/nme `_. ``nme`` is a Python library that provides a simple, programmatic interface to XYZ files. ``nme`` can also export LAMMPS input data files. .. toctree:: :maxdepth: 2 :caption: Contents: api Quick Start ----------- .. code-block:: python import nme Basic usage of ``nme`` involves loading and manipulating molecules from XYZ files. A single molecule can be loaded with the function :meth:`read_xyz `. ``nme`` provides three main classes: :class:`Atom `, :class:`Molecule `, and :class:`Workspace `. An ``Atom`` is the basic unit of ``nme`` and can be initialized as such: .. code-block:: python # The first argument is the atomic number; the second argument is a list of # the atom's X, Y, and Z coordinates. carbon = nme.Atom(6, [0, 0, 1]) # All Atoms, Molecules, and Workspaces can hold attributes which can be # set and accessed via indexing. These attributes are ignored when saving # to disk. carbon["used"] = False print(carbon["used"]) :class:`Molecule ` objects consist of ``Atom`` objects and can either be constructed by hand or loaded from an XYZ file. You can append atoms or other molecules to ``Molecule`` objects - this can be done by using either the :meth:`Molecule.append ` function or the ``+=`` operator. Additionlly, ``Molecule`` objects can be saved to XYZ files using :meth:`Molecule.write_xyz `. .. code-block:: python glucose = nme.read_xyz("./samples/glucose.xyz") glucose.move_to([0, 0, 0]) glucose += carbon glucose.write_xyz("./glucose_with_extra_carbon.xyz") .. image:: ./static/glucose_with_extra_carbon.png .. code-block:: python (glucose + nme.Atom(6, [0, 0, -1])).write_xyz("./glucose_plus_2_carbon.xyz") .. image:: ./static/glucose_plus_2_carbon.png :class:`Workspace ` objects consist of ``Molecule`` and ``Atom`` objects. The primary purpose of a ``Workspace`` is to allow writing of multiple objects to a single output file. ``Workspace`` objects have a :meth:`Workspace.write_xyz ` function that writes the entire workspace to a single XYZ file as a single molecule. Additionally the :meth:`write_lammps