PubChemPy icon indicating copy to clipboard operation
PubChemPy copied to clipboard

Is it possible to get 3D coordinates of ligand using CID or SID?

Open drorhunvural opened this issue 2 years ago • 1 comments

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.

drorhunvural avatar Dec 19 '22 23:12 drorhunvural

I am also facing the same issue. Did you happen to resolve it?

manassharma07 avatar Nov 03 '23 12:11 manassharma07