answerstu

RDKIT: Find Substructure Atom Coordinates

I have imported a molecule as a .mol file into rdkit.The molecule contains a CN=NC substructure.I wish to find the coordinates of the CN=NC substructure.I have tried using Chem.MolToBlock(molfile) to list the 3D coordinates; however, this returns the 3D coordinates of the entire molecule.The basis of my code has been:molecule = rdkit.Chem.MolFromMolFile('molfile')query = rdkit.Chem.MolFromSmiles('CN=NC')`subatomids = m.GetSubstructMatch(q)However, I do not know if there is a simple way to return the coordinates of the specific atomsThe ideal re...Read more

How to protonate a molecule in rdkit?

I m tring to present the workflow for the positive ion ESI mass spectra, based on the fragmentation of [M+H]+ ions. I want to simulate the ionisation by the addition of one proton to heteroatoms. For example, from rdkit.Chem import AllChemfrom rdkit.Chem.Draw import rdMolDraw2Dfrom IPython.display import SVG# read molmol = Chem.MolFromSmiles('O=C(O)C1=CC(=NNC2=CC=C(C=C2)C(=O)NCCC(=O)O)C=CC1=O')# draw the moldr = rdMolDraw2D.MolDraw2DSVG(800,800)dr.SetFontSize(0.3)op = dr.drawOptions()for i in range(mol.GetNumAtoms()) : op.atomLabels[i] = mol.G...Read more

RDKIT: Combine/Add particles

I have a database of macrocycles and covalent organic cages, where I wish to add a molecule/ion into the cavity. I need to do this through RDKIT. Is there an easy method to accomplish this task?For example:from rdkit import AllChemguest = [x_value, y_value, z_value]cage = AllChem.MolFromMolFile('cage_file.mol')cage_guest = cage+guest (along the lines of)I am then hoping to be able to manipulate the cage_guest in the usual fashion....Read more