mstk.topology.Pdb

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

Generate Topology from PDB file.

Atom name, residue information, unit cell and positions are parsed. The atom name colume will be used as both atom name and atom type. The connectivity is parsed if CONECT section is provided in the PDB file.

Only the first frame will be considered.

Parameters:
  • file (str) –

  • split_molecule (str) – Can be ‘residue’, ‘whole’, ‘bond’ or ‘auto’. Default is ‘auto’. If set to ‘residue’, each residue will be parsed as a molecule. It works only if there is no inter-residue bonds. If set to ‘whole’, all the atoms will be put into one molecule. If set to ‘bond’, the atoms will be grouped into molecules based on connectivity. if set to ‘auto’, it will try ‘residue’ first. If there’s inter-residue connectivity, will use ‘whole’ instead.

topology
Type:

Topology

Examples

>>> pdb = Pdb('input.pdb')
>>> topology = pdb.topology
>>> Pdb.save_to(topology, 'output.pdb')

Methods

__init__(file, **kwargs)

save_to(top, file, **kwargs)

Save topology into a PDB file

static save_to(top, file, **kwargs)

Save topology into a PDB file

Parameters: