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’, ‘atom’, ‘whole’. Default is ‘residue’. If set to ‘residue’, the topology will be split into molecules based on the bonds between residues. If set to ‘whole’, all the atoms will be put into one molecule. If set to ‘atom’, the topology will be split into molecules based on the bonds between atoms.
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