Subtracting the MCS to the Original Molecule

Hello all,

I got stuck by trying to implement an automated way to subtract the MCS derived by the comparison between reactants and product to the product molecule. I summarize briefly what I am doing as follows:

1. Reaction SMILES is separated in Reactant and Product.

2. Reactant and Product and renamed as Molecule and they are concatenated to form a list;

3. SMILES are converted into RDKit and RDKit MCS is performed. As result, the MCS substructure is obtained in SMARTS format.

4. Now I would like to subtract this substructure to the product structure to obtain the rest of the fragments but I don't know how to perform this in an automated way.

Can you gently help me?

 

I think that the RDKit Chemical Reaction node may help with your workflow.