Hi Brian,

The Deprotect function will apply any number of deprotections that are
stored as the DeprotectData (see rdkit.Chem.rdDeprotect.GetDeprotections()
to get the list). In your case, you can set up a custom DeprotectData
deprotection:

from rdkit.Chem.rdDeprotect import DeprotectData



> # Set up the deprotection
> reaction_class = "hydrolysis"
> reaction_smarts = "[CX4;H3][O][C:1][O][CX4;H3]>>[C:1]=[O]"
> abbreviation = "(OMe)2"
> full_name = "dimethylacetal"
> data = DeprotectData(reaction_class, reaction_smarts, abbreviation,
> full_name)
> assert data.isValid()


data is now an instance of DeprotectData, which you can pass into the
Deprotect function along with your example molecule:

# get an example ketal
> mol = Chem.MolFromSmiles('COC1(CCCCC1)OC')


# make the call to get the transformed molecule, in this case, cyclohexanone
> result = rdkit.Chem.rdDeprotect.Deprotect(mol, deprotections=[data]) #
> pass in your newly created deprotection wrapped in a list


If you're only trying to apply a single chemical reaction, you could just
create a ChemicalReaction to achieve the same result:


> from rdkit.Chem import rdChemReactions
>
> # Set up your chemical reaction
> reaction_smarts = "[CX4;H3][O][C:1][O][CX4;H3]>>[C:1]=[O]"
> rxn = rdChemReactions.ReactionFromSmarts(reaction_smarts)
>
> # Run your chemical reaction on your molecule
> mol = Chem.MolFromSmiles('COC1(CCCCC1)OC')
> products = rxn.RunReactants((mol,)) # make sure you're passing a tuple
>

Hope this points you in the right direction.

Best,

Kangway Chuang, Ph. D. (he/him/his)
Senior AI Scientist and Group Lead
AI | ML Department in Research Biology
Genentech Research and Early Development
+1 (805) 754-0058
chuang.kang...@gene.com


On Wed, Mar 2, 2022 at 3:58 PM Bennion, Brian via Rdkit-discuss <
rdkit-discuss@lists.sourceforge.net> wrote:

> Hello All,
>
> I have poking about the docs and some emails trying to find a way to
> deprotect a group compounds.
> The docs describe the DeprotectData module but I am not making the
> connection to how that will operate on my molecules.
>
> my tentative smarts is here
> [CX4;H3][O][C:1][O][CX4;H3]>>[C:1]=[O]
>
> I was able to access the function and assert the "dataIsValid" for the
> example case.  So I am just missing that next and maybe last step where I
> can deprotect a list of compounds with this module.
>
> Thank you
> brian
>
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to