# mdtraj.formats.AmberRestartFile

class mdtraj.formats.AmberRestartFile(filename, mode='r', force_overwrite=True)

  Interface for reading and writing AMBER ASCII restart files. This is a file-like object, that supports both reading and writing depending on the mode flag. It implements the context manager protocol, so you can also use it with the python ‘with’ statement.

  Parameters:

    - filename (path-like) – The name of the file to open

    - mode ({'r', 'w'}, default='r') – The mode in which to open the file. Valid options are ‘r’ or ‘w’ for ‘read’ or ‘write’

    - force_overwrite (bool, default=False) – In write mode, if a file named filename already exists, clobber it and overwrite it

  See also

  `md.AmberNetCDFRestartFile`

    Low level interface to AMBER NetCDF-format restart files

  Attributes:
    n_atoms
    n_frames

  Methods

  `read`([atom_indices]) | Read data from an AMBER ASCII restart file
  `read_as_traj`(topology[, atom_indices]) | Read an AMBER ASCII restart file as a trajectory.
  `write`(coordinates[, time, cell_lengths, ...]) | Write one frame of a MD trajectory to disk in the AMBER ASCII restart file format.

  close |

  __init__(filename, mode='r', force_overwrite=True)

  Methods

  `__init__`(filename[, mode, force_overwrite]) |
  `close`() |
  `read`([atom_indices]) | Read data from an AMBER ASCII restart file
  `read_as_traj`(topology[, atom_indices]) | Read an AMBER ASCII restart file as a trajectory.
  `write`(coordinates[, time, cell_lengths, ...]) | Write one frame of a MD trajectory to disk in the AMBER ASCII restart file format.

  Attributes

  `distance_unit` |
  `n_atoms` |
  `n_frames` |