Skip to content

Commit 3983909

Browse files
committed
Remove ~40 more commented-out debug lines from 15 files
Clean ConvexHull (10 lines), StereogenicCenterCalculator (8 lines), BoundsTree, SignatureRootFinder, ValencyCalculator, MolContainer, FingerPrintContainer, filters, graphics, and utility classes. Fix duplicate @SuppressWarnings in EBIArrayList. Co-Authored-By: Syed Asad Rahman <asad.rahman@bioinceptionlabs.com>
1 parent daa09be commit 3983909

15 files changed

Lines changed: 27 additions & 54 deletions

File tree

src/main/java/com/bioinceptionlabs/reactionblast/containers/FingerPrintContainer.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,7 @@ public boolean isKeyPresent(String Key) throws IOException {
202202
@Override
203203
public void setValue(String Key, BitSet Value)
204204
throws IOException {
205-
// System.out.println("KEY " + Key + " val: " + Value.cardinality());
206205
FingerPrintMap.put(Key, Value);
207-
// System.out.println("FingerPrintMap " + FingerPrintMap.size() + " val: " + Value.cardinality());
208206
}
209207

210208
/**

src/main/java/com/bioinceptionlabs/reactionblast/containers/MolContainer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public boolean isIdentical(IAtomContainer _queryMol,
207207
private boolean isSubgraphIdentical(IAtomContainer _mol,
208208
IAtomContainer _rMol,
209209
boolean removeHydrogen) throws CDKException, IOException {
210-
// System.out.println("Graph matching");
210+
211211

212212
IAtomContainer mol1 = _mol;
213213
IAtomContainer mol2 = _rMol;

src/main/java/com/bioinceptionlabs/reactionblast/graphics/direct/ConvexHull.java

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public Rectangle getMinimumAreaBoundingRectangleBruteForce() {
144144
minArea = area;
145145
winnerIndex = index;
146146
}
147-
// System.out.println("rect " + rect);
147+
148148
}
149149
Vector2d edge = edgeVector(hull[hull.length - 1], hull[0]);
150150
Rectangle rect = getRectangleBrute(edge, hull.length - 1, 0);
@@ -154,7 +154,6 @@ public Rectangle getMinimumAreaBoundingRectangleBruteForce() {
154154
minArea = area;
155155
winnerIndex = hull.length;
156156
}
157-
// System.out.println("winner = " + winnerIndex);
158157

159158
return minRect;
160159
}
@@ -213,12 +212,7 @@ public Rectangle getMinimumAreaBoundingRectangle() {
213212
minArea = area;
214213
minRect = rectangle;
215214
}
216-
// System.out.println(
217-
// "rotated angle = " + rotatedAngle
218-
// + " min " + minArea
219-
// + " r = " + rectangle
220-
// + " caliper_a " + caliperA
221-
// + " caliper_b " + caliperB);
215+
222216
}
223217
return minRect;
224218
}
@@ -237,11 +231,7 @@ private Rectangle getRectangleBrute(
237231
double maxAngle = 0;
238232
Vector2d vN = new Vector2d(vector);
239233
vN.normalize();
240-
// System.out.println("tailIndex " + tailPointIndex
241-
// + " visiting points from "
242-
// + hullIDs[headPointIndex]
243-
// + " tailPt" + toString(tailPoint)
244-
// + " headPt" + toString(headPoint));
234+
245235
int max = 0;
246236
while (visited < hull.length) {
247237
if (index == hull.length) {
@@ -251,7 +241,7 @@ private Rectangle getRectangleBrute(
251241
vMax = hull[index];
252242
} else {
253243
double angle = prj(tailPoint, headPoint, hull[index]);
254-
// System.out.println(index + " proj " + hullIDs[index] + " " + angle);
244+
255245
if (angle < minAngle) {
256246
min = index;
257247
minAngle = angle;
@@ -277,12 +267,12 @@ private Rectangle getRectangleBrute(
277267
Point2d vMin = hull[min];
278268
Point2d tailProj = project(tailPoint, headPoint, vMax, true);
279269
Point2d headProj = project(tailPoint, headPoint, vMin, true);
280-
// System.out.println("vMax = " + hullIDs[max] + " vMin = " + hullIDs[min]);
270+
281271
Rectangle r
282272
= new Rectangle(thirdPoint, tailProj, headProj, thirdPointDist);
283273
r.pointY = vMin;
284274
r.pointZ = vMax;
285-
// System.out.println(toString(tailPoint, headPoint, tailProj, headProj, vMin, vMax));
275+
286276
return r;
287277
}
288278

@@ -371,7 +361,7 @@ private Rectangle getRectangle(
371361
increasing = false;
372362
}
373363
}
374-
// System.out.println(toString(tailPoint, headPoint, remainExPoint, tailExPt, projTail, headExPt, projHead));
364+
375365

376366
return new Rectangle(remainExPoint, projTail, projHead,
377367
pointLineDistance(tailPoint, headPoint, remainExPoint));
@@ -412,7 +402,7 @@ private Point2d project(Point2d p1, Point2d p2, Point2d p3, boolean outSeg) {
412402
} else {
413403
p = new Point2d(p1.x + (t * dx), p1.y + (t * dy));
414404
}
415-
// if (outSeg) System.out.println("projecting t = " + t + " " + toString(p1, p2, p3, p));
405+
416406
return p;
417407
}
418408
}
@@ -632,9 +622,7 @@ public Rectangle(Point2d pointOnAB, Point2d cornerC, Point2d cornerD, double dis
632622
cdVecNormalized.normalize();
633623
}
634624
Vector2d perp = new Vector2d(cdVecNormalized.y, -cdVecNormalized.x);
635-
// System.out.println(
636-
// pointOnAB + " " + cornerC + " " + cornerD + " " + distToCD
637-
// + " " + cdVec + " " + perp);
625+
638626
cornerA = new Point2d(cornerD);
639627
cornerA.scaleAdd(distToCD, perp, cornerA);
640628
cornerB = new Point2d(cornerC);

src/main/java/com/bioinceptionlabs/reactionblast/graphics/direct/MoleculeLabelDrawer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void draw(Map<String, String> labelMap, BoundsTree labelBounds, Graphics2
6060
double x = bounds.getCenterX();
6161
double y = bounds.getCenterY();
6262
Point2f p = super.getTextPoint(g, label, x, y);
63-
// System.out.println("drawing string at " + x + " " + y);
63+
6464
g.drawString(label, p.x, p.y);
6565
}
6666
}

src/main/java/com/bioinceptionlabs/reactionblast/graphics/direct/SignatureRootFinder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public static List<RootSystem> findRootSystems(
177177

178178
}
179179
}
180-
// System.out.println("RS for " + atomContainer.getID() + " = " + rootSystems);
180+
181181

182182
// now, join together any root systems that are adjacent
183183
boolean merging = true;
@@ -193,7 +193,7 @@ public static List<RootSystem> findRootSystems(
193193
if (adjacent(rootSystem, otherRootSystem, atomContainer)) {
194194
mergedRootSystems.add(rootSystem.merge(otherRootSystem));
195195
hasMerged = true;
196-
// System.out.println("merge " + rootSystem + " and " + otherRootSystem);
196+
197197
} else {
198198
mergedRootSystems.add(otherRootSystem);
199199
}
@@ -217,7 +217,7 @@ public static List<RootSystem> findRootSystems(
217217
});
218218
}
219219

220-
// System.out.println("RS for " + atomContainer.getID() + " = " + rootSystems + " after merging ");
220+
221221
return rootSystems;
222222
}
223223

src/main/java/com/bioinceptionlabs/reactionblast/graphics/direct/layout/AbstractDirectLayout.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ public void translateTo(IAtomContainer ac, double x, double y, Rectangle2D bound
120120
atom.getPoint2d().y += dy;
121121
}
122122
// bounds.setFrameFromCenter(x, y, bounds.getMinX() + dx, bounds.getMinY() + dy);
123-
// System.out.print(ac.getID() + " ADL Before : " + BoundsPrinter.toString(bounds));
123+
124124
bounds.setRect(bounds.getMinX() + dx, bounds.getMinY() + dy, bounds.getWidth(), bounds.getHeight());
125-
// System.out.println(" After: " + BoundsPrinter.toString(bounds) + " " + dx + " " + dy);
125+
126126
}
127127

128128
/**

src/main/java/com/bioinceptionlabs/reactionblast/graphics/direct/layout/BoundsTree.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public void add(String label, Rectangle2D bounds) {
125125
root.add(bounds);
126126
}
127127
if (root != null) {
128-
// System.out.println("root " + BoundsPrinter.toString(root) + " added " + BoundsPrinter.toString(bounds) + " " + label);
128+
129129
}
130130
}
131131

@@ -213,10 +213,10 @@ public List<String> getBoundLabels() {
213213
*/
214214
public void shift(double dx, double dy) {
215215
childMap.keySet().stream().map(key -> childMap.get(key)).forEachOrdered(bounds -> {
216-
// System.out.print(key + " Before : " + BoundsPrinter.toString(bounds));
216+
217217
bounds.setRect(bounds.getMinX() + dx, bounds.getMinY() + dy,
218218
bounds.getWidth(), bounds.getHeight());
219-
// System.out.println(" After: " + BoundsPrinter.toString(bounds) + " " + dx + " " + dy);
219+
220220
});
221221
}
222222

src/main/java/com/bioinceptionlabs/reactionblast/graphics/direct/layout/ZoomToFitLayout.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void layout(IAtomContainer mol, Dimension cellCanvas, Graphics2D g) {
8888
private double calculateZoom(IAtomContainer ac, double w, double h) {
8989
double borderX = drawer.getParams().borderX;
9090
double borderY = drawer.getParams().borderY;
91-
// System.out.println("border " + borderX + " " + borderY);
91+
9292
double canvasWidth = w;
9393
double canvasHeight = h;
9494
double scaleFactor

src/main/java/com/bioinceptionlabs/reactionblast/mechanism/StereogenicCenterCalculator.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,6 @@ public List<StereoChange> compare(IReaction reaction, Map<IAtom, IStereoAndConfo
167167
IStereoAndConformation pAtom2DCDKStereo = chirality2DCDK.get(atomT);
168168
IStereoAndConformation rAtom2DStereo = chirality2DChemaxon.get(atomQ);
169169
IStereoAndConformation pAtom2DStereo = chirality2DChemaxon.get(atomT);
170-
// System.out.println("atomQ " + atomQ.getID() + " S: " + atomQ.getSymbol());
171-
// System.out.println("atomT " + atomT.getID() + " S: " + atomT.getSymbol());
172-
//
173-
// System.out.println("atomQ " + chirality2DCDK.containsKey(atomQ));
174-
// System.out.println("atomT " + chirality2DCDK.containsKey(atomT));
175170
if (isStereogenicChange(rAtom2DStereo, pAtom2DStereo)) {
176171
StereoChange sc = new StereoChange(rAtom2DStereo, pAtom2DStereo, atomQ, atomT);
177172
stereoChangeList.add(sc);
@@ -210,11 +205,6 @@ public List<StereoChange> compare(IReaction reaction, Map<IAtom, IStereoAndConfo
210205
targetAtoms.stream().filter((atomT) -> (atomQ.getID().equals(atomT.getID()) && !atomQ.getSymbol().equalsIgnoreCase("H"))).forEachOrdered((atomT) -> {
211206
IStereoAndConformation rAtom2DCDKStereo = chirality2DCDK.get(atomQ);
212207
IStereoAndConformation pAtom2DCDKStereo = chirality2DCDK.get(atomT);
213-
// System.out.println("atomQ " + atomQ.getID() + " S: " + atomQ.getSymbol());
214-
// System.out.println("atomT " + atomT.getID() + " S: " + atomT.getSymbol());
215-
//
216-
// System.out.println("atomQ " + chirality2DCDK.containsKey(atomQ));
217-
// System.out.println("atomT " + chirality2DCDK.containsKey(atomT));
218208
if (isStereogenicChange(rAtom2DCDKStereo, pAtom2DCDKStereo)) {
219209
StereoChange sc = new StereoChange(rAtom2DCDKStereo, pAtom2DCDKStereo, atomQ, atomT);
220210
stereoChangeList.add(sc);

src/main/java/com/bioinceptionlabs/reactionblast/signature/RBlastMoleculeSignature.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,6 @@ public String getSmilesForAtomSignature(int atomIndex, int height, ICanonicalMol
198198
builder.makeFromColoredTree(tree);
199199
IAtomContainer fragment = builder.getAtomContainer();
200200
fragment = permute(labeller.getCanonicalPermutation(fragment), fragment);
201-
// System.out.println(new AtomContainerPrinter().toString(fragment));
202-
// System.out.println(Arrays.toString(labeller.getCanonicalPermutation(fragment)));
203-
// return "";
204201
RBlastSmilesGenerator smilesGenerator
205202
= new RBlastSmilesGenerator(false, labeller);
206203
try {

0 commit comments

Comments
 (0)