This module contains a single class ForceField used to output a GROMACS .ff forcefield.

Module Contents



Class used to output a GROMACS .ff forcefield


copy_files(src_dir: pathlib.Path, dest_dir: pathlib.Path, files: Iterable[str]) → None

Copy files from one directory to another.



pycgtool.forcefield.copy_files(src_dir: pathlib.Path, dest_dir: pathlib.Path, files: Iterable[str])None[source]

Copy files from one directory to another.

class pycgtool.forcefield.ForceField(name: str, dir_path: PathLike = pathlib.Path('.'))[source]

Class used to output a GROMACS .ff forcefield

write(self, filename: str, mapping, bonds)[source]

Write RTP and R2B files for this forcefield.

  • filename (str) – Filename prefix to use for both files

  • mapping (Mapping) – CG Mapping object

  • bonds (Iterable[Bond]) – CG Bonds object

static bond_section(bonds, section_header, multiplicity=None)[source]

Populate an RTP bond/angle/dihedral section.

  • bonds (iterable[Bond]) – Iterable of bonds to add to RTP

  • section_header (str) – RTP section header i.e. “bonds”/”angles”/”dihedrals”

  • multiplicity (int) – Multiplicity of dihedral, default is None

Return List[str]

Lines to add to RTP file

static needs_terminal_entries(mol_name, bondset)[source]
static write_rtp(mapping, bonds)[source]

Return lines of a GROMACS RTP file.

This file defines the residues present in the forcefield and allows pdb2gmx to be used.

  • mapping (Mapping) – AA->CG mapping from which to collect molecules

  • bonds (BondSet) – BondSet from which to collect bonds

Return (list[str], set[str], set[str], set[str])

List of lines for RTP file, Set of residues requiring N terminal records, Set of residues requiring C terminal records,

static write_r2b(n_terms, c_terms)[source]

Return lines of a GROMACS R2B file.

This file defines names used for chain terminal records for PDB2GMX.

  • n_terms (Iterable[str]) – Set of molecule names requiring N terminal records

  • c_terms (Iterable[str]) – Set of molecule names requiring C terminal records

Return List[str]

Lines of R2B file