diff --git a/openchemlib b/openchemlib index 1c3edb12..a0042e2a 160000 --- a/openchemlib +++ b/openchemlib @@ -1 +1 @@ -Subproject commit 1c3edb1264f14575430c6c57504c9ee3cb644809 +Subproject commit a0042e2aa41bf4d111281e5eabe40e7ee963a1e5 diff --git a/scripts/openchemlib/classes.js b/scripts/openchemlib/classes.js index 4bd13053..873aa963 100644 --- a/scripts/openchemlib/classes.js +++ b/scripts/openchemlib/classes.js @@ -94,7 +94,6 @@ const removed = [ 'chem/AtomTypeList.java', 'chem/chemicalspaces', 'chem/Clusterer.java', - 'chem/combinatorialspace', 'chem/conf/BondRotationHelper.java', 'chem/conf/ConformerSetGenerator.java', 'chem/conf/MolecularFlexibilityCalculator.java', diff --git a/src/com/actelion/research/gwt/chemlib/com/actelion/research/chem/AbstractDepictor.java b/src/com/actelion/research/gwt/chemlib/com/actelion/research/chem/AbstractDepictor.java index 868b932f..2dbce4fe 100644 --- a/src/com/actelion/research/gwt/chemlib/com/actelion/research/chem/AbstractDepictor.java +++ b/src/com/actelion/research/gwt/chemlib/com/actelion/research/chem/AbstractDepictor.java @@ -203,7 +203,7 @@ public void setAtomText(String[] atomText) { /** * If the foreground color is set (!=0), then molecule is drawn in the foreground - * color except for non carbon atoms, which are drawn in atomicNo specific + * color except for non-carbon atoms, which are drawn in atomicNo specific * colors. If a background color is given (!=0), then atom coloring and highlighting * is optimized to achieve good contrasts. * @param foreground null (black) or color to be used for molecule drawing @@ -217,7 +217,7 @@ public void setForegroundColor(Color foreground, Color background) { /** * If the foreground color is set (!=0), then molecule is drawn in the foreground - * color except for non carbon atoms, which are drawn in atomicNo specific + * color except for non-carbon atoms, which are drawn in atomicNo specific * colors. If a background color is given (!=0), then atom coloring and highlighting * is optimized to achieve good contrasts. * @param foreground 0 or ARGB values of color to be used for molecule drawing @@ -628,7 +628,7 @@ public synchronized void paint(T context) { mAtomColor[atom] = Molecule.cAtomColorMagenta; } - setColor_(COLOR_INITIALIZE); // to initialize the color tracking mechanism + setColorCode(COLOR_INITIALIZE); // to initialize the color tracking mechanism if (mAtomHiliteColor != null && (mAtomHiliteColor.length >= mMol.getAtoms())) hiliteAtomBackgrounds(mAtomHiliteColor, mAtomHiliteRadius); @@ -641,7 +641,7 @@ public synchronized void paint(T context) { mpSetNormalLabelSize(); setLineWidth(mpLineWidth); - setColor_(mStandardForegroundColor); + setColorCode(mStandardForegroundColor); markIsolatedAtoms(); mpDot.clear(); @@ -656,14 +656,14 @@ public synchronized void paint(T context) { for (int i=0; i maxHeap = new PriorityQueue<>((a, b) -> (a > b) ? -1 : (a < b) ? 1 : 0); + PriorityQueue minHeap = new PriorityQueue<>(); + + if (mMolecule != null) { + for (int i=0; i= this are not considered - * @param bonds bond indexes >= this are not considered + * @param atoms atom indexes >= these are not considered + * @param bonds bond indexes >= these are not considered * @param defaultBondLength * @param coords to be used, either the molecule's coordinates, or an alternative, e.g. from a Conformer * @return diff --git a/src/com/actelion/research/gwt/chemlib/com/actelion/research/chem/StereoMolecule.java b/src/com/actelion/research/gwt/chemlib/com/actelion/research/chem/StereoMolecule.java index eec403c1..f5d95136 100644 --- a/src/com/actelion/research/gwt/chemlib/com/actelion/research/chem/StereoMolecule.java +++ b/src/com/actelion/research/gwt/chemlib/com/actelion/research/chem/StereoMolecule.java @@ -74,6 +74,12 @@ public StereoMolecule createMolecule(int atoms, int bonds) { } + @Override + public void clear() { + super.clear(); + mCanonizer = null; + } + public StereoMolecule getCompactCopy() { StereoMolecule theCopy = new StereoMolecule(mAllAtoms, mAllBonds); copyMolecule(theCopy); @@ -94,7 +100,7 @@ public void copyMoleculeProperties(Molecule destMol) { // the rare case where we have valid parities and no atom coordinates. // Then mCanonizer is null and the parities were read as part of a persistent // molecule. In this case and parity and CIP validity needs to be copied. - // Otherwise parity is a perceived property from up/down bonds or 3D atom coords + // Otherwise, parity is a perceived property from up/down bonds or 3D atom coords // and should be freshly calculated. if (mCanonizer != null) destMol.mValidHelperArrays = cHelperNone; diff --git a/src/com/actelion/research/gwt/chemlib/com/actelion/research/chem/descriptor/DescriptorHelper.java b/src/com/actelion/research/gwt/chemlib/com/actelion/research/chem/descriptor/DescriptorHelper.java index c91b7029..15bf0b90 100644 --- a/src/com/actelion/research/gwt/chemlib/com/actelion/research/chem/descriptor/DescriptorHelper.java +++ b/src/com/actelion/research/gwt/chemlib/com/actelion/research/chem/descriptor/DescriptorHelper.java @@ -39,7 +39,7 @@ public class DescriptorHelper implements DescriptorConstants { - public static final String TAG_SIMILARITY = "Similarity"; + public static final String TAG_SIMILARITY = "Similarity "; public static int getDescriptorType(String shortName) { DescriptorInfo descriptorInfo = getDescriptorInfo(unifyShortName(shortName)); diff --git a/src/com/actelion/research/gwt/chemlib/com/actelion/research/chem/reaction/Reactor.java b/src/com/actelion/research/gwt/chemlib/com/actelion/research/chem/reaction/Reactor.java index ebc4b3c4..13dcc929 100644 --- a/src/com/actelion/research/gwt/chemlib/com/actelion/research/chem/reaction/Reactor.java +++ b/src/com/actelion/research/gwt/chemlib/com/actelion/research/chem/reaction/Reactor.java @@ -54,7 +54,7 @@ public class Reactor { private boolean[][] mIsReactionCenter; // reaction center flags on product atoms private boolean mRetainCoordinates,mFullyMapReactions,mUniqueProductsOnly,mAllowChargeCorrections; private int mMaxGenericMapNo,mMaxCount,mReactantMatchCombinationCount; - private ArrayList[] mMatchList; + private final ArrayList[] mMatchList; private int[][][] mReactantMapNo; // Reactant mapNos of the real reactant change with every reactant substructure match private StereoMolecule[][] mProduct; private String[][] mIDCode; @@ -152,7 +152,7 @@ public Reactor(Reaction reaction, int mode, int maxProducts) { for (int l=0; l 0) ? dif : 0; + mMinFreeValence[i][j] = Math.max(dif, 0); } } } @@ -475,8 +475,7 @@ private boolean nextMatchListCombination(int[] matchListIndex) { */ private int[] getReactantMapNos(int reactant, int[] matchList, int firstMapNo) { int[] reactantMapNo = new int[mReactant[reactant].getAtoms()]; - for (int i=0; i[] matchList, int[] match boolean[] excludeAtom = new boolean[mReactant[i].getAtoms()]; boolean[] excludeBond = new boolean[mReactant[i].getBonds()]; - // Exclude atoms from real reactants, which are unmapped in generic reaction + // Exclude atoms from real reactants, which exist in generic reactant and are not mapped in generic reaction // (including attached bonds) for (int j=0; j