Open ben-ikt opened 1 year ago
Thanks for the request @ben-ikt, I would tend to say this isn't possible at the moment, but to be honest there are a few things I'm not sure of:
get_mol
using a molfile containing 3D coordinates, and then you would be able to retrieve it back calling get_molblock
on the molecule object, but that would essentially give you back the original molfile, which contained the 3D coordinates in the first place. We can continue the convo here if you have further questions after reading this, otherwise let me know and we'll close this.
I'm running in the same limitation. In Python I'm able to generate 3D coordinates from an InChI or SMILES string:
mol_rdkit = Chem.MolFromSmiles(smiles)
mol_rdkit = Chem.AddHs(mol_rdkit) # Add explicit hydrogen atoms
Chem.rdDistGeom.EmbedMolecule(mol_rdkit) # Embed 3D coordinates
sdf = Chem.MolToMolBlock(mol_rdkit) # Generate SDF
Then in the frontend I render the 3D molecule based on the SDF coordinates.
I'm trying to move this logic into the frontend so I can render the molecule without having to wait for the slow API, but this doesn't seem possible due to lacking 3D coordinates.
IN JS this looks like:
const rdkMol = window.RDKit.get_mol(smiles)
rdkMol.add_hs() // Add explicit hydrogen atoms
// No way to embed 3D coordinates
const sdf = rdkMol.get_molblock() // Generate SDF
So, to be concrete, is a JS equivalent for Chem.rdDistGeom.EmbedMolecule
not a priority or not possible?
Is your feature request related to a problem? Please describe. I want to display a molecule in 3D via ThreeJS and the PDBLoader.
Describe the solution you'd like Be able to get 3D coordinates.