Thanks Christopher.
I will try that.

Best,
Ming

On Sun, May 15, 2022 at 12:40 AM Christopher Mayer-Bacon <cmaye...@umbc.edu>
wrote:

> Ming,
> I’m not at my computer now, but I think you may be better served with
> using the reaction functionality instead of replacing substructures via
> ReplaceSubstructs.  You can probably create a reaction SMARTS string for
> converting a generic ester to a generic disulfide (
> https://www.daylight.com/dayhtml/doc/theory/theory.smarts.html).
>
> On Sun, May 15, 2022 at 12:31 AM Ming Hao <haom.ni...@gmail.com> wrote:
>
>> Hi All,
>>
>> I want to replace the ester structure ('COC(C)=O') with disulfide ('CSSC')
>>
>> [image: image.png]
>>
>> Here is what I did, but it does not work. It seems to need specified
>> methods to replace the original structure with the new one, not just put
>> individual SMILES there.
>>
>> ##############################################################
>> from rdkit import Chem
>> from rdkit.Chem import AllChem, Draw
>> from rdkit.Chem.Draw import IPythonConsole
>>
>> orgsmi = 'CCOC(=O)CCCCCN(CC)CCCCCCCC(=O)OC(C)CC'
>> m = Chem.MolFromSmiles(orgsmi)
>> m
>>
>> pat = Chem.MolFromSmiles('COC(C)=O')
>> pat
>>
>> rep = Chem.MolFromSmiles('CSSC')
>> rep
>>
>> new = AllChem.ReplaceSubstructs(m, pat, rep)
>> new[0] # The structure was separated
>> new[1]  # The structure was separated
>> len(new)
>> #################################################################
>>
>> Can you help me with this? By the way, I have 10K structures, and first I
>> need to find the compounds with the pattern (ester, COC(C)=O) and replace
>> them with disulfide ('CSSC'). What is a good way to do this?
>>
>> Thanks.
>> Ming
>>
> _______________________________________________
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
>> --
> -Christopher Mayer-Bacon (*he/him/his*)
> PhD student
> Department of Biological Sciences
> University of Maryland, Baltimore County
>
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to