Re: [Rdkit-discuss] Fragmentation Help
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Paolo T. <pao...@gm...> - 2019-11-17 19:53:32
|
Hi Ben,
you could use SMARTS queries to do that, e.g.:
from rdkit import Chem
from rdkit.Chem.Draw import IPythonConsole
RDKit WARNING: [19:50:41] Enabling RDKit 2020.03.1dev1 jupyter extensions
sucrose = "O1[C@H](CO)[C@@H](O)[C@H](O)[C@@H](O)[C@H]1O[C@@]2(O[C@@H]([C@@H](O)[C@@H]2O)CO)CO"
sucrose_mol = Chem.MolFromSmiles(sucrose)
sucrose_mol
primary_alcohol = Chem.MolFromSmarts("[CH2][OH1]")
sucrose_mol.GetSubstructMatches(primary_alcohol)
((2, 3), (19, 20), (21, 22))
secondary_alcohol = Chem.MolFromSmarts("[CH1][OH1]")
sucrose_mol.GetSubstructMatches(secondary_alcohol)
((4, 5), (6, 7), (8, 9), (15, 16), (17, 18))
I hope this helps, cheers
p.
On 16/11/2019 22:02, Ben Davidson wrote:
> Hi, I am using RDKit to basically identify the oxygenated groups in
> complex biomass. The ether, ester, ketone, and aldehyde getfrag
> commands are amazing. I am wondering if it is possible to identify the
> different types of alcohols in a molecule ie, primary, secondary, and
> finally tertiary. For example in sucrose, there are 8 alcohols, 5
> secondary and 3 primary, is it possible to have RDKit identify that
> for me? if you would like to see any code feel free to email me at
> dav...@gm... <mailto:dav...@gm...>
> Any help would be greatly appreciated.
> -Ben
>
>
> _______________________________________________
> Rdkit-discuss mailing list
> Rdk...@li...
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
|