utilities.iotools submodule

cg_openmm.utilities.iotools.get_positions_from_pdbfile(filename)[source]

Reads the positions from a PDB file.

Parameters

filename (str) – Path to the file where we will read PDB coordinates.

Returns

  • positions ( Quantity() ( np.array( [cgmodel.num_beads,3] ), simtk.unit ) ) - Positions for the particles in the PDB file.

cg_openmm.utilities.iotools.get_topology_from_pdbfile(filename)[source]

Reads the positions from a PDB file.

Parameters

filename (str) – Path to the file where we will read PDB coordinates.

Returns

  • topology ( Topology() ) - OpenMM Topology() object, which stores bonds, angles, and other structural attributes of the coarse grained model

cg_openmm.utilities.iotools.read_mm_energies(openmm_data_file)[source]

Read the energies from an OpenMM data file.

Parameters

openmm_data_file (str) – The path to an OpenMM data file (CSV format)

Returns

  • energies ( np.array( float * simtk.unit ) ) - An array containing all data in ‘openmm_data_file’

cg_openmm.utilities.iotools.read_pdbfile(cgmodel, filename)[source]

Reads the positions and topology from a PDB file.

Parameters
  • cgmodel (class) – CGModel() class object

  • filename (str) – Path to the file where we will read PDB coordinates.

Returns

  • cgmodel - A CGModel() class object with the positions and topology from the PDB file that was read.

cg_openmm.utilities.iotools.write_bonds(CGModel, pdb_object)[source]

Writes the bonds from an input CGModel class object to the file object ‘pdb_object’, using PDB ‘CONECT’ syntax.

Parameters
  • CGModel (class) – CGModel() class object

  • pdb_object (file) – File object to which we will write the bond list

cg_openmm.utilities.iotools.write_pdbfile_without_topology(CGModel, filename, energy=None)[source]

Writes the positions from an input CGModel class object to the file ‘filename’.

Parameters
  • CGModel (class) – CGModel() class object

  • filename (str) – Path to the file where we will write PDB coordinates.

  • energy – Energy to write to the PDB file, default = None