Revision: 20319 http://sourceforge.net/p/jmol/code/20319 Author: hansonr Date: 2015-02-22 22:45:34 +0000 (Sun, 22 Feb 2015) Log Message: ----------- Jmol.___JmolVersion="14.3.12_2015.02.22d"
bug fix: restriction against getting SMILES string for biomolecule lifted Modified Paths: -------------- trunk/Jmol/src/org/jmol/smiles/SmilesGenerator.java trunk/Jmol/src/org/jmol/smiles/SmilesMatcher.java trunk/Jmol/src/org/jmol/util/JmolMolecule.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties Modified: trunk/Jmol/src/org/jmol/smiles/SmilesGenerator.java =================================================================== --- trunk/Jmol/src/org/jmol/smiles/SmilesGenerator.java 2015-02-22 21:54:13 UTC (rev 20318) +++ trunk/Jmol/src/org/jmol/smiles/SmilesGenerator.java 2015-02-22 22:45:34 UTC (rev 20319) @@ -93,7 +93,7 @@ this.ac = ac; this.bsSelected = bsSelected = BSUtil.copy(bsSelected); this.explicitH = explicitH; - return getSmilesComponent(atoms[i], bsSelected, false); + return getSmilesComponent(atoms[i], bsSelected, true, false); } String getBioSmiles(BNode[] atoms, int ac, BS bsSelected, @@ -133,7 +133,7 @@ sb.append("~").appendC(bioStructureName.charAt(0)).append("~"); len++; } else { - s = getSmilesComponent(a, bs, true); + s = getSmilesComponent(a, bs, false, true); if (s.equals(lastComponent)) { end = ""; } else { @@ -220,18 +220,19 @@ * * @param atom * @param bs + * @param allowBioResidues * @param allowConnectionsToOutsideWorld * @return SMILES * @throws InvalidSmilesException */ - private String getSmilesComponent(Node atom, BS bs, + private String getSmilesComponent(Node atom, BS bs, boolean allowBioResidues, boolean allowConnectionsToOutsideWorld) throws InvalidSmilesException { if (!explicitH && atom.getElementNumber() == 1 && atom.getEdges().length > 0) atom = atoms[atom.getBondedAtomIndex(0)]; // don't start with H bsSelected = JmolMolecule.getBranchBitSet(atoms, atom.getIndex(), - BSUtil.copy(bs), null, -1, true, false); + BSUtil.copy(bs), null, -1, true, allowBioResidues); bs.andNot(bsSelected); bsIncludingH = BSUtil.copy(bsSelected); if (!explicitH) Modified: trunk/Jmol/src/org/jmol/smiles/SmilesMatcher.java =================================================================== --- trunk/Jmol/src/org/jmol/smiles/SmilesMatcher.java 2015-02-22 21:54:13 UTC (rev 20318) +++ trunk/Jmol/src/org/jmol/smiles/SmilesMatcher.java 2015-02-22 22:45:34 UTC (rev 20319) @@ -138,11 +138,9 @@ boolean bioAddCrossLinks, String bioComment, boolean explicitH) throws Exception { InvalidSmilesException.clear(); - if (asBioSmiles) - return (new SmilesGenerator()).getBioSmiles((BNode[]) atoms, ac, bsSelected, - bioAllowUnmatchedRings, bioAddCrossLinks, bioComment); - return (new SmilesGenerator()).getSmiles(atoms, ac, bsSelected, - explicitH); + return (asBioSmiles ? (new SmilesGenerator()).getBioSmiles((BNode[]) atoms, + ac, bsSelected, bioAllowUnmatchedRings, bioAddCrossLinks, bioComment) + : (new SmilesGenerator()).getSmiles(atoms, ac, bsSelected, explicitH)); } @Override Modified: trunk/Jmol/src/org/jmol/util/JmolMolecule.java =================================================================== --- trunk/Jmol/src/org/jmol/util/JmolMolecule.java 2015-02-22 21:54:13 UTC (rev 20318) +++ trunk/Jmol/src/org/jmol/util/JmolMolecule.java 2015-02-22 22:45:34 UTC (rev 20319) @@ -283,7 +283,7 @@ int atomIndex = atom.getIndex(); if (!bsToTest.get(atomIndex)) return allowCyclic; - if (!allowBioResidue && (atom instanceof BNode) + if (!allowBioResidue && atom instanceof BNode && ((BNode) atom).getBioStructureTypeName().length() > 0) return allowCyclic; bsToTest.clear(atomIndex); Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2015-02-22 21:54:13 UTC (rev 20318) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2015-02-22 22:45:34 UTC (rev 20319) @@ -15,8 +15,9 @@ TODO: remove HTML5 dependency on synchronous file loading (check SCRIPT command for problems) TODO: implement SHOW IMAGE in JavaScript/Browser -Jmol.___JmolVersion="14.3.12_2015.02.22b" +Jmol.___JmolVersion="14.3.12_2015.02.22d" +bug fix: restriction against getting SMILES string for biomolecule lifted bug fix: end-on bonds may appear to disappear bug fix: JavaScript -2.format("%8.3") gives 2.000 not -2.000 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk _______________________________________________ Jmol-commits mailing list Jmol-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-commits