private static IAtomContainer initiateIonization ( IAtomContainer container , IAtom atom ) throws CDKException { IReactionProcess reactionNBE = new ElectronImpactNBEReaction ( ) ; IAtomContainerSet setOfReactants = container . getBuilder ( ) . newInstance ( IAtomContainerSet . class ) ; setOfReactants . addAtomContainer ( container ) ; atom . setFlag ( CDKConstants . REACTIVE_CENTER , true ) ; List < IParameterReact > paramList = new ArrayList < IParameterReact > ( ) ; IParameterReact param = new SetReactionCenter ( ) ; param . setParameter ( Boolean . TRUE ) ; paramList . add ( param ) ; reactionNBE . setParameterList ( paramList ) ; /* initiate */ IReactionSet setOfReactions = reactionNBE . initiate ( setOfReactants , null ) ; atom . setFlag ( CDKConstants . REACTIVE_CENTER , false ) ; if ( setOfReactions != null && setOfReactions . getReactionCount ( ) == 1 && setOfReactions . getReaction ( 0 ) . getProducts ( ) . getAtomContainerCount ( ) == 1 ) return setOfReactions . getReaction ( 0 ) . getProducts ( ) . getAtomContainer ( 0 ) ; else return null ; }
Initiate the reaction ElectronImpactNBE .