You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Is it possible to access bond orders from a protein structure via a pdb file, as interpreted by pdbfixer? Do topology objects from a pdb file (without any other input files) infer bond order at all?
Here's a minimal example of what I'm missing:
import requests
from io import BytesIO
import pdbfixer
def getPDB(code):
out = requests.get(f'https://files.rcsb.org/download/{code}.pdb')
f = open(f'{code}.pdb', 'w')
f.write(out.content.decode('utf8'))
code='3udn'
pdb_string = getPDB('code')
fixer = PDBFixer(filename=f'{code}.pdb')
fixer.findMissingResidues()
fixer.findNonstandardResidues()
fixer.replaceNonstandardResidues()
fixer.removeHeterogens(True)
fixer.findMissingAtoms()
fixer.addMissingAtoms()
fixer.addMissingHydrogens(7.0)
for bond in fixer.topology.bonds():
print(bond.order)
This prints None for every bond.
The end goal here is to use pdbfixer to read a PDB, generate atom and bonding information, and then port the bonding information into an RDKit RWMol object. RDKit assumes single bonds when creating a molecule bond-by-bond, but it can of course make double bonds - if I knew when to specify them, that is!
Thanks
lew
The text was updated successfully, but these errors were encountered:
PDB files don't contain any information about bond order. RDKit can load a PDB file directly, and it will attempt to infer bond order. But be aware that it doesn't always get everything right! You can also use Open Babel to load a PDB file and infer bond orders, but it too makes mistakes. I recently encountered this exact problem, and I didn't come up with any entirely satisfactory general solution.
Hi,
Is it possible to access bond orders from a protein structure via a pdb file, as interpreted by pdbfixer? Do topology objects from a pdb file (without any other input files) infer bond order at all?
Here's a minimal example of what I'm missing:
This prints
None
for every bond.The end goal here is to use
pdbfixer
to read a PDB, generate atom and bonding information, and then port the bonding information into an RDKitRWMol
object. RDKit assumes single bonds when creating a molecule bond-by-bond, but it can of course make double bonds - if I knew when to specify them, that is!Thanks
lew
The text was updated successfully, but these errors were encountered: