Hetero shuffle and halogen replacement of molecule #RDKit #Chemoinformatics

I posted comparison of rdChemReactions and EditableMol before. In the post I wrote rdChemReaction could not keep position of original molecule. But…. It is due to my wrong query.

Today I checked some function of RDKit. I tried to replace aromatic carbon to nitrogen and replace hydrogen which is attached aromatic carbon to fluorine and checked their position.

The code is below.

You can see today’s my code keeps geometry both replace aromatic carobon and replace hydrogen to fluorine case.

I would like to learn reaction grammar ASAP. It is very important for chemoirnfomatics!