private static void createIDsForReaction ( IReaction reaction , List < String > tabuList ) { if ( tabuList == null ) tabuList = ReactionManipulator . getAllIDs ( reaction ) ; if ( null == reaction . getID ( ) ) { // generate new ID reactionCount = setID ( REACTION_PREFIX , reactionCount , reaction , tabuList ) ; } if ( policy == OBJECT_UNIQUE_POLICY ) { // start atom and bond indices within a reaction set always from 1 atomCount = 0 ; bondCount = 0 ; } for ( IAtomContainer reactant : reaction . getReactants ( ) . atomContainers ( ) ) { createIDsForAtomContainer ( reactant , tabuList ) ; } for ( IAtomContainer product : reaction . getReactants ( ) . atomContainers ( ) ) { createIDsForAtomContainer ( product , tabuList ) ; } Iterator < IAtomContainer > agents = reaction . getAgents ( ) . atomContainers ( ) . iterator ( ) ; while ( agents . hasNext ( ) ) { createIDsForAtomContainer ( ( IAtomContainer ) agents . next ( ) , tabuList ) ; } }
Labels the reactants and products in the Reaction m1 m2 etc and the atoms accordingly when no ID is given .