PubChemPy
PubChemPy copied to clipboard
Is it possible to get 3D coordinates of ligand using CID or SID?
Is it possible to get 3D coordinates of ligand using CID or SID?
Approach-1
import pubchempy as pcp
pcp.download('SDF', '4369521.sdf', 4369521, 'cid',overwrite=True)
Approach-2
c = pcp.Compound.from_cid(4369521)
coords = [(c.x, c.y, c.z) for c in c.atoms]
print(coords)
In both solutions above, they give the result in 2 dimensions (2D).
I get an error when I try a code like below
import pubchempy as pcp
pcp.download('SDF', '4369521.sdf', 4369521, 'cid',overwrite=True, record_type = '3d')
I'm sure this topic will be useful for this highly sought-after question on the internet.
I am also facing the same issue. Did you happen to resolve it?