Questions tagged [rdkit]

RDKit is a popular open-source library for chemoinformatics and machine learning applied to chemoinformatics.

RDKit is a popular open-source library for chemoinformatics and machine learning applied to chemoinformatics.

251 questions
1
vote
1 answer

python argument error when processing SMILES data in rdkit

from rdkit import Chem mol = Chem.MolFromSmiles(r""" CCC(CC)COC(=O)[C@H](C)N[P@](=O)(OC[C@H]1O[C@](C#N)([C@H](O)[C@@H]1O)C1=CC=C2N1N=CN=C2N)OC1=CC=CC=C1""") functional_group = Chem.MolFromSmarts('[CX3](=[OX1])[OX2][CX3](=[OX1])') matches =…
1
vote
1 answer

Which RDKit fingerprint corresponds to the ECFP4 fingerprint

I do have two questions about the Morgan fingerprint function of RDKit. I couldn't figure out whether a Morgan fingerprint with the radius 2 or 4 corresponds to the ECFP4. Furthermore I couldn't figure out, why the calculated similarity between two…
Philipp O.
  • 41
  • 1
  • 4
1
vote
1 answer

Rdkit Mol object getProp("_Name") is empty. How to get ID?

So I have been looking through the documentation but couldn't find anything relevant. In the SDF file, Chembl name is empty but I do have entry on the chembl ID which I want. Here' 15 12 2 0 16 13 1 0 17 10 1 0 18 16 2 0 19 16 1 0 20…
A. Navid
  • 11
  • 2
  • 3
1
vote
1 answer

How can I interpret the features obtained from Chem.RDKFingerprint(mol)

I have done the following to obtain the fingerprint from mol file. By converting fp.ToBitString() gives me a vector of length 2048. When I count the 1's are the same as the number of atoms in a molecule. How can we interpret this vector? Any…
hemanta
  • 1,405
  • 2
  • 13
  • 23
1
vote
2 answers

How to replace Hydrogen atom with another atom using RDKit?

Assume that I have a molecule as below. smile = 'C(CN)SS' mol = Chem.MolFromSmiles(smile) As can be seen, N has two Hydrogen atoms and S has one Hydrogen atom. I would like to replace those Hydrogens with Carbon. I can find neighbor atoms by the…
Mohammad
  • 775
  • 1
  • 14
  • 37
1
vote
1 answer

How to use sysargv module in vs code?

I've been trying to filter database of molecules based on their strucutre similaritsy to reference molecules, but the script is not working because od warning 'An exception has occurred, use %tb to see the full traceback.' I'm using jupyter notebook…
rosana
  • 15
  • 2
1
vote
2 answers

Why do we have to append path for Rdkit in Google Colab

!chmod +x Miniconda3-py37_4.8.3-Linux-x86_64.sh !time bash ./Miniconda3-py37_4.8.3-Linux-x86_64.sh -b -f -p /usr/local !time conda install -q -y -c conda-forge rdkit import sys sys.path.append('/usr/local/lib/python3.7/site-packages/') In this…
Arham Shah
  • 61
  • 1
  • 6
1
vote
1 answer

How to create a Spark dataframe to feed to sparks random forest implementation from a list of np.arrays (generated by RDKit)?

I am trying to generate molecular descriptors using RDKit and then perform machine learning on them all using Spark. I have managed to generate the descriptors and I have found the following code for doing Random Forest. That code loads the…
jonalv
  • 5,706
  • 9
  • 45
  • 64
1
vote
3 answers

Is there any way to convert Morgan fingerprint into a way I can figure out what molecule it is?

I am working with RDKIT and am using an algorithm to randomly generate Morgan fingerprints all 2048 bits. I am wondering if there’s a way to trace back the fingerprint to somehow figure out what molecule it is, whether it’s a smiles string, name,…
Me4836
  • 42
  • 5
1
vote
1 answer

AttributeError: 'Image' object has no attribute 'save'

I am following the basic tutorial for RDKit. p = Chem.MolFromSmiles('[nH]1cnc2cncnc21') subms = [x for x in ms if x.HasSubstructMatch(p)] len(subms) AllChem.Compute2DCoords(p) for m in subms: AllChem.GenerateDepictionMatching2DStructure(m,p) …
Michael
  • 47
  • 2
  • 5
1
vote
3 answers

RDKit: How to change the atom label fontsize?

When drawing structures with RDKit, the atom label font size and the ring size are not in a good proportion. The labels are either too small or too large or misaligned. Unfortunately, the documentation about this is meager. I found…
theozh
  • 22,244
  • 5
  • 28
  • 72
1
vote
1 answer

Bioisosteric replacement using SMARTS (KNIME and RDKit)

I am trying to create a KNIME workflow that would accept a list of compounds and carry out bioisosteric replacements (we will use the following example here: carboxylic acid to tetrazole) automatically. NOTE: I am using the following workflow as…
1
vote
2 answers

Calculate descriptors with RDkit

I am trying to calculate all the descriptors (both 2D/3D) for a list of molecules with RDkit in python. When I run: MolecularDescriptorCalculator.CalcDescriptors(mol, simplelist) it returns: AttributeError: 'Mol' object has no attribute…
Giulia
  • 11
  • 1
  • 2
1
vote
0 answers

Python read() returns empy string unless time.sleep(0.1) is called

I'm using the rdkit Chem library to create an svg file: Draw.MolToFile(mol, path, size=(400, 400)) It usually works fine when I read it like so: with open(path) as myfile: image = myfile.read() Other times it will return an empty string unless…
G Smith
  • 53
  • 1
  • 9
1
vote
1 answer

Rdkit Drawing - Hide (not remove) Hydrogens

I am trying to highlight carbon positions in a test molecule while hiding the implicit hydrogens. This is unexpectedly complicated, as I have two compounding problems which each have a solution, but are incompatible. from rdkit import Chem from…
Jmegan042
  • 251
  • 5
  • 15