20package denoptim.utils;
23import java.util.ArrayList;
24import java.util.Collections;
25import java.util.HashMap;
26import java.util.HashSet;
30import java.util.logging.Level;
31import java.util.logging.Logger;
33import javax.vecmath.Point2d;
34import javax.vecmath.Point3d;
36import org.openscience.cdk.Atom;
37import org.openscience.cdk.AtomContainer;
38import org.openscience.cdk.AtomRef;
39import org.openscience.cdk.CDKConstants;
40import org.openscience.cdk.PseudoAtom;
41import org.openscience.cdk.aromaticity.Kekulization;
42import org.openscience.cdk.config.IsotopeFactory;
43import org.openscience.cdk.config.Isotopes;
44import org.openscience.cdk.depict.Depiction;
45import org.openscience.cdk.depict.DepictionGenerator;
46import org.openscience.cdk.exception.CDKException;
47import org.openscience.cdk.geometry.GeometryUtil;
48import org.openscience.cdk.graph.ConnectivityChecker;
49import org.openscience.cdk.inchi.InChIGenerator;
50import org.openscience.cdk.inchi.InChIGeneratorFactory;
51import org.openscience.cdk.interfaces.IAtom;
52import org.openscience.cdk.interfaces.IAtomContainer;
53import org.openscience.cdk.interfaces.IAtomContainerSet;
54import org.openscience.cdk.interfaces.IAtomType.Hybridization;
55import org.openscience.cdk.interfaces.IBond;
56import org.openscience.cdk.interfaces.IChemObjectBuilder;
57import org.openscience.cdk.interfaces.IElement;
58import org.openscience.cdk.layout.StructureDiagramGenerator;
59import org.openscience.cdk.qsar.DescriptorValue;
60import org.openscience.cdk.qsar.IMolecularDescriptor;
61import org.openscience.cdk.qsar.descriptors.molecular.RotatableBondsCountDescriptor;
62import org.openscience.cdk.qsar.descriptors.molecular.WeightDescriptor;
63import org.openscience.cdk.qsar.result.DoubleResult;
64import org.openscience.cdk.qsar.result.IntegerResult;
65import org.openscience.cdk.silent.SilentChemObjectBuilder;
66import org.openscience.cdk.smiles.SmiFlavor;
67import org.openscience.cdk.smiles.SmilesGenerator;
68import org.openscience.cdk.tools.manipulator.AtomContainerManipulator;
70import denoptim.constants.DENOPTIMConstants;
71import denoptim.exception.DENOPTIMException;
72import denoptim.graph.APClass;
73import denoptim.graph.AttachmentPoint;
74import denoptim.graph.DGraph;
75import denoptim.graph.Edge.BondType;
76import denoptim.graph.Fragment;
77import denoptim.graph.Ring;
78import denoptim.graph.Vertex;
79import denoptim.graph.Vertex.BBType;
80import denoptim.graph.rings.RingClosingAttractor;
81import denoptim.io.DenoptimIO;
82import denoptim.logging.StaticLogger;
83import io.github.dan2097.jnainchi.InchiFlag;
84import io.github.dan2097.jnainchi.InchiOptions;
85import io.github.dan2097.jnainchi.InchiStatus;
95 private static final StructureDiagramGenerator
SDG =
96 new StructureDiagramGenerator();
97 private static final SmilesGenerator
SMGEN =
new SmilesGenerator(
99 private static final IChemObjectBuilder
builder =
100 SilentChemObjectBuilder.getInstance();
110 WeightDescriptor wd =
new WeightDescriptor();
111 Object[] pars = {
"*"};
112 wd.setParameters(pars);
113 ret_wd = ((DoubleResult) wd.calculate(mol).getValue())
151 String symbol = atom.getSymbol();
167 IsotopeFactory ifact =
null;
169 ifact = Isotopes.getInstance();
170 if (ifact.isElement(symbol))
172 @SuppressWarnings(
"unused")
173 IElement el = ifact.getElement(symbol);
176 }
catch (Throwable t) {
177 throw new Error(
"ERROR! Unable to create Isotope.");
193 for (IAtom a : mol.atoms())
195 boolean isRca =
false;
197 for (String rcaEl : rcaElSymbols)
207 IAtom newAtm =
new Atom(
"H",
new Point3d(a.getPoint3d()));
208 newAtm.setProperties(a.getProperties());
209 AtomContainerManipulator.replaceAtomByAtom(mol,a,newAtm);
228 ArrayList<Vertex> usedRcvs = graph.getUsedRCVertices();
229 Map<Vertex,ArrayList<Integer>> vIdToAtmId =
231 if (vIdToAtmId.size() == 0)
236 ArrayList<IAtom> atmsToRemove =
new ArrayList<>();
237 ArrayList<Boolean> doneVertices =
238 new ArrayList<>(Collections.nCopies(usedRcvs.size(),
false));
242 if (doneVertices.get(usedRcvs.indexOf(v)))
246 ArrayList<Ring> rings = graph.getRingsInvolvingVertex(v);
247 if (rings.size() != 1)
249 String s =
"Unexpected inconsistency between used RCV list "
250 + v +
" in {" + usedRcvs +
"}"
251 +
"and list of DENOPTIMRings "
252 +
"{" + rings +
"}. Check Code!";
255 Vertex vH = rings.get(0).getHeadVertex();
256 Vertex vT = rings.get(0).getTailVertex();
257 IAtom aH = mol.getAtom(vIdToAtmId.get(vH).get(0));
258 IAtom aT = mol.getAtom(vIdToAtmId.get(vT).get(0));
259 if (mol.getConnectedAtomsList(aH).size() == 0
260 || mol.getConnectedAtomsList(aT).size() == 0)
265 int iSrcH = mol.indexOf(mol.getConnectedAtomsList(aH).get(0));
266 int iSrcT = mol.indexOf(mol.getConnectedAtomsList(aT).get(0));
267 atmsToRemove.add(aH);
268 atmsToRemove.add(aT);
270 BondType bndTyp = rings.get(0).getBondType();
275 logger.log(Level.WARNING,
"WARNING! "
276 +
"Attempt to add ring closing bond "
277 +
"did not add any actual chemical bond because the "
278 +
"bond type of the chord is '" + bndTyp +
"'.");
281 doneVertices.set(usedRcvs.indexOf(vH),
true);
282 doneVertices.set(usedRcvs.indexOf(vT),
true);
286 ArrayList<Integer> removedIds =
new ArrayList<Integer>();
287 for (IAtom a : atmsToRemove)
289 removedIds.add(mol.indexOf(a));
291 Collections.sort(removedIds);
292 for (
Vertex v : graph.getVertexList())
296 int apSrcId = ap.getAtomPositionNumberInMol();
297 int countOfAtmsBEforeSrc = 0;
298 for (Integer removingId : removedIds)
300 if (removingId < apSrcId)
302 countOfAtmsBEforeSrc++;
303 }
else if (removingId > apSrcId)
308 ap.setAtomPositionNumberInMol(apSrcId-countOfAtmsBEforeSrc);
313 for (IAtom a : atmsToRemove)
332 IAtomContainer fmol =
builder.newAtomContainer();
337 catch (CloneNotSupportedException e)
358 smiles =
SMGEN.create(fmol);
363 String fileName =
"failed_generation_of_SMILES.sdf";
364 logger.log(Level.WARNING,
"WARNING: Skipping calculation of SMILES. "
365 +
"See file '" + fileName +
"'");
367 smiles =
"calculation_or_SMILES_crashed";
387 IAtomContainer fmol =
builder.newAtomContainer();
392 catch (CloneNotSupportedException e)
406 IAtomContainer ac2d =
builder.newAtomContainer();
407 IAtomContainerSet som = ConnectivityChecker.partitionIntoMolecules(
410 for (
int n = 0; n < som.getAtomContainerCount(); n++)
414 IAtomContainer mol = som.getAtomContainer(n);
415 SDG.setMolecule(mol,
true);
419 SDG.generateCoordinates();
420 mol =
SDG.getMolecule();
431 return GeometryUtil.has2DCoordinates(ac2d) ? ac2d :
null;
449 InchiOptions options =
new InchiOptions.InchiOptionsBuilder()
450 .withFlag(InchiFlag.AuxNone)
451 .withFlag(InchiFlag.RecMet)
452 .withFlag(InchiFlag.SUU)
469 IAtomContainer fmol =
builder.newAtomContainer();
490 InChIGeneratorFactory factory = InChIGeneratorFactory.getInstance();
491 InChIGenerator gen = factory.getInChIGenerator(fmol, options);
492 InchiStatus ret = gen.getStatus();
493 if (ret == InchiStatus.WARNING)
499 else if (ret != InchiStatus.SUCCESS)
503 inchikey = gen.getInchiKey();
505 catch (CDKException cdke)
509 if (inchikey.length() > 0)
529 IMolecularDescriptor descriptor =
530 new RotatableBondsCountDescriptor();
531 descriptor.setParameters(
new Object[]{Boolean.FALSE,Boolean.FALSE});
532 DescriptorValue result = descriptor.calculate(mol);
533 value = ((IntegerResult)result.getValue()).intValue();
535 catch (CDKException cdke)
553 for (IAtom atm : mol.atoms())
574 for (IAtom atm : mol.atoms())
576 if (atm.getSymbol().equals(symbol))
596 ArrayList<Vertex> vertLst,
600 ArrayList<Long> vertIDs =
new ArrayList<>();
601 for (
Vertex v : vertLst) {
602 vertIDs.add(v.getVertexId());
605 Map<Vertex,ArrayList<Integer>> map =
new HashMap<>();
606 for (IAtom atm : mol.atoms())
608 long vID = Long.parseLong(atm.getProperty(
610 if (vertIDs.contains(vID))
612 Vertex v = vertLst.get(vertIDs.indexOf(vID));
613 int atmID = mol.indexOf(atm);
614 if (map.containsKey(v))
616 map.get(v).add(atmID);
620 ArrayList<Integer> atmLst =
new ArrayList<>();
642 IAtomContainer iac = mol;
644 if (!GeometryUtil.has2DCoordinates(mol))
656 Depiction depiction =
new DepictionGenerator().depict(iac);
657 depiction.writeTo(filename);
658 }
catch (Exception e)
675 Point3d p = atm.getPoint3d();
679 Point2d p2d = atm.getPoint2d();
682 p =
new Point3d(0.0, 0.0, 0.0);
684 p =
new Point3d(p2d.x, p2d.y, 0.0);
700 for (IAtom atm : iac.atoms()) {
701 atm.setImplicitHydrogenCount(0);
712 AtomContainerManipulator.convertImplicitToExplicitHydrogens(mol);
729 }
catch (CDKException e) {
731 +
"Bond orders will be unreliable as all unset bonds are"
732 +
"now converted to single-order bonds.");
734 for (IBond bnd : iac.bonds())
736 if (bnd.getOrder().equals(IBond.Order.UNSET))
738 bnd.setOrder(IBond.Order.SINGLE);
755 Kekulization.kekulize(iac);
757 for (IBond bnd : iac.bonds())
759 if (bnd.getOrder().equals(IBond.Order.UNSET))
761 bnd.setOrder(IBond.Order.SINGLE);
778 for (IAtom atm : mol.atoms())
781 if (atm.getSymbol().equals(
"C") && atm.getFormalCharge() == 0
782 && mol.getConnectedBondsCount(atm) == 3)
784 if (atm.getFlag(CDKConstants.ISAROMATIC))
789 cause =
"Aromatic atom " +
getAtomRef(atm,mol)
790 +
" has 3 connected atoms but no double bonds";
794 for (IAtom nbr : mol.getConnectedAtomsList(atm))
796 if (nbr.getSymbol().equals(
"C"))
798 if (nbr.getFormalCharge() == 0)
800 if (mol.getConnectedBondsCount(nbr) == 3)
806 if ((nNbr == 3) && (nAtm == 3))
808 cause =
"Connected atoms "
811 +
" have 3 connected atoms "
812 +
"but no double bond. They are "
813 +
"likely to be aromatic but no "
814 +
"aromaticity has been reported.";
841 for (IBond bnd : mol.getConnectedBondsList(atm))
843 if (bnd.getOrder() == order)
862 IChemObjectBuilder
builder = SilentChemObjectBuilder.getInstance();
863 IAtomContainer iac =
builder.newAtomContainer();
865 for (IAtom oAtm : mol.atoms())
871 for (IBond oBnd : mol.bonds())
873 if (oBnd.getAtomCount() != 2)
876 +
"involving more than two atoms.");
878 int ia = mol.indexOf(oBnd.getAtom(0));
879 int ib = mol.indexOf(oBnd.getAtom(1));
880 iac.addBond(ia,ib,oBnd.getOrder());
920 boolean ignoreImplicitH)
928 nAtm =
new PseudoAtom(s);
930 if (oAtm.getPoint3d() !=
null)
932 Point3d p3d = oAtm.getPoint3d();
933 nAtm.setPoint3d(
new Point3d(p3d.x, p3d.y, p3d.z));
934 }
else if (oAtm.getPoint2d() !=
null)
936 Point2d p2d = oAtm.getPoint2d();
937 nAtm.setPoint3d(
new Point3d(p2d.x, p2d.y, 0.00001));
939 if (oAtm.getFormalCharge() !=
null)
940 nAtm.setFormalCharge(oAtm.getFormalCharge());
941 if (oAtm.getBondOrderSum() !=
null)
942 nAtm.setBondOrderSum(oAtm.getBondOrderSum());
943 if (oAtm.getCharge() !=
null)
944 nAtm.setCharge(oAtm.getCharge());
945 if (oAtm.getValency() !=
null && !ignoreValence)
946 nAtm.setValency(oAtm.getValency());
947 if (oAtm.getExactMass() !=
null)
948 nAtm.setExactMass(oAtm.getExactMass());
949 if (oAtm.getMassNumber() !=
null)
950 nAtm.setMassNumber(oAtm.getMassNumber());
951 if (oAtm.getFormalNeighbourCount() !=
null)
952 nAtm.setFormalNeighbourCount(oAtm.getFormalNeighbourCount());
953 if (oAtm.getFractionalPoint3d() !=
null)
954 nAtm.setFractionalPoint3d(
new Point3d(oAtm.getFractionalPoint3d()));
955 if (oAtm.getHybridization() !=
null)
956 nAtm.setHybridization(Hybridization.valueOf(
957 oAtm.getHybridization().toString()));
958 if (oAtm.getImplicitHydrogenCount() !=
null && !ignoreImplicitH)
959 nAtm.setImplicitHydrogenCount(oAtm.getImplicitHydrogenCount());
960 if (oAtm.getMaxBondOrder() !=
null)
961 nAtm.setMaxBondOrder(oAtm.getMaxBondOrder());
962 if (oAtm.getNaturalAbundance() !=
null)
963 nAtm.setNaturalAbundance(oAtm.getNaturalAbundance());
989 if (atm instanceof AtomRef)
991 a = ((AtomRef) atm).deref();
992 if (a instanceof PseudoAtom)
994 s = ((PseudoAtom) a).getLabel();
1000 }
else if (atm instanceof PseudoAtom)
1002 s = ((PseudoAtom) atm).getLabel();
1016 return atm.getSymbol() + (mol.indexOf(atm) +1);
1028 Point3d c =
new Point3d(0,0,0);
1029 for (IAtom atm : mol.atoms())
1033 c.scale(1.0 / ((
double) mol.getAtomCount()));
1066 Set<Long> wantedVIDs =
new HashSet<Long>();
1067 Map<Long,Vertex> wantedVertexesMap =
new HashMap<>();
1068 for (
Vertex v : subGraph.getVertexList())
1075 +
"vertex " + v +
", but is needed to extract "
1078 wantedVIDs.add(((Long) o).longValue());
1079 wantedVertexesMap.put(((Long) o).longValue(), v);
1083 IAtomContainer toRemove =
new AtomContainer();
1084 Map<IAtom,IAtom> toAP =
new HashMap<IAtom,IAtom>();
1085 Map<IAtom,AttachmentPoint> mapAtmToAPInG =
1086 new HashMap<IAtom,AttachmentPoint>();
1087 Map<IAtom,APClass> apcMap =
new HashMap<IAtom,APClass>();
1088 for (
int i=0; i<wholeIAC.getAtomCount(); i++)
1090 IAtom cpAtm = iac.getAtom(i);
1091 IAtom oriAtm = wholeIAC.getAtom(i);
1097 +
"' not defined in atom "
1098 + oriAtm.getSymbol() + wholeIAC.indexOf(oriAtm)
1099 +
", but is needed to extract substructure.");
1101 long vid = ((Long) o).longValue();
1102 if (wantedVIDs.contains(vid))
1107 boolean willBecomeAP =
false;
1108 for (IAtom nbr : wholeIAC.getConnectedAtomsList(oriAtm))
1115 +
"' not defined in atom "
1116 + nbr.getSymbol() + wholeIAC.indexOf(nbr)
1117 +
", but is needed to extract substructure.");
1119 long nbrVid = ((Long) oNbr).longValue();
1120 if (wantedVIDs.contains(nbrVid))
1125 toAP.put(cpAtm,iac.getAtom(wholeIAC.indexOf(nbr)));
1127 wholeGraph.getAPOnLeftVertexID(nbrVid,vid);
1128 if (apInWholeGraph ==
null)
1130 String debugFile =
"failedAPIdentificationIACSubGraph"
1131 + wholeGraph.getGraphId() +
".sdf";
1133 wholeGraph, willBecomeAP, logger, randomizer);
1135 + nbrVid +
" " + vid +
" on " + wholeGraph
1136 +
" See " + debugFile);
1139 wantedVertexesMap.get(nbrVid).getAP(apInWholeGraph.
getIndexInOwner());
1140 mapAtmToAPInG.put(cpAtm, apInSubGraph);
1142 apcMap.put(cpAtm, apc);
1143 willBecomeAP =
true;
1148 toRemove.addAtom(cpAtm);
1151 iac.remove(toRemove);
1156 List<IAtom> atmosToRemove =
new ArrayList<>();
1157 List<IBond> bondsToRemove =
new ArrayList<>();
1158 for (IAtom trgAtmInIAC : toAP.keySet())
1160 IAtom trgAtm = frag.
getAtom(iac.indexOf(trgAtmInIAC));
1161 IAtom srcAtmInISC = toAP.get(trgAtmInIAC);
1162 IAtom srcAtm = frag.
getAtom(iac.indexOf(srcAtmInISC));
1169 double currentLength = srcP3d.distance(trgP3d);
1173 double idealLength = 1.53;
1178 Point3d vector =
new Point3d();
1179 vector.x = srcP3d.x + (trgP3d.x - srcP3d.x)*(idealLength/currentLength);
1180 vector.y = srcP3d.y + (trgP3d.y - srcP3d.y)*(idealLength/currentLength);
1181 vector.z = srcP3d.z + (trgP3d.z - srcP3d.z)*(idealLength/currentLength);
1184 apcMap.get(trgAtmInIAC), vector);
1187 for (IBond bnd : frag.
bonds())
1189 if (bnd.contains(trgAtm))
1191 bondsToRemove.add(bnd);
1194 atmosToRemove.add(trgAtm);
1198 for (IBond bnd : bondsToRemove)
1202 for (IAtom a : atmosToRemove)
1223 final int not2or3D = -1;
1228 for (IAtom atm : mol.atoms())
1230 Point2d p2d =
new Point2d();
1231 Point3d p3d =
new Point3d();
1232 p2d = atm.getPoint2d();
1233 boolean have2D =
true;
1237 p3d = atm.getPoint3d();
1243 ArrayList<Double> pointer =
new ArrayList<Double>();
1256 }
catch (Throwable t) {
1261 if (numOf2D == mol.getAtomCount())
1263 else if (numOf3D == mol.getAtomCount())
General set of constants used in DENOPTIM.
static final String ATMPROPVERTEXID
String tag of Atom property used to store the unique ID of the Vertex corresponding to the molecular ...
static final String DUMMYATMSYMBOL
Symbol of dummy atom.
static final Object STOREDVID
Key of the property remembering vertex IDs.
static final Object LINKAPS
Key of property used to records references of APs.
An attachment point (AP) is a possibility to attach a Vertex onto the vertex holding the AP (i....
APClass getAPClass()
Returns the Attachment Point class.
void setProperty(Object key, Object property)
Container for the list of vertices and the edges that connect them.
Class representing a continuously connected portion of chemical object holding attachment points.
IBond removeBond(int position)
AttachmentPoint addAPOnAtom(IAtom srcAtm, APClass apc, Point3d vector)
Add an attachment point to the specifies atom.
IAtom getAtom(int number)
void removeAtom(IAtom atom)
IAtomContainer getIAtomContainer()
void updateAPs()
Changes the properties of each APs as to reflect the current atom list.
Iterable< IBond > bonds()
A vertex is a data structure that has an identity and holds a list of AttachmentPoints.
The RingClosingAttractor represent the available valence/connection that allows to close a ring.
static final Map< String, String > RCATYPEMAP
Recognized types of RingClosingAttractor and compatible types.
Utility methods for input/output.
static void writeSDFFile(String fileName, IAtomContainer mol)
Writes IAtomContainer to SDF file.
static void writeGraphToSDF(File file, DGraph graph, boolean append, boolean make3D, Logger logger, Randomizer randomizer)
Writes the graph to SDF file.
Logger class for DENOPTIM.
static final Logger appLogger
Toll to add/remove dummy atoms from linearities or multi-hapto sites.
IAtomContainer removeDummy(IAtomContainer mol)
Removes all dummy atoms and the bonds connecting them to other atoms.
IAtomContainer removeDummyInHapto(IAtomContainer mol)
Utilities for molecule conversion.
static int numOfBondsWithBO(IAtom atm, IAtomContainer mol, IBond.Order order)
Returns the number of bonds, with a certain bond order, surrounding the given atom.
static final StructureDiagramGenerator SDG
static String getInChIKeyForMolecule(IAtomContainer mol, Logger logger)
Generates the InChI key for the given atom container.
static void removeUsedRCA(IAtomContainer mol, DGraph graph, Logger logger)
Replace used RCAs (i.e., those involved in Rings) while adding the ring closing bonds.
static void setZeroImplicitHydrogensToAllAtoms(IAtomContainer iac)
Sets zero implicit hydrogen count to all atoms.
static IAtomContainer makeSameAs(IAtomContainer mol)
Constructs a copy of an atom container, i.e., a molecule that reflects the one given in the input arg...
static IAtom makeSameAtomAs(IAtom oAtm, boolean ignoreValence, boolean ignoreImplicitH)
Method that constructs an atom that reflect the same atom given as parameter in terms of element symb...
static int getNumberOfRotatableBonds(IAtomContainer mol)
Count number of rotatable bonds.
static int countAtomsOfElement(IAtomContainer mol, String symbol)
Count atoms with the given elemental symbol.
static int getDimensions(IAtomContainer mol)
Determines the dimensionality of the given chemical object.
static String getSMILESForMolecule(IAtomContainer mol, Logger logger)
Returns the SMILES representation of the molecule.
static IAtomContainer generate2DCoordinates(IAtomContainer ac, Logger logger)
Generates 2D coordinates for the molecule.
static void removeRCA(IAtomContainer mol)
Replace any PseudoAtoms representing ring closing attractors with H.
static double getMolecularWeight(IAtomContainer mol)
static String missmatchingAromaticity(IAtomContainer mol)
Looks for carbon atoms that are flagged as aromatic, but do not have any double bond and are,...
static IAtom makeSameAtomAs(IAtom oAtm)
Method that constructs an atom that reflect the same atom given as parameter in terms of element symb...
static final IChemObjectBuilder builder
static String getSymbolOrLabel(IAtom atm)
Gets either the elemental symbol (for standard atoms) of the label (for pseudo-atoms).
static void ensureNoUnsetBondOrdersSilent(IAtomContainer iac)
Sets bond order = single to all otherwise unset bonds.
static boolean isDummy(IAtom atm)
Checks if the given atom is a dummy atom based on the elemental symbol and the string used for dummy ...
static String getAtomRef(IAtom atm, IAtomContainer mol)
static final SmilesGenerator SMGEN
static void ensureNoUnsetBondOrders(IAtomContainer iac)
Sets bond order = single to all otherwise unset bonds.
static Map< Vertex, ArrayList< Integer > > getVertexToAtomIdMap(ArrayList< Vertex > vertLst, IAtomContainer mol)
Method to generate the map making in relation DENOPTIMVertex ID and atom index in the IAtomContainer ...
static void explicitHydrogens(IAtomContainer mol)
Converts all the implicit hydrogens to explicit.
static void moleculeToPNG(IAtomContainer mol, String filename, Logger logger)
Generate a PNG image from molecule mol
static Point3d calculateCentroid(IAtomContainer mol)
Calculated the centroid of the given molecule.
static Point3d getPoint3d(IAtom atm)
Return the 3D coordinates, if present.
static boolean isElement(String symbol)
Check element symbol corresponds to real element of Periodic Table.
static IAtomContainer extractIACForSubgraph(IAtomContainer wholeIAC, DGraph subGraph, DGraph wholeGraph, Logger logger, Randomizer randomizer)
Selects only the atoms that originate from a subgraph of a whole graph that originated the whole mole...
static boolean isElement(IAtom atom)
Check element symbol corresponds to real element of Periodic Table.
static int getHeavyAtomCount(IAtomContainer mol)
The heavy atom count.
static String getInChIKeyForMolecule(IAtomContainer mol, InchiOptions options, Logger logger)
Generates the INCHI key for the molecule.
Tool to generate random numbers and random decisions.
Possible chemical bond types an edge can represent.
boolean hasCDKAnalogue()
Checks if it is possible to convert this edge type into a CDK bond.
The type of building block.