Revision: 20290 http://sourceforge.net/p/jmol/code/20290 Author: hansonr Date: 2015-02-14 19:42:33 +0000 (Sat, 14 Feb 2015) Log Message: ----------- Jmol.___JmolVersion="14.3.12_2015.02.14"
bug fix: compare({atomA},{atomsB}) should return standard 4x4 matrix, not one involving a rotation about an atom center (follow-up ROTATESELECTED was broken in 14.3.11_2014.12.17) Modified Paths: -------------- trunk/Jmol/src/javajs/util/Measure.java trunk/Jmol/src/org/jmol/scriptext/MathExt.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties Modified: trunk/Jmol/src/javajs/util/Measure.java =================================================================== --- trunk/Jmol/src/javajs/util/Measure.java 2015-02-12 12:51:26 UTC (rev 20289) +++ trunk/Jmol/src/javajs/util/Measure.java 2015-02-14 19:42:33 UTC (rev 20290) @@ -682,19 +682,34 @@ return q; } + /** + * Fills a 4x4 matrix with rotation-translation of mapped points A to B. + * If centerA is null, this is a standard 4x4 rotation-translation matrix; + * otherwise, this 4x4 matrix is a rotation around a vector through the center of ptsA, + * and centerA is filled with that center; + * Prior to Jmol 14.3.12_2014.02.14, when used from the JmolScript compare() function, + * this method returned the second of these options instead of the first. + * + * @param ptsA + * @param ptsB + * @param m 4x4 matrix to be returned + * @param centerA return center of rotation; if null, then standard 4x4 matrix is returned + * @return stdDev + */ public static float getTransformMatrix4(Lst<P3> ptsA, Lst<P3> ptsB, M4 m, P3 centerA) { P3[] cptsA = getCenterAndPoints(ptsA); P3[] cptsB = getCenterAndPoints(ptsB); - //System.out.println("draw d1 " + cptsA[0]); - //System.out.println("draw d2 " + cptsB[0]); float[] retStddev = new float[2]; Quat q = calculateQuaternionRotation(new P3[][] { cptsA, cptsB }, - retStddev); // was false - V3 v = V3.newVsub(cptsB[0], cptsA[0]); - m.setMV(q.getMatrix(), v); - if (centerA != null) + retStddev); + M3 r = q.getMatrix(); + if (centerA == null) + r.rotate(cptsA[0]); + else centerA.setT(cptsA[0]); + V3 t = V3.newVsub(cptsB[0], cptsA[0]); + m.setMV(r, t); return retStddev[1]; } Modified: trunk/Jmol/src/org/jmol/scriptext/MathExt.java =================================================================== --- trunk/Jmol/src/org/jmol/scriptext/MathExt.java 2015-02-12 12:51:26 UTC (rev 20289) +++ trunk/Jmol/src/org/jmol/scriptext/MathExt.java 2015-02-14 19:42:33 UTC (rev 20290) @@ -401,7 +401,8 @@ } catch (Exception ex) { e.evalError(ex.getMessage(), null); } - float[] data = e.getSmilesExt().getFlexFitList(bs1, bs2, smiles1, !isSmiles); + float[] data = e.getSmilesExt().getFlexFitList(bs1, bs2, smiles1, + !isSmiles); return (data == null ? mp.addXStr("") : mp.addXAF(data)); } try { @@ -411,23 +412,24 @@ if (bs1 == null && bs2 == null) return mp.addXStr(vwr.getSmilesMatcher() .getRelationship(smiles1, smiles2).toUpperCase()); - String mf1 = (bs1 == null ? vwr.getSmilesMatcher() - .getMolecularFormula(smiles1, false) : JmolMolecule - .getMolecularFormula(vwr.ms.at, bs1, false, null, false)); - String mf2 = (bs2 == null ? vwr.getSmilesMatcher() - .getMolecularFormula(smiles2, false) : JmolMolecule - .getMolecularFormula(vwr.ms.at, bs2, false, null, false)); + String mf1 = (bs1 == null ? vwr.getSmilesMatcher().getMolecularFormula( + smiles1, false) : JmolMolecule.getMolecularFormula(vwr.ms.at, bs1, + false, null, false)); + String mf2 = (bs2 == null ? vwr.getSmilesMatcher().getMolecularFormula( + smiles2, false) : JmolMolecule.getMolecularFormula(vwr.ms.at, bs2, + false, null, false)); if (!mf1.equals(mf2)) return mp.addXStr("NONE"); if (bs1 != null) - smiles1 = (String) e.getSmilesExt().getSmilesMatches("", null, bs1, null, false, true); + smiles1 = (String) e.getSmilesExt().getSmilesMatches("", null, bs1, + null, false, true); boolean check; if (bs2 == null) { // note: find smiles1 IN smiles2 here check = (vwr.getSmilesMatcher().areEqual(smiles2, smiles1) > 0); } else { - check = (((BS) e.getSmilesExt().getSmilesMatches(smiles1, null, bs2, null, false, true)) - .nextSetBit(0) >= 0); + check = (((BS) e.getSmilesExt().getSmilesMatches(smiles1, null, bs2, + null, false, true)).nextSetBit(0) >= 0); } if (!check) { // MF matched, but didn't match SMILES @@ -441,19 +443,19 @@ if (bs2 == null) { check = (vwr.getSmilesMatcher().areEqual(smiles1, smiles2) > 0); } else { - check = (((BS) e.getSmilesExt().getSmilesMatches(smiles1, null, bs2, null, - false, true)).nextSetBit(0) >= 0); + check = (((BS) e.getSmilesExt().getSmilesMatches(smiles1, null, + bs2, null, false, true)).nextSetBit(0) >= 0); } if (check) return mp.addXStr("ENANTIOMERS"); } // remove all stereochemistry from SMILES string if (bs2 == null) { - check = (vwr.getSmilesMatcher().areEqual( - "/nostereo/" + smiles2, smiles1) > 0); + check = (vwr.getSmilesMatcher().areEqual("/nostereo/" + smiles2, + smiles1) > 0); } else { - Object ret = e.getSmilesExt().getSmilesMatches("/nostereo/" + smiles1, null, bs2, - null, false, true); + Object ret = e.getSmilesExt().getSmilesMatches( + "/nostereo/" + smiles1, null, bs2, null, false, true); check = (((BS) ret).nextSetBit(0) >= 0); } if (check) @@ -465,8 +467,8 @@ //identical or conformational if (bs1 == null || bs2 == null) return mp.addXStr("IDENTICAL"); - stddev = e.getSmilesExt().getSmilesCorrelation(bs1, bs2, smiles1, null, null, null, - null, false, false, null, null, false, false); + stddev = e.getSmilesExt().getSmilesCorrelation(bs1, bs2, smiles1, null, + null, null, null, false, false, null, null, false, false); return mp.addXStr(stddev < 0.2f ? "IDENTICAL" : "IDENTICAL or CONFORMATIONAL ISOMERS (RMSD=" + stddev + ")"); } else if (isSmiles) { @@ -484,19 +486,18 @@ boolean bestMap = (("best".equals(sOpt) || "bestH".equals(sOpt))); if (sOpt == null || hMaps || allMaps || bestMap) { // with explicitH we set to find only the first match. - if (isMap || isSmiles) { - sOpt = "/noaromatic" - + (allMaps || bestMap ? "/" : " nostereo/") - + e.getSmilesExt().getSmilesMatches((hMaps ? "H" : ""), null, bs1, null, false, - true); - } else { + if (!isMap && !isSmiles) return false; - } + sOpt = "/noaromatic" + + (allMaps || bestMap ? "/" : " nostereo/") + + e.getSmilesExt().getSmilesMatches((hMaps ? "H" : ""), null, + bs1, null, false, true); } else { allMaps = true; } - stddev = e.getSmilesExt().getSmilesCorrelation(bs1, bs2, sOpt, ptsA, ptsB, m, null, - !isSmiles, isMap, null, null, !allMaps && !bestMap, bestMap); + stddev = e.getSmilesExt().getSmilesCorrelation(bs1, bs2, sOpt, ptsA, + ptsB, m, null, !isSmiles, isMap, null, null, !allMaps && !bestMap, + bestMap); if (isMap) { int nAtoms = ptsA.size(); if (nAtoms == 0) @@ -510,9 +511,8 @@ a[j] = new int[] { ((Atom) ptsA.get(j)).i, ((Atom) ptsB.get(pt)).i }; } - if (!allMaps) - return (ret.size() > 0 ? mp.addXAII(ret.get(0)) : mp.addXStr("")); - return mp.addXList(ret); + return (allMaps ? mp.addXList(ret) : ret.size() > 0 ? mp.addXAII(ret + .get(0)) : mp.addXStr("")); } } else { ptsA = e.getPointVector(args[0], 0); Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2015-02-12 12:51:26 UTC (rev 20289) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2015-02-14 19:42:33 UTC (rev 20290) @@ -15,8 +15,13 @@ TODO: remove HTML5 dependency on synchronous file loading (check SCRIPT command for problems) TODO: add 2D graphics panel for Ramachandran and NBO-style 2D graphics -- send to browser as data uri? -Jmol.___JmolVersion="14.3.12_2015.02.11" +Jmol.___JmolVersion="14.3.12_2015.02.14" +bug fix: compare({atomA},{atomsB}) should return standard 4x4 matrix, not one involving a rotation + about an atom center (follow-up ROTATESELECTED was broken in 14.3.11_2014.12.17) + +JmolVersion="14.3.12_2015.02.11" + bug fix: 14.3.12_2015.02.09 breaks MODEL "someTitle" syntax bug fix: MUTATE not properly saved in state bug fix: "USER MOD" not accepted at beginning of PDB file (MolProbity breaking PDB format here) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Jmol-commits mailing list Jmol-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-commits