.. _AmberMDFormat:

amber/md format
===============

Aliases
-------

``amber/md``

Implementation: :class:`AmberMDFormat <dpdata.plugins.amber.AmberMDFormat>`

Overview
--------


AMBER molecular-dynamics trajectory and label files.

`AMBER <https://ambermd.org/>`_ is a suite of biomolecular simulation
programs for molecular dynamics simulations and analysis.

Coordinates and topology are read from ``.nc`` and ``.parm7`` files.
Labeled loading additionally requires the ``.mdfrc`` force trajectory and
takes energies from either the ``.mden`` or the ``.mdout`` file. The
``parmed`` optional dependency is required.
















Quick examples
--------------

The examples use the preferred alias ``amber/md``; any alias listed above is equivalent.

.. code-block:: python

   import dpdata
   
   # Geometry-only data
   system = dpdata.System("trajectory_prefix", fmt="amber/md")
   
   # Data with energies and forces
   labeled_system = dpdata.LabeledSystem("trajectory_prefix", fmt="amber/md")

Conversions
-----------

.. _AmberMDFormat_from_system:

Convert from this format to System
``````````````````````````````````

.. py:function:: dpdata.System(file_name=None, parm7_file=None, nc_file=None, use_element_symbols=None, fmt: Literal['amber/md'] = None, **kwargs) -> dpdata.system.System
   :noindex:
.. py:function:: dpdata.System.from_amber_md(file_name=None, parm7_file=None, nc_file=None, use_element_symbols=None, **kwargs) -> dpdata.system.System
   :noindex:

   
Load an unlabeled AMBER trajectory.


:Parameters:

    **file_name** : str, optional
        Common prefix used to infer ``<prefix>.parm7`` and ``<prefix>.nc``.

    **parm7_file** : str, optional
        Explicit AMBER topology file. Overrides the inferred path.

    **nc_file** : str, optional
        Explicit NetCDF trajectory file. Overrides the inferred path.

    **use_element_symbols** : list[int] or str, optional
        Atoms whose element symbols are used instead of AMBER atom types,
        given either as a list of atom indexes or as an AMBER mask string
        selecting them.

    **\*\*kwargs** : dict
        Additional format arguments accepted for API compatibility.



:Returns:

    System
        converted system















.. _AmberMDFormat_from_labeled_system:

Convert from this format to LabeledSystem
`````````````````````````````````````````

.. py:function:: dpdata.LabeledSystem(file_name=None, parm7_file=None, nc_file=None, mdfrc_file=None, mden_file=None, mdout_file=None, use_element_symbols=None, fmt: Literal['amber/md'] = None, **kwargs) -> dpdata.system.LabeledSystem
   :noindex:
.. py:function:: dpdata.LabeledSystem.from_amber_md(file_name=None, parm7_file=None, nc_file=None, mdfrc_file=None, mden_file=None, mdout_file=None, use_element_symbols=None, **kwargs) -> dpdata.system.LabeledSystem
   :noindex:

   
Load a labeled AMBER trajectory.


:Parameters:

    **file_name** : str, optional
        Common prefix used to infer the AMBER file names.

    **parm7_file** : str, optional
        Explicit AMBER topology file.

    **nc_file** : str, optional
        Explicit NetCDF coordinate trajectory.

    **mdfrc_file** : str, optional
        Explicit force trajectory. Required for labeled loading; inferred
        from ``file_name`` when not given.

    **mden_file** : str, optional
        Explicit energy file. Used when present, otherwise ``mdout_file``
        supplies the energies.

    **mdout_file** : str, optional
        Explicit AMBER text output. Fallback energy source when
        ``mden_file`` is absent.

    **use_element_symbols** : list[int] or str, optional
        Atoms whose element symbols are used instead of AMBER atom types,
        given either as a list of atom indexes or as an AMBER mask string
        selecting them.

    **\*\*kwargs** : dict
        Additional format arguments accepted for API compatibility.



:Returns:

    LabeledSystem
        converted system













