private void parseRxnCXSMILES ( String title , IReaction rxn ) { CxSmilesState cxstate ; int pos ; if ( title != null && title . startsWith ( "|" ) ) { if ( ( pos = CxSmilesParser . processCx ( title , cxstate = new CxSmilesState ( ) ) ) >= 0 ) { // set the correct title rxn . setProperty ( CDKConstants . TITLE , title . substring ( pos ) ) ; final Map < IAtom , IAtomContainer > atomToMol = new HashMap <> ( 100 ) ; final List < IAtom > atoms = new ArrayList <> ( ) ; handleFragmentGrouping ( rxn , cxstate ) ; // merge all together for ( IAtomContainer mol : rxn . getReactants ( ) . atomContainers ( ) ) { for ( IAtom atom : mol . atoms ( ) ) { atoms . add ( atom ) ; atomToMol . put ( atom , mol ) ; } } for ( IAtomContainer mol : rxn . getAgents ( ) . atomContainers ( ) ) { for ( IAtom atom : mol . atoms ( ) ) { atoms . add ( atom ) ; atomToMol . put ( atom , mol ) ; } } for ( IAtomContainer mol : rxn . getProducts ( ) . atomContainers ( ) ) { for ( IAtom atom : mol . atoms ( ) ) { atoms . add ( atom ) ; atomToMol . put ( atom , mol ) ; } } assignCxSmilesInfo ( rxn . getBuilder ( ) , rxn , atoms , atomToMol , cxstate ) ; } } }
Parses CXSMILES layer and set attributes for atoms and bonds on the provided reaction .