mstk.topology.XyzTopology

class mstk.topology.XyzTopology(file, **kwargs)

Generate Topology from XYZ file.

XYZ format only records the type (or atomic symbol) and position of atoms. There is no real topology, so all atoms are assumed to be in the same molecule. The first column is treated as atom type instead of name or symbol.

Parameters:
  • file (str) –

  • kwargs (dict) – Ignored

topology
Type:

Topology

Examples

>>> xyz = XyzTopology('input.xyz')
>>> topology = xyz.topology
>>> XyzTopology.save_to(topology, 'output.xyz')

Methods

__init__(file, **kwargs)

save_to(top, file, **kwargs)

Save topology into a XYZ file.

static save_to(top, file, **kwargs)

Save topology into a XYZ file.

The name of the first molecule in the topology will be written as the remark of the topology. Only atom type and positions are written. If atom type is empty, use atom symbol instead.

Parameters: