api

A module including the API for the topology subpackage.

Summary

Functions:

generate_shake_topology_file

Wrapper function to generate a shake topology file for a given trajectory.

select_from_restart_file

Selects atoms from a restart file and writes them to a new file.

selection_from_restart_file_as_list

Selects atoms from a restart file and writes them to a new file.

Reference

generate_shake_topology_file(
trajectory: Trajectory,
selection: SelectionCompatible = None,
output: str | None = None,
mode: FileWritingMode | str = 'w',
use_full_atom_info: bool = False,
) None[source]

Wrapper function to generate a shake topology file for a given trajectory.

Parameters:
  • trajectory (Trajectory) – The trajectory to generate the shake topology for.

  • selection (SelectionCompatible, optional) – Selection is either a selection object or any object that can be initialized via ‘Selection(selection)’. default None (all atoms)

  • output (str | None, optional) – The output file. If not specified, the output is printed to stdout.

  • mode (FileWritingMode | str, optional) – The writing mode, by default “w”. The following modes are available: - “w”: write - “a”: append - “o”: overwrite

  • use_full_atom_info (bool, optional) – If True, the full atom information (name, index, mass) is used for the selection, by default False Is always ignored if atoms is not a list of atom objects.

select_from_restart_file(
selection: SelectionCompatible,
restart_file: str,
moldescriptor_file: str | None = None,
use_full_atom_info: bool = False,
) Np1DIntArray[source]

Selects atoms from a restart file and writes them to a new file.

Parameters:
  • selection (SelectionCompatible) – Selection is either a selection object or any object that can be initialized via ‘Selection(selection)’.

  • restart_file (str) – The restart file to read the atoms from.

  • moldescriptor_file (str | None, optional) – The moldescriptor file to read the atom types from, by default None

  • use_full_atom_info (bool, optional) – If True, the full atom information (name, index, mass) is used for the selection, by default False Is always ignored if atoms is not a list of atom objects.

selection_from_restart_file_as_list(
selection: SelectionCompatible,
restart_file: str,
moldescriptor_file: str | None = None,
use_full_atom_info: bool = False,
) list[int][source]

Selects atoms from a restart file and writes them to a new file.

Parameters:
  • selection (SelectionCompatible) – Selection is either a selection object or any object that can be initialized via ‘Selection(selection)’.

  • restart_file (str) – The restart file to read the atoms from.

  • moldescriptor_file (str | None, optional) – The moldescriptor file to read the atom types from, by default None

  • use_full_atom_info (bool, optional) – If True, the full atom information (name, index, mass) is used for the selection, by default False Is always ignored if atoms is not a list of atom objects.