Hi Shani

This should work

rxn = AllChem.ReactionFromSmarts('[C:1]=[C:2]>>[*:1][*+:2]')

m = Chem.MolFromSmiles('CC(C)C1=CC[C@H]2C(=C1)CC[C@@H]3[C@@]2(CCCC3(C)C)C')
ps = rxn.RunReactants((m,))
mols = [x[0] for x in ps]

Best regards, Jan

On 2 Feb 2020, at 11.34, Shani Levi 
<levishan...@gmail.com<mailto:levishan...@gmail.com>> wrote:

Hi,
I would like to create a carbocation "database" from my existing database of 
unsaturated molecules.

The idea is as follows:
For each double bond, I would like to attach one Hydrogen, for each carbon in 
the double bond.
So for example, if I have a molecule with one double bond, I will end up with 
two different carbocations,
if I have a molecule with 2 double bonds, I would like to get 4 different 
carbocations.

I tried using GetSubstructMatch for ('C=C') and SetFormalCharge to 1.
e.g:
mol = Chem.MolFromSmiles('CC(C)C1=CC[C@H]2C(=C1)CC[C@@H]3[C@@]2(CCCC3(C)C)C')
func = Chem.MolFromSmiles('C=C')
matches = mol.GetSubstructMatches(func)
mol.GetAtomWithIdx(matches[0][1]).SetFormalCharge(1)

The result is:
CC(C)C1=[C+]C[C@H]2C(=C1)CC[C@H]1C(C)(C)CCC[C@@]12C

I would like to get rid of the double bond.
(and get CC(C)C1[C+]C[C@H]2C(=C1)CC[C@H]1C(C)(C)CCC[C@@]12C )

How can I do that?

Thanks a lot in advance,
Shani

_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net<mailto: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