vermouth.processors.name_moltype module

Provides a processor to assign molecule type names to molecules.

A molecule type (moltype) is Gromacs’s concept of a molecule. Providing a name for a molecule type is required to write an ITP file for that molecule. We also use the molecule type name to group molecules sharing the same molecule type. Molecule type identity is tested based on vermouth.molecule.Molecule.share_moltype_with().

class vermouth.processors.name_moltype.NameMolType(deduplicate=True, meta_key='moltype')[source]

Bases: vermouth.processors.processor.Processor

Assigns molecule type (moltype) names to molecules.

Moltype names are the names given to molecules in an ITP file. This processor assign consecutive names to the molecule. If the deduplicate argument is set to True, then the processor assigns the same name to all molecules with the same topology.

By default, the moltype name is written under the “moltype” key of the molecule meta attributes. This key can be changed with the meta_key argument.

  • deduplicate (bool) – If True, the same name is given to all the molecules that share the same topology. Else, each molecule is given a different name.
  • meta_key (str) – The name of the key in the molecule meta dictionary under which the moltype must be stored.

See also

This processor can set key/value pairs in the meta attributes of one molecule, or all molecules in a system. It can be used to set the moltype manually.
Writes the ITP file for a molecule, and use the ‘moltype’ meta to name the molecule.