Aside: Being able to get SVG output from Draw.MolsToGridImage() is another new feature in the 2016.03.1 release. There's another post about this stuff.

And the products:

In [4]:

ps=rxn.RunReactants(reactants)ps[0][0]

Out[4]:

NHOFFF

Ok, those were the basics that have been around for a while.

One of the new additions is ChemicalReaction.RunReactant(), this carries out whatever manipulations are required to process just one of the reaction's reactants and add it to the products:

In [5]:

p0s=rxn.RunReactant(reactants[0],0)p0s[0][0]

Out[5]:

NHOFFF

In [6]:

p1s=rxn.RunReactant(reactants[1],1)p1s[0][0]

Out[6]:

NH

The molecules resulting from ChemicalReaction.RunReactant() carry some additional information that allow them to be reduced to just the part that is added to the product. This can be accessed with the function ReduceProductToSideChains(), which can either add a dummy to show where the attachment occurs:

In [7]:

AllChem.ReduceProductToSideChains(p0s[0][0],addDummyAtoms=True)

Out[7]:

OFFF*:5

The atom-map number on the dummy atom is the mapping number of the product atom it is connected to.

The dummy can also be left out:

In [8]:

AllChem.ReduceProductToSideChains(p0s[0][0],addDummyAtoms=False)

Out[8]:

OFFF

Here's the same thing for the second reactant:

In [9]:

AllChem.ReduceProductToSideChains(p1s[0][0],addDummyAtoms=True)

Out[9]:

*:11

In [10]:

AllChem.ReduceProductToSideChains(p1s[0][0],addDummyAtoms=False)

Out[10]:

You can also apply this function to the products of the full reaction:

In [11]:

AllChem.ReduceProductToSideChains(ps[0][0],addDummyAtoms=True)

Out[11]:

OFFF*:5*:11

Let's look at another ring-forming reaction, the Friedlaender reaction:

This points to an oddity (of sorts) in the reaction definition. The reaction SMARTS requires a primary N connected to a six-membered aromatic carbocycle, but all of the atoms from that carbocycle are not mapped. There's nothing per-se wrong with this, but it's not especially compatible with the idea of sidechains that we're using here.

We can rewrite the reaction SMARTS and produce something equivalent that's a bit more intuitive in this analysis: