$darkmode
DENOPTIM
ChemicalObjectModel.java
Go to the documentation of this file.
1/*
2 * DENOPTIM
3 * Copyright (C) 2019 Marco Foscato <marco.foscato@uib.no>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19package denoptim.molecularmodeling;
20
21import java.util.ArrayList;
22import java.util.Arrays;
23import java.util.HashMap;
24import java.util.HashSet;
25import java.util.List;
26import java.util.Map;
27import java.util.Set;
28import java.util.logging.Level;
29import java.util.logging.Logger;
30
31import javax.vecmath.Point3d;
32import javax.vecmath.Vector3d;
33
34import org.openscience.cdk.graph.PathTools;
35import org.openscience.cdk.graph.SpanningTree;
36import org.openscience.cdk.interfaces.IAtom;
37import org.openscience.cdk.interfaces.IAtomContainer;
38import org.openscience.cdk.interfaces.IBond;
39import org.openscience.cdk.interfaces.IChemObjectBuilder;
40import org.openscience.cdk.interfaces.IRingSet;
41import org.openscience.cdk.silent.RingSet;
42import org.openscience.cdk.silent.SilentChemObjectBuilder;
43
44import denoptim.constants.DENOPTIMConstants;
45import denoptim.exception.DENOPTIMException;
46import denoptim.graph.DGraph;
47import denoptim.graph.Edge.BondType;
48import denoptim.graph.Ring;
49import denoptim.graph.rings.RingClosingAttractor;
50import denoptim.graph.rings.RingClosure;
51import denoptim.integration.tinker.TinkerAtom;
52import denoptim.integration.tinker.TinkerMolecule;
53import denoptim.integration.tinker.TinkerUtils;
54import denoptim.io.DenoptimIO;
55import denoptim.utils.MathUtils;
56import denoptim.utils.ObjectPair;
57
66{
71
75 private IAtomContainer fmol;
76
81
85 private String molName;
86
90 private ArrayList<RingClosingAttractor> attractors;
91
95 private Map<RingClosingAttractor,Integer> attToAtmID;
96
101 private ArrayList<Set<ObjectPair>> allRCACombs;
102
106 private ArrayList<ObjectPair> rotatableBnds;
107
111 private ArrayList<RingClosure> newRingClosures;
112
116 private double overalRCScore = Double.NaN;
117
121 private double atmOveralScore = Double.NaN;
122
126 private Logger logger;
127
128 private ArrayList<Integer> oldToNewOrder;
129 private ArrayList<Integer> newToOldOrder;
130
131//------------------------------------------------------------------------------
132
138 {
139 this.molGraph = new DGraph();
140 IChemObjectBuilder builder = SilentChemObjectBuilder.getInstance();
141 this.fmol = builder.newAtomContainer();
142 this.tmol = new TinkerMolecule();
143 this.attractors = new ArrayList<RingClosingAttractor>();
144 this.attToAtmID = new HashMap<RingClosingAttractor,Integer>();
145 this.allRCACombs = new ArrayList<Set<ObjectPair>>();
146 this.rotatableBnds = new ArrayList<ObjectPair>();
147 this.newRingClosures = new ArrayList<RingClosure>();
148 this.molName = "none";
149 this.oldToNewOrder = new ArrayList<Integer>();
150 this.newToOldOrder = new ArrayList<Integer>();
151 }
152
153//------------------------------------------------------------------------------
154
171 IAtomContainer fmol,
173 String molName,
174 ArrayList<ObjectPair> rotatableBnds,
175 ArrayList<RingClosingAttractor> attractors,
176 Map<RingClosingAttractor,Integer> attToAtmID,
177 ArrayList<Set<ObjectPair>> allRCACombs,
178 ArrayList<RingClosure> ringClosures,
179 ArrayList<Integer> oldToNewOrder,
180 ArrayList<Integer> newToOldOrder,
181 Logger logger)
182 {
183 this.molGraph = molGraph;
184 this.fmol = fmol;
185 this.tmol = tmol;
186 this.attractors = attractors;
187 this.attToAtmID = attToAtmID;
188 this.allRCACombs = allRCACombs;
189 this.rotatableBnds = rotatableBnds;
190 this.molName = molName;
191 this.newRingClosures = ringClosures;
192 this.overalRCScore = Double.NaN;
193 this.atmOveralScore = Double.NaN;
194 if (this.attractors.size() != 0)
195 {
197 {
198 // ring closures defined in the input
200 }
201 }
202 this.oldToNewOrder = oldToNewOrder;
203 this.newToOldOrder = newToOldOrder;
204 this.logger = logger;
205 }
206
207//------------------------------------------------------------------------------
208
226 public ChemicalObjectModel(DGraph molGraph, IAtomContainer fmol,
228 ArrayList<ObjectPair> rotatableBnds,
229 ArrayList<Integer> oldToNewOrder,
230 ArrayList<Integer> newToOldOrder,
231 Logger logger) throws DENOPTIMException
232 {
233 this.molGraph = molGraph;
234 this.fmol = fmol;
235 this.tmol = tmol;
237 this.molName = molName;
238 this.rotatableBnds = rotatableBnds;
239 this.molName = molName;
240 this.attractors = new ArrayList<RingClosingAttractor>();
241 this.attToAtmID = new HashMap<RingClosingAttractor,Integer>();
243 this.allRCACombs = new ArrayList<Set<ObjectPair>>();
244 if (this.attractors.size() != 0)
245 {
247 {
248 // ring closures defined in the input
250 }
251 }
252 this.newRingClosures = new ArrayList<RingClosure>();
253 this.overalRCScore = Double.NaN;
254 this.atmOveralScore = Double.NaN;
255 this.oldToNewOrder = oldToNewOrder;
256 this.newToOldOrder = newToOldOrder;
257 this.logger = logger;
258 }
259
260//------------------------------------------------------------------------------
261
262 public List<Integer> getOldToNewOrder()
263 {
264 return oldToNewOrder;
265 }
266
267//------------------------------------------------------------------------------
268
269 public List<Integer> getNewToOldOrder()
270 {
271 return newToOldOrder;
272 }
273
274//------------------------------------------------------------------------------
275
276 private void findAttractors()
277 {
278 // Identify all RingClosingAttractors
279 for (IAtom atm : fmol.atoms())
280 {
282 if (rca.isAttractor())
283 {
284 attractors.add(rca);
285 attToAtmID.put(rca, fmol.indexOf(atm));
286 }
287 }
288 }
289
290//------------------------------------------------------------------------------
291
293 {
294 //When we give the a graph with rings, we are defining the RCA
295 //combinations, so there will be only one RCA combination
296 Set<ObjectPair> singleRCAcomb = new HashSet<ObjectPair>();
297
298 for (int i=0; i<attractors.size(); i++)
299 {
300 RingClosingAttractor rcaI = attractors.get(i);
301 Ring ringOwnerI = rcaI.getRingUser();
302 if (ringOwnerI==null)
303 continue;
304
305 for (int j=i+1; j<attractors.size(); j++)
306 {
307 RingClosingAttractor rcaJ = attractors.get(j);
308 Ring ringOwnerJ = rcaJ.getRingUser();
309 if (ringOwnerJ==null)
310 continue;
311 if (ringOwnerI==ringOwnerJ)
312 {
313 singleRCAcomb.add(new ObjectPair(rcaI, rcaJ));
314 }
315 }
316 }
317 allRCACombs.add(singleRCAcomb);
318 }
319
320//------------------------------------------------------------------------------
321
328 {
329 ArrayList<Point3d> newCoords = new ArrayList<Point3d>();
330 for (int i=0; i<fmol.getAtomCount(); i++)
331 {
332 int iTnk = i + 1;
333 TinkerAtom tAtm = tmol.getAtom(iTnk);
334 int ia = tAtm.getAtomNeighbours()[0];
335 int ib = tAtm.getAtomNeighbours()[1];
336 int ic = tAtm.getAtomNeighbours()[2];
337 if (ia > i || ib > i || ic > i)
338 {
339 String msg = "ERROR! Cannot convert internal coordinates of "
340 + "atom " + i + " " + tAtm + ". Reference "
341 + "atoms have higher ID. The atoms list in "
342 + "Molecule3DBuilder needs to be reordered.";
343 throw new DENOPTIMException(msg);
344 }
345 int angleFlag = tAtm.getAtomNeighbours()[3];
346 double bond = tAtm.getDistAngle()[0];
347 double angle1 = tAtm.getDistAngle()[1] * 2 * Math.PI / 360.0;
348 double angle2 = tAtm.getDistAngle()[2] * 2 * Math.PI / 360.0;
349 double[] newXYZ = {0.0, 0.0, 0.0};
351 double s1 = Math.sin(angle1);
352 double s2 = Math.sin(angle2);
353 double c1 = Math.cos(angle1);
354 double c2 = Math.cos(angle2);
355 if (ia == 0)
356 {
357 //first atom remains on the origin
358 }
359 else if (ib == 0)
360 {
361 newXYZ[2] = bond;
362 }
363 else if (ic == 0)
364 {
365 Vector3d nab = MathUtils.normDist(
366 newCoords.get(ia-1),newCoords.get(ib-1));
367 double rab = MathUtils.distance(
368 newCoords.get(ia-1),newCoords.get(ib-1));
369 newXYZ[0] = bond * s1;
370 newXYZ[2] = newCoords.get(ib-1).z + (rab - bond*c1)*nab.z;
371 }
372 else if (angleFlag == 0)
373 {
374 Vector3d nab = MathUtils.normDist(
375 newCoords.get(ia-1),newCoords.get(ib-1));
376 Vector3d nbc = MathUtils.normDist(
377 newCoords.get(ib-1),newCoords.get(ic-1));
378 Vector3d t = new Vector3d();
379 t.cross(nbc,nab);
380 double c = nab.x*nbc.x + nab.y*nbc.y + nab.z*nbc.z;
381 if (Math.abs(c) > (1.0 - smallDble))
382 {
383 String msg = "ERROR! Linearity does not allow definition "
384 + "of the dihedral angle for atom " + i + " " + tAtm
385 + " (Value of c="+c+" too close to unity; threshold is "
386 + (1.0 - smallDble) + "). "
387 + "You better use dummy atoms to avoid linearities.";
388 throw new DENOPTIMException(msg);
389 }
390 t.scale(1/Math.sqrt(Math.max(1.00 - c*c, smallDble)));
391 Vector3d u = new Vector3d();
392 u.cross(t,nab);
393 newXYZ[0] = newCoords.get(ia-1).x
394 + bond*(u.x*s1*c2 + t.x*s1*s2 - nab.x*c1);
395 newXYZ[1] = newCoords.get(ia-1).y
396 + bond*(u.y*s1*c2 + t.y*s1*s2 - nab.y*c1);
397 newXYZ[2] = newCoords.get(ia-1).z
398 + bond*(u.z*s1*c2 + t.z*s1*s2 - nab.z*c1);
399 }
400 else if (Math.abs(angleFlag) == 1)
401 {
402 Vector3d nba = MathUtils.normDist(
403 newCoords.get(ib-1),newCoords.get(ia-1));
404 Vector3d nac = MathUtils.normDist(
405 newCoords.get(ia-1),newCoords.get(ic-1));
406 Vector3d t = new Vector3d();
407 t.cross(nac,nba);
408 double c = nba.x*nac.x + nba.y*nac.y + nba.z*nac.z;
409 if (Math.abs(c) > (1.0 - smallDble))
410 {
411 logger.log(Level.WARNING, "WARNING! close-to-linear system "
412 + "in the definition of atom " + i + " " + tAtm + ". "
413 + "You better use dummy atoms to avoid linearities.");
414 }
415 double s = Math.max(1.00 - c*c, smallDble);
416 double a = (-c2 - c*c1) / s;
417 double b = (c1 + c*c2) / s;
418 double ci = (1.00 + a*c2 - b*c1) / s;
419 if (ci > smallDble)
420 {
421 ci = angleFlag * Math.sqrt(ci);
422 }
423 else if (ci < -smallDble)
424 {
425 ci = Math.sqrt((a*nac.x+b*nba.x)*(a*nac.x+b*nba.x)
426 + (a*nac.y+b*nba.y)*(a*nac.y+b*nba.y)
427 + (a*nac.z+b*nba.z)*(a*nac.z+b*nba.z));
428 a = a / ci;
429 b = b / ci;
430 ci = 0.0;
431 logger.log(Level.WARNING, "WARNING! close-to-linear system "
432 + "in the definition of atom " + i + " " + tAtm + ". "
433 + "You better use dummy atoms to avoid linearities.");
434 }
435 else
436 {
437 ci = 0.0;
438 }
439 newXYZ[0] = newCoords.get(ia-1).x
440 + bond*(a*nac.x + b*nba.x + ci*t.x);
441 newXYZ[1] = newCoords.get(ia-1).y
442 + bond*(a*nac.y + b*nba.y + ci*t.y);
443 newXYZ[2] = newCoords.get(ia-1).z
444 + bond*(a*nac.z + b*nba.z + ci*t.z);
445 }
446 Point3d p3d = new Point3d(newXYZ[0],newXYZ[1],newXYZ[2]);
447 newCoords.add(p3d);
448 }
449
450 // Update Cartesian coordinates
451 for (int i=0; i<fmol.getAtomCount(); i++)
452 {
453 fmol.getAtom(i).setPoint3d(newCoords.get(i));
454 tmol.getAtom(i+1).moveTo(newCoords.get(i).x,
455 newCoords.get(i).y,
456 newCoords.get(i).z);
457 }
458 }
459
460//------------------------------------------------------------------------------
461
468 {
469 return molGraph;
470 }
471
472//------------------------------------------------------------------------------
473
478 public IAtomContainer getIAtomContainer()
479 {
480 return fmol;
481 }
482
483//------------------------------------------------------------------------------
484
490 {
491 return tmol;
492 }
493
494//------------------------------------------------------------------------------
495
500 public ArrayList<RingClosingAttractor> getAttractorsList()
501 {
502 return attractors;
503 }
504
505//------------------------------------------------------------------------------
506
512 {
513 return attractors.get(i);
514 }
515
516//------------------------------------------------------------------------------
517
524 {
525 return attToAtmID.get(rca);
526 }
527
528//------------------------------------------------------------------------------
529
536 {
537 return attToAtmID.get(rca) + 1;
538 }
539
540//------------------------------------------------------------------------------
541
549 public ArrayList<Set<ObjectPair>> getRCACombinations()
550 {
551 return allRCACombs;
552 }
553
554//------------------------------------------------------------------------------
555
560 public ArrayList<ObjectPair> getRotatableBonds()
561 {
562 return rotatableBnds;
563 }
564
565//------------------------------------------------------------------------------
566
572 {
573 return rotatableBnds.size();
574 }
575
576//------------------------------------------------------------------------------
577
583 public ArrayList<RingClosure> getNewRingClosures()
584 {
585 return newRingClosures;
586 }
587
588//------------------------------------------------------------------------------
589
595 {
596 if (Double.isNaN(overalRCScore))
597 {
598 double score = 0.0;
600 {
601 score = score + rc.getRingClosureQuality();
602 }
603 overalRCScore = score;
604 }
605 return overalRCScore;
606 }
607
608//------------------------------------------------------------------------------
609
615 public double getAtomOverlapScore()
616 {
617 if (Double.isNaN(atmOveralScore))
618 {
619 double score = 0.0;
620 for (IAtom atmA : fmol.atoms())
621 {
622 String elA = atmA.getSymbol();
623
624 if (DENOPTIMConstants.DUMMYATMSYMBOL.equals(elA))
625 continue;
626
627 IAtom[] toExclude = PathTools.findClosestByBond(fmol,atmA,4);
628 for (IAtom atmB : fmol.atoms())
629 {
630 if (atmA == atmB)
631 continue;
632
633 if (Arrays.asList(toExclude).contains(atmB))
634 continue;
635
636 String elB = atmB.getSymbol();
637 if (DENOPTIMConstants.DUMMYATMSYMBOL.equals(elB))
638 continue;
639
640 double dist = atmA.getPoint3d().distance(atmB.getPoint3d());
641 score = score + dist;
642 }
643 }
644 atmOveralScore = score;
645 }
646 return atmOveralScore;
647 }
648
649//------------------------------------------------------------------------------
650
655 public String getName()
656 {
657 return molName;
658 }
659
660//------------------------------------------------------------------------------
661
672 public void addBond(IAtom atmA, IAtom atmB, RingClosure nRc,
673 BondType bndTyp)
674 {
675 this.newRingClosures.add(nRc);
676 this.overalRCScore = Double.NaN;
677
678 int iA = fmol.indexOf(atmA);
679 int iB = fmol.indexOf(atmB);
680
681 if (bndTyp.hasCDKAnalogue())
682 {
683 this.fmol.addBond(iA, iB, bndTyp.getCDKOrder());
684 logger.log(Level.FINE, "ADDING BOND: "+iA+" "+iB);
685 } else {
686 logger.log(Level.FINE, "WARNING! Attempt to add ring closing bond "
687 + "did not add any actual chemical bond because the "
688 + "bond type of the chord is '" + bndTyp +"'.");
689 }
690
691 if (iA < iB)
692 {
693 this.tmol.addBond(iA+1, iB+1);
694 }
695 else
696 {
697 this.tmol.addBond(iB+1, iA+1);
698 }
699 }
700
701//------------------------------------------------------------------------------
702
709 {
710 //Get all rings
711 SpanningTree st = new SpanningTree(fmol);
712 IRingSet allRings = new RingSet();
713 try {
714 allRings = st.getAllRings();
715 } catch (Exception ex) {
716 throw new DENOPTIMException(ex);
717 }
718
719 //Identify bonds to remove (cyclic bonds)
720 ArrayList<ObjectPair> toRemove = new ArrayList<ObjectPair>();
721 for (ObjectPair op : rotatableBnds)
722 {
723 int i1 = ((Integer)op.getFirst()).intValue();
724 int i2 = ((Integer)op.getSecond()).intValue();
725
726 IBond bnd = fmol.getBond(fmol.getAtom(i1), fmol.getAtom(i2));
727 IRingSet rs = allRings.getRings(bnd);
728 if (!rs.isEmpty())
729 {
730 toRemove.add(op);
731 logger.log(Level.FINE, "Bond " + i1 + "-" + i2 + " (TnkID:"
732 + (i1+1) + "-" + (i2+1) + ") is not rotatable anymore");
733 }
734 }
735
736 //Remove bonds
737 for (ObjectPair op : toRemove)
738 {
739 rotatableBnds.remove(op);
740 }
741 }
742
743//------------------------------------------------------------------------------
744
752 @SuppressWarnings("unchecked")
754 {
755 String nMolName = this.molName;
756 DGraph nMolGraph = this.molGraph.clone();
757 IAtomContainer nFMol;
758 TinkerMolecule nTMol;
759 ArrayList<ObjectPair> nRotBnds;
760
761 try
762 {
763 nFMol = this.fmol.clone();
764 nTMol = (TinkerMolecule) this.tmol.deepCopy();
765 nRotBnds = (ArrayList<ObjectPair>) this.rotatableBnds.clone();
766 }
767 catch (CloneNotSupportedException cns)
768 {
769 throw new DENOPTIMException(cns);
770 }
771
772 ArrayList<RingClosingAttractor> nAttractors =
773 new ArrayList<RingClosingAttractor>();
774 Map<RingClosingAttractor,Integer> nAttToAtmID =
775 new HashMap<RingClosingAttractor,Integer>();
776 Map<RingClosingAttractor,RingClosingAttractor> oldToNewRCA =
777 new HashMap<RingClosingAttractor,RingClosingAttractor>();
778 for (int iorca=0; iorca<attractors.size(); iorca++)
779 {
780 RingClosingAttractor oRca = attractors.get(iorca);
781 int ioatm = this.getAtmIdOfRCA(oRca);
782 IAtom atm = nFMol.getAtom(ioatm);
783 RingClosingAttractor nRca = new RingClosingAttractor(atm,nFMol);
784 nAttractors.add(nRca);
785 nAttToAtmID.put(nRca, ioatm);
786 oldToNewRCA.put(oRca, nRca);
787 }
788
789 ArrayList<Set<ObjectPair>> nAllRCACombs =
790 new ArrayList<Set<ObjectPair>>();
791 for (Set<ObjectPair> sop : this.allRCACombs)
792 {
793 Set<ObjectPair> nSop = new HashSet<ObjectPair>();
794 for (ObjectPair op : sop)
795 {
796 ObjectPair nOp = new ObjectPair(
797 oldToNewRCA.get(op.getFirst()),
798 oldToNewRCA.get(op.getSecond()));
799 nSop.add(nOp);
800 }
801 nAllRCACombs.add(nSop);
802 }
803
804 ArrayList<RingClosure> nNewRingClosures = new ArrayList<RingClosure>();
805 for (RingClosure rc : this.newRingClosures)
806 {
807 nNewRingClosures.add(rc.deepCopy());
808 }
809
810 ArrayList<Integer> newOldToNewOrder = new ArrayList<Integer>();
811 for (Integer i : oldToNewOrder)
812 newOldToNewOrder.add(i.intValue());
813
814 ArrayList<Integer> newNewToOldOrder = new ArrayList<Integer>();
815 for (Integer i : newToOldOrder)
816 newNewToOldOrder.add(i.intValue());
817
818 ChemicalObjectModel molClone = new ChemicalObjectModel(nMolGraph,
819 nFMol,
820 nTMol,
821 nMolName,
822 nRotBnds,
823 nAttractors,
824 nAttToAtmID,
825 nAllRCACombs,
826 nNewRingClosures,
827 newOldToNewOrder,
828 newNewToOldOrder, logger);
829
830 return molClone;
831 }
832
833//------------------------------------------------------------------------------
834}
General set of constants used in DENOPTIM.
static final double FLOATCOMPARISONTOLERANCE
Smallest difference for comparison of double and float numbers.
static final String DUMMYATMSYMBOL
Symbol of dummy atom.
Container for the list of vertices and the edges that connect them.
Definition: DGraph.java:102
DGraph clone()
Returns almost "deep-copy" of this graph.
Definition: DGraph.java:3415
boolean hasOrEmbedsRings()
Check for rings in this graph and in any graph that is embedded at any level in any vertex of this gr...
Definition: DGraph.java:1134
This class represents the closure of a ring in a spanning tree.
Definition: Ring.java:40
The RingClosingAttractor represent the available valence/connection that allows to close a ring.
Ring getRingUser()
Get the reference to the graph representation of the ring this attractor is meant to close.
boolean isAttractor()
Checks whether the constructed RingClosingAttractor does corresponds to a RingClosingAttractor in the...
RingClosure represents the arrangement of atoms and PseudoAtoms identifying the head and tail of a ch...
Based on the code from ffx.kenai.com Michael J.
Definition: TinkerAtom.java:26
void moveTo(double[] d)
Add a vector to the Atom's current position vector.
TinkerMolecule deepCopy()
This method produces a deep copy of the object.
void addBond(int a1, int a2)
Add one bond by appending a pair of indeces into the z-add section.
TinkerAtom getAtom(int pos)
Returns the atom which has the XYZ index set to pos.
Object clone()
This method produces a shallow copy of the object.
Collector of molecular information, related to a single chemical object, that is deployed within the ...
ChemicalObjectModel(DGraph molGraph, IAtomContainer fmol, TinkerMolecule tmol, String molName, ArrayList< ObjectPair > rotatableBnds, ArrayList< Integer > oldToNewOrder, ArrayList< Integer > newToOldOrder, Logger logger)
Constructs a Molecule3DBuilder specifying all its features.
double getAtomOverlapScore()
Return the atoms overlap score which is calculated for all atoms pairs not in 1-4 or lower relationsh...
double overalRCScore
Quality score of the list of RingClosures.
double getNewRingClosuresQuality()
Return the overal evaluation of the whole list of RingClosures.
Map< RingClosingAttractor, Integer > attToAtmID
Relation between RingClosingAttractor and atom ID.
int getTnkAtmIdOfRCA(RingClosingAttractor rca)
Returns the Tinker atom number, 1 to n,of the given RingClosingAttractor.
ArrayList< RingClosingAttractor > attractors
List of Ring Closing Attractors.
ChemicalObjectModel deepcopy()
Return a new Molecule3DBuilder having exactly the same features of this Molecule3DBuilder.
int getNumberRotatableBonds()
Returns the size of the current list of rotatable bonds.
DGraph getGraph()
Returns the graph representation of this molecule as it was originally generated by DEOPTIM.
int getAtmIdOfRCA(RingClosingAttractor rca)
Returns the CDK atom number, 0 to (n-1), of the given RingClosingAttractor.
String getName()
Return the name of this molecule.
void purgeListRotatableBonds()
Remove the cyclic bonds from the list of rotatable bonds.
ArrayList< ObjectPair > rotatableBnds
List of rotatable bonds.
IAtomContainer getIAtomContainer()
Returns the CDK representation of the molecular system.
void addBond(IAtom atmA, IAtom atmB, RingClosure nRc, BondType bndTyp)
Modify the molecule adding a cyclic bond between two atoms.
ArrayList< RingClosingAttractor > getAttractorsList()
Returns the list of RuingClosingAttractors.
ArrayList< ObjectPair > getRotatableBonds()
Returns the list of rotatable bonds.
ChemicalObjectModel(DGraph molGraph, IAtomContainer fmol, TinkerMolecule tmol, String molName, ArrayList< ObjectPair > rotatableBnds, ArrayList< RingClosingAttractor > attractors, Map< RingClosingAttractor, Integer > attToAtmID, ArrayList< Set< ObjectPair > > allRCACombs, ArrayList< RingClosure > ringClosures, ArrayList< Integer > oldToNewOrder, ArrayList< Integer > newToOldOrder, Logger logger)
Constructs an item specifying all its features.
ArrayList< RingClosure > newRingClosures
List of new ring closing environments.
void updateXYZFromINT()
Converts currently loaded internal coordinates into Cartesian overwriting the current XYZ.
double atmOveralScore
Atom overlap score (for atoms not is 1-4 or lower relationship)
ArrayList< Set< ObjectPair > > getRCACombinations()
Returns the list of combinations of RingClosingAttractor.
TinkerMolecule tmol
Tinker internal coordinates representation.
ArrayList< Set< ObjectPair > > allRCACombs
List of combinations of RingClosingAttractors (i.e., possible set of rings to create)
TinkerMolecule getTinkerMolecule()
Returns the Tinker Internal Coordination representation of the molecule.
ArrayList< RingClosure > getNewRingClosures()
Return the list of RingClosures that have been identified as closable head/tail of atom chains during...
RingClosingAttractor getAttractor(int i)
Returns the attractor given its position in the list of attractors.
Some useful math operations.
Definition: MathUtils.java:39
static Vector3d normDist(Point3d p1, Point3d p2)
Get normalized distance between two point.
Definition: MathUtils.java:86
static double distance(Point3d a, Point3d b)
Calculates distance between point a and point b.
Definition: MathUtils.java:342
This class is the equivalent of the Pair data structure used in C++ Although AbstractMap....
Definition: ObjectPair.java:30
Possible chemical bond types an edge can represent.
Definition: Edge.java:303
boolean hasCDKAnalogue()
Checks if it is possible to convert this edge type into a CDK bond.
Definition: Edge.java:328