@@ -108,16 +108,13 @@ public class Reactor extends AbstractReactor implements Serializable {
108108 boolean partialMapping ,
109109 IMappingAlgorithm algorithm )
110110 throws Exception {
111- //SmilesGenerator smiles = new SmilesGenerator(SmiFlavor.Unique | SmiFlavor.UseAromaticSymbols | SmiFlavor.AtomAtomMap);
112111 if (partialMapping ) {
113112 //else CDKToBeam throws an error "Aromatic bond connects non-aromatic atomic atoms"
114113 smiles = new SmilesGenerator (
115- //SmiFlavor.Unique|
116114 SmiFlavor .AtomAtomMap
117115 | SmiFlavor .Stereo );
118116 } else {
119117 smiles = new SmilesGenerator (
120- //SmiFlavor.Unique|
121118 SmiFlavor .UseAromaticSymbols
122119 | SmiFlavor .AtomAtomMap
123120 | SmiFlavor .Stereo );
@@ -242,9 +239,6 @@ private void expandReaction() throws CloneNotSupportedException {
242239 reactionWithUniqueSTOICHIOMETRY .setDirection (reactionWithSTOICHIOMETRY .getDirection () == null
243240 ? BIDIRECTIONAL
244241 : reactionWithSTOICHIOMETRY .getDirection ());
245- //
246- // System.out.println("ExpandedEduct Count: " + reactionWithUniqueSTOICHIOMETRY.getReactantCount()
247- // + ", ExpandedProduct Count: " + reactionWithUniqueSTOICHIOMETRY.getProductCount());
248242
249243 LabelAtoms ();
250244 BondCollection ();
@@ -253,15 +247,13 @@ private void expandReaction() throws CloneNotSupportedException {
253247 private void LabelAtoms () {
254248 int new_atom_rank_index_reactant = 1 ;
255249 int new_atom_rank_index_product = 1 ;
256- // System.out.println("----------------------------");
257250 for (int i = 0 ; i < reactionWithUniqueSTOICHIOMETRY .getReactantCount (); i ++) {
258251 IAtomContainer container = reactionWithUniqueSTOICHIOMETRY .getReactants ().getAtomContainer (i );
259252 for (int k = 0 ; k < container .getAtomCount (); k ++) {
260253 String counter = (substrateAtomCounter ).toString ();
261254 substrateAtomCounter += 1 ;
262255 IAtom atom = container .getAtom (k );
263256 atom .setID (counter );
264- // System.out.println("EAtom: " + k + " " + atom.getSymbol() + " Rank Atom: " + atom.getProperty("OLD_RANK") + " " + " Id: " + atom.getID());
265257 rLabelledAtoms .put (atom .hashCode (), i );
266258 if (atom .getProperty ("OLD_RANK" ) != null ) {
267259 inputRankLabelledAtomsReactant .put ((int ) atom .getProperty ("OLD_RANK" ), (new_atom_rank_index_reactant ++));
@@ -271,15 +263,13 @@ private void LabelAtoms() {
271263 educts .put (i , container );
272264 }
273265
274- // System.out.println("+++++++++++++++++");
275266 for (int j = 0 ; j < reactionWithUniqueSTOICHIOMETRY .getProductCount (); j ++) {
276267 IAtomContainer container = reactionWithUniqueSTOICHIOMETRY .getProducts ().getAtomContainer (j );
277268 for (int k = 0 ; k < container .getAtomCount (); k ++) {
278269 String counter = (productAtomCounter ).toString ();
279270 productAtomCounter += 1 ;
280271 IAtom atom = container .getAtom (k );
281272 atom .setID (counter );
282- // System.out.println("PAtom: " + k + " " + atom.getSymbol() + " Id: " + atom.getID());
283273 pLabelledAtoms .put (atom .hashCode (), j );
284274 if (atom .getProperty ("OLD_RANK" ) != null ) {
285275 inputRankLabelledAtomsProduct .put ((int ) atom .getProperty ("OLD_RANK" ), (new_atom_rank_index_product ++));
@@ -321,7 +311,6 @@ private void checkReactionBalance() throws IOException {
321311 while (rAtomIterator .hasNext ()) {
322312 IAtom rAtom = rAtomIterator .next ();
323313 if (!rAtom .getSymbol ().equals ("H" )) {
324- // System.out.println("E: " + rAtom.getSymbol());
325314 if (AtomMap .containsKey (rAtom .getSymbol ())) {
326315 int count = AtomMap .get (rAtom .getSymbol ()) + 1 ;
327316 AtomMap .put (rAtom .getSymbol (), count );
@@ -338,7 +327,6 @@ private void checkReactionBalance() throws IOException {
338327 while (pAtomIterator .hasNext ()) {
339328 IAtom pAtom = pAtomIterator .next ();
340329 if (!pAtom .getSymbol ().equals ("H" )) {
341- // System.out.println("P: " + atomIndex.getSymbol());
342330 if (AtomMap .containsKey (pAtom .getSymbol ())) {
343331 int count = AtomMap .get (pAtom .getSymbol ()) - 1 ;
344332 AtomMap .put (pAtom .getSymbol (), count );
@@ -352,13 +340,11 @@ private void checkReactionBalance() throws IOException {
352340 }
353341
354342 for (Map .Entry <String , Integer > I : AtomMap .entrySet ()) {
355- // System.out.println("A: " + I.getKey() + " V: " + I.getValue());
356343 if (I .getValue () != 0 ) {
357344 this .balanceFlag = false ;
358345 break ;
359346 }
360347 }
361- // System.out.println("Bal: " + balanceFlag);
362348 }
363349
364350 private void calculateAtomAtomMapping () throws IOException , Exception {
@@ -381,8 +367,6 @@ private IReaction getMapping(IReaction coreMappedReaction) throws IOException, C
381367 IReaction mappedReaction = deepClone (reactionWithUniqueSTOICHIOMETRY );
382368 cleanMapping (mappedReaction );
383369
384- // printReaction(mappedReaction);
385-
386370 /*
387371 * This section set the mappingMap ID for the mapped atoms
388372 */
@@ -740,7 +724,6 @@ public int getMappingCount() {
740724 }
741725
742726 private IReaction copyReaction (IReaction orignalReaction , boolean removeHydrogen ) throws Exception {
743- // System.out.println("R size: " + orignalReaction.getReactantCount() + " , " + orignalReaction.getProductCount());
744727 IReaction copiedReaction = reactionWithUniqueSTOICHIOMETRY .getBuilder ().newInstance (IReaction .class );
745728
746729 for (int i = 0 ; i < orignalReaction .getReactantCount (); i ++) {
@@ -752,13 +735,11 @@ private IReaction copyReaction(IReaction orignalReaction, boolean removeHydrogen
752735 IAtom atom = newMol .getAtom (index );
753736 atom .setProperty ("index" , index );
754737 }
755- // System.out.println("Hydrogen Before" + newMol.getAtomCount());
756738
757739 percieveAtomTypesAndConfigureAtoms (newMol );
758740 if (removeHydrogen ) {
759741 newMol = removeHydrogensExceptSingleAndPreserveAtomID (newMol );
760742 }
761- // System.out.println("Hydrogen After" + newMol.getAtomCount());
762743 copiedReaction .addReactant (newMol , st );
763744 }
764745 for (int i = 0 ; i < orignalReaction .getProductCount (); i ++) {
@@ -770,13 +751,11 @@ private IReaction copyReaction(IReaction orignalReaction, boolean removeHydrogen
770751 IAtom atom = newMol .getAtom (index );
771752 atom .setProperty ("index" , index );
772753 }
773- // System.out.println("Hydrogen Before " + newMol.getAtomCount());
774754
775755 percieveAtomTypesAndConfigureAtoms (newMol );
776756 if (removeHydrogen ) {
777757 newMol = removeHydrogensExceptSingleAndPreserveAtomID (newMol );
778758 }
779- // System.out.println("Hydrogen After " + newMol.getAtomCount());
780759 copiedReaction .addProduct (newMol , st );
781760 }
782761 copiedReaction .setFlags (orignalReaction .getFlags ());
@@ -935,8 +914,6 @@ private IAtom getContainerAtomByID(IAtomContainerSet products, String mappingID)
935914 }
936915
937916 private int setCanonicalMappingLabels (IReaction mappedReaction ) throws CDKException {
938- // ICanonicalMoleculeLabeller cng = new SignatureMoleculeLabeller();
939-
940917 IAtomContainerSet rMolSet = mappedReaction .getReactants ();
941918 IAtomContainerSet pMolSet = mappedReaction .getProducts ();
942919
@@ -1004,7 +981,6 @@ private int setCanonicalMappingLabels(IReaction mappedReaction) throws CDKExcept
1004981 */
1005982 for (IAtom qAtom : mol .atoms ()) {
1006983 if (mappingMap .containsKey (qAtom ) && !qAtom .getSymbol ().equalsIgnoreCase ("H" )) {
1007- // System.out.println("Atom " + qAtom.getSymbol() + " new Rank: " + counter);
1008984 String id = valueOf (counter );
1009985 qAtom .setID (id );
1010986 mappingMap .get (qAtom ).setID (id );
@@ -1021,7 +997,6 @@ private int setCanonicalMappingLabels(IReaction mappedReaction) throws CDKExcept
1021997 */
1022998 for (IAtom qAtom : mol .atoms ()) {
1023999 if (mappingMap .containsKey (qAtom ) && qAtom .getSymbol ().equalsIgnoreCase ("H" )) {
1024- // System.out.println("Atom " + qAtom.getSymbol() + " new Rank: " + counter);
10251000 String id = valueOf (counter );
10261001 qAtom .setID (id );
10271002 mappingMap .get (qAtom ).setID (id );
0 commit comments