If you can use python, rdkit is a great package for cheminformatics —best installed via conda though.
It allows you do all sorts of things, such as match substructures, embed conformers, edit compounds, compute advanced parameters and many forms of shape & colour finger-/foot-printings.
Given a multi-compound sdf you can read each individual molecule and write them out as PDBs.
from rdkit import Chem
with i, mol in enumerate(Chem.SDMolSupplier('in.sdf')):
Chem.MolToPDBFile(f'out_{i}.pdb')
We can be fancier with the output name
from rdkit import Chem
import re
with mol in Chem.SDMolSupplier('in.sdf'):
# The headerline of a mol file is retrieved oddly.
name = mol.GetProp('_Name')
# make filename safe
slugify = lambda name: re.sub(r'[\W_.-]+', '-', name)
Chem.MolToPDBFile(f'{slugify(name)}.pdb')
To specify what name (e.g.CA) each atom gets and what is the residue name, chain and residue position —information absent in the sdf, it gets a bit odd.
names = [' CA ', ' CB ', ' CG ', ' CD '] # say
for i, atom in enumerate(mol.GetAtoms()):
info = Chem.AtomPDBResidueInfo(names[i], # or whatever.
residueName='LIG')
If you can use python, rdkit is a great package for cheminformatics —best installed via conda though.
It allows you do all sorts of things, such as match substructures, embed conformers, edit compounds, compute advanced parameters and many forms of shape & colour finger-/foot-printings.
Given a multi-compound sdf you can read each individual molecule and write them out as PDBs.
from rdkit import Chemwith i, mol in enumerate(Chem.SDMolSupplier('in.sdf')): Chem.MolToPDBFile(f'out_{i}.pdb')
We can be fancier with the output name
from rdkit import Chemimport rewith mol in Chem.SDMolSupplier('in.sdf'): # The headerline of a mol file is retrieved oddly. name = mol.GetProp('_Name') # make filename safe slugify = lambda name: re.sub(r'[\W_.-]+', '-', name) Chem.MolToPDBFile(f'{slugify(name)}.pdb')
To specify what name (e.g.CA) each atom gets and what is the residue name, chain and residue position —information absent in the sdf, it gets a bit odd.
names = [' CA ', ' CB ', ' CG ', ' CD '] # say for i, atom in enumerate(mol.GetAtoms()): info = Chem.AtomPDBResidueInfo(names[i], # or whatever. residueName='LIG')
is an example filename —the quotes must be there or it will think it a variable. If you are unfamiliar with python this route is probably not the best way.More
Use OpenBabel.
Something like
babel -isdf file_in.sdf -opdb file_out.pdb.Use OpenBabel.
Something like
babel -isdf file_in.sdf -opdb file_out.pdb.More
VOTE
If you can use python,
rdkitis a great package for cheminformatics —best installed via conda though.It allows you do all sorts of things, such as match substructures, embed conformers, edit compounds, compute advanced parameters and many forms of shape & colour finger-/foot-printings.
Given a multi-compound sdf you can read each individual molecule and write them out as PDBs.
We can be fancier with the output name
To specify what name (e.g.
CA) each atom gets and what is the residue name, chain and residue position —information absent in the sdf, it gets a bit odd.For more see this blog post.
If you can use python,
rdkitis a great package for cheminformatics —best installed via conda though.It allows you do all sorts of things, such as match substructures, embed conformers, edit compounds, compute advanced parameters and many forms of shape & colour finger-/foot-printings.
Given a multi-compound sdf you can read each individual molecule and write them out as PDBs.
We can be fancier with the output name
To specify what name (e.g.
CA) each atom gets and what is the residue name, chain and residue position —information absent in the sdf, it gets a bit odd.For more see this blog post.
More
VOTE
VOTE
VOTE
VOTE
VOTE
VOTE