From: <ha...@us...> - 2014-07-27 12:18:06
|
Revision: 19885 http://sourceforge.net/p/jmol/code/19885 Author: hansonr Date: 2014-07-27 12:18:00 +0000 (Sun, 27 Jul 2014) Log Message: ----------- ___JmolVersion="14.2.3_2014.07.26" new feature: select within(validation, "clashes where value>3") Modified Paths: -------------- trunk/Jmol/src/org/jmol/adapter/readers/cif/MMCifValidationParser.java trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollection.java trunk/Jmol/src/org/jmol/adapter/smarter/Resolver.java trunk/Jmol/src/org/jmol/api/JmolAnnotationParser.java trunk/Jmol/src/org/jmol/api/JmolBioResolver.java trunk/Jmol/src/org/jmol/dssx/AnnotationParser.java trunk/Jmol/src/org/jmol/modelset/ModelLoader.java trunk/Jmol/src/org/jmol/modelsetbio/Resolver.java trunk/Jmol/src/org/jmol/script/ScriptCompiler.java trunk/Jmol/src/org/jmol/script/ScriptTokenParser.java trunk/Jmol/src/org/jmol/scriptext/MathExt.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties trunk/Jmol/src/org/jmol/viewer/PropertyManager.java Modified: trunk/Jmol/src/org/jmol/adapter/readers/cif/MMCifValidationParser.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/readers/cif/MMCifValidationParser.java 2014-07-27 09:39:36 UTC (rev 19884) +++ trunk/Jmol/src/org/jmol/adapter/readers/cif/MMCifValidationParser.java 2014-07-27 12:18:00 UTC (rev 19885) @@ -9,7 +9,7 @@ import org.jmol.adapter.smarter.AtomSetCollectionReader; import org.jmol.script.SV; -public class MMCifValidationParser implements CifValidationParser { +public class MMCifValidationParser { private boolean asResidues; private AtomSetCollectionReader reader; @@ -21,7 +21,6 @@ //for reflection } - @Override public MMCifValidationParser set(AtomSetCollectionReader reader) { this.reader = reader; asResidues = reader.checkFilterKey("ASRES"); @@ -31,9 +30,9 @@ /** * Create property_xxxx for each validation category. * @param modelMap + * @return loading note * */ - @Override public String finalizeValidations(Map<String, Integer> modelMap) { mapAtomResIDs(modelMap); @@ -113,17 +112,28 @@ for (int i = 0, n = propList.size(); i < n;) { String key = (String) propList.get(i++); float[] f = (float[]) propList.get(i++); + int model = ((Integer) propList.get(i++)).intValue(); boolean isGroup = ((Boolean) propList.get(i++)).booleanValue(); int count = 0; float max = 0; + int reslast = -1; + int i0 = reader.asc.getAtomSetAtomIndex(model); for (int j = f.length; --j >= 0;) if (f[j] != 0) { - count++; + if (isGroup) { + int res = reader.asc.atoms[i0+j].sequenceNumber; + if (res != reslast) { + reslast = res; + count++; + } + } else { + count++; + } max = Math.max(f[j], max); } - note += "\n property_" + key + " (" + count + (max == 1 ? "" : "; max " + ((int)(max*100))/100f) +")"; - reader.asc.setAtomProperties(key, f, - ((Integer) propList.get(i++)).intValue(), isGroup); + note += "\n property_" + key + " (" + (isGroup ? "residues: ": "atoms: ") + count + + (max == 1 ? "" : ", max: " + ((int) (max * 100)) / 100f) + ")"; + reader.asc.setAtomProperties(key, f, model, isGroup); } return note; } Modified: trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollection.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollection.java 2014-07-27 09:39:36 UTC (rev 19884) +++ trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollection.java 2014-07-27 12:18:00 UTC (rev 19885) @@ -1010,7 +1010,7 @@ p.put(key.substring(1), value); } - public void setAtomProperties(String key, Object data, int atomSetIndex) { + public void setAtomProperties(String key, Object data, int atomSetIndex, boolean isGroup) { if (data instanceof String && !((String) data).endsWith("\n")) data = data + "\n"; if (atomSetIndex < 0) Modified: trunk/Jmol/src/org/jmol/adapter/smarter/Resolver.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/smarter/Resolver.java 2014-07-27 09:39:36 UTC (rev 19884) +++ trunk/Jmol/src/org/jmol/adapter/smarter/Resolver.java 2014-07-27 12:18:00 UTC (rev 19885) @@ -42,7 +42,7 @@ private final static String classBase = "org.jmol.adapter.readers."; private final static String[] readerSets = new String[] { - "cif.", ";Cif;", + "cif.", ";Cif;MMCif;", "molxyz.", ";Mol3D;Mol;Xyz;", "more.", ";BinaryDcd;Gromacs;Jcampdx;MdCrd;MdTop;Mol2;TlsDataOnly;", "quantum.", ";Adf;Csf;Dgrid;GamessUK;GamessUS;Gaussian;GaussianFchk;GaussianWfn;Jaguar;" + @@ -299,7 +299,7 @@ String[] recordTags = lineStartsWithRecords[i]; for (int j = 1; j < recordTags.length; ++j) { String recordTag = recordTags[j]; - for (int k = 0; k < lines.length; ++k) { + for (int k = 0; k < lines.length; k++) { if (lines[k].startsWith(recordTag)) return recordTags[0]; } @@ -717,6 +717,9 @@ private final static String[] cifLineStartRecords = { "Cif", "data_", "_publ" }; + private final static String[] mmcifLineStartRecords = + { "MMCif", "_database_PDB_" }; + private final static String[] ghemicalMMLineStartRecords = { "GhemicalMM", "!Header mm1gp", "!Header gpr" }; @@ -742,7 +745,7 @@ { "VaspOutcar", " vasp.", " INCAR:" }; private final static String[][] lineStartsWithRecords = - { cifLineStartRecords, pqrLineStartRecords, p2nLineStartRecords, + { mmcifLineStartRecords, cifLineStartRecords, pqrLineStartRecords, p2nLineStartRecords, pdbLineStartRecords, shelxLineStartRecords, ghemicalMMLineStartRecords, jaguarLineStartRecords, mdlLineStartRecords, spartanSmolLineStartRecords, csfLineStartRecords, Modified: trunk/Jmol/src/org/jmol/api/JmolAnnotationParser.java =================================================================== --- trunk/Jmol/src/org/jmol/api/JmolAnnotationParser.java 2014-07-27 09:39:36 UTC (rev 19884) +++ trunk/Jmol/src/org/jmol/api/JmolAnnotationParser.java 2014-07-27 12:18:00 UTC (rev 19885) @@ -28,7 +28,8 @@ Lst<Object> catalogValidations(Viewer vwr, SV validation, int[] modelAtomIndices, Map<String, int[]> valResMap, - Map<String, Integer> map); + Map<String, Integer> map, Map<String, Integer> modelMap); - + SV initializeAnnotation(SV objAnn, int type); + } Modified: trunk/Jmol/src/org/jmol/api/JmolBioResolver.java =================================================================== --- trunk/Jmol/src/org/jmol/api/JmolBioResolver.java 2014-07-27 09:39:36 UTC (rev 19884) +++ trunk/Jmol/src/org/jmol/api/JmolBioResolver.java 2014-07-27 12:18:00 UTC (rev 19885) @@ -27,7 +27,7 @@ public void initialize(ModelLoader modelLoader); - public Object fixPropertyValue(BS bsAtoms, Object data); + public Object fixPropertyValue(BS bsAtoms, Object data, boolean toHydrogens); public Model getBioModel(int modelIndex, int trajectoryBaseIndex, String jmolData, Modified: trunk/Jmol/src/org/jmol/dssx/AnnotationParser.java =================================================================== --- trunk/Jmol/src/org/jmol/dssx/AnnotationParser.java 2014-07-27 09:39:36 UTC (rev 19884) +++ trunk/Jmol/src/org/jmol/dssx/AnnotationParser.java 2014-07-27 12:18:00 UTC (rev 19885) @@ -1172,7 +1172,7 @@ if (map.containsKey("_map")) map = map.get("_map").getMap(); // map = map.values().iterator().next().getMap(); - String detailKey = (type == T.annotations ? "mappings" : "outliers"); + String detailKey = getDataKey(type); if (showDetail && map.containsKey(detailKey)) { sb.append(map.get(detailKey).asString()).append("\n"); return; @@ -1204,13 +1204,27 @@ } } - /** - * Returns a Lst<Object> of property data in the form - * name(String), data(float[]), modelIndex (Integer); - * - */ + private String getDataKey(int type) { + switch (type) { + case T.annotations: + return "mappings"; + case T.validation: + return "outliers"; + } + return null; +} + + /** + * Returns a Lst<Object> of property data in the form name(String), + * data(float[]), modelIndex (Integer), isGroup (Boolean); + * + */ @Override - public Lst<Object> catalogValidations(Viewer viewer, SV map0, int[] modelAtomIndices, Map<String, int[]> resMap, Map<String, Integer> atomMap) { + public Lst<Object> catalogValidations(Viewer viewer, SV map0, + int[] modelAtomIndices, + Map<String, int[]> resMap, + Map<String, Integer> atomMap, + Map<String, Integer> modelMap) { Map<String, SV> data = map0.getMap(); if (data == null) return null; @@ -1221,6 +1235,8 @@ data = data.entrySet().iterator().next().getValue().getMap(); // add _map as a new top-level key pointing to the same thing map0.getMap().put("_map", SV.newV(T.hash, data)); + Lst<SV> list = new Lst<SV>(); + map0.getMap().put("_list", SV.newV(T.varray, list)); // { // "1blu": { @@ -1253,21 +1269,33 @@ boolean hasUnit = false; String key = e.getKey(); SV svType = SV.newS(key); + boolean isRes = false; for (int j = outliers.size(); --j >= 0;) { - map = outliers.get(j).getMap(); + SV out = outliers.get(j); + map = out.getMap(); sv = map.get("units"); SV svv = map.get("value"); - BS bsAtoms = new BS(); - map.put("_atoms", SV.getVariable(bsAtoms)); - map.put("_type", svType); float val = (svv == null ? 1 : SV.fValue(svv)); - Lst<SV> units = (val == 0 || sv == null || sv.tok != T.varray ? null - : sv.getList()); - if (units != null && units.size() > 0) { - hasUnit = true; - for (int k = units.size(); --k >= 0;) - catalogUnit(viewer, floats, units.get(k).asString(), val, bsAtoms, - modelAtomIndices, resMap, atomMap); + Lst<SV> units = (val == 0 || sv == null || sv.tok == T.varray ? sv + .getList() : sv.tok == T.string ? new Lst<SV>() : null); + if (units != null) { + if (sv.tok == T.string) { + // optional string of unit ids + String[] svl = PT.split(sv.asString(),","); + for (int i = svl.length; --i >= 0;) + units.addLast(SV.newS(svl[i].trim())); + } + if (units.size() > 0) { + BS bsAtoms = new BS(); + map.put("_atoms", SV.getVariable(bsAtoms)); + map.put("_type", svType); + hasUnit = true; + list.addLast(out); + for (int k = units.size(); --k >= 0;) { + isRes |= catalogUnit(viewer, floats, units.get(k).asString(), + val, bsAtoms, modelAtomIndices, resMap, atomMap, modelMap); + } + } } } if (hasUnit) { @@ -1276,6 +1304,7 @@ retProperties.addLast(key); retProperties.addLast(floats[m]); retProperties.addLast(Integer.valueOf(m)); + retProperties.addLast(Boolean.valueOf(isRes)); } } } @@ -1291,11 +1320,17 @@ * We create a main list of mappings, where each mapping * has _atoms, _dbName, _domainName. * - * @param map + * @param objAnn * @return main map */ - private SV initializeAnnotation(Map<String, SV> map) { - SV main = map.entrySet().iterator().next().getValue(); + @Override + public SV initializeAnnotation(SV objAnn, int type) { + Map<String, SV> map = objAnn.getMap(); + SV main = map.get("_map"); + if (main != null) + return main; + String dataKey = getDataKey(type); + main = map.entrySet().iterator().next().getValue(); map.put("_map", main); boolean noSingles = true; // different for validation Map<String, SV> _cat = new Hashtable<String, SV>(); @@ -1310,7 +1345,7 @@ String _domainName = e2.getKey(); SV _domainMap = e2.getValue(); - SV _domainList = _domainMap.mapGet("mappings"); + SV _domainList = _domainMap.mapGet(dataKey); Lst<SV> _mapList = _domainList.getList(); for (int i = _mapList.size(); --i >= 0;) { SV mapping = _mapList.get(i); @@ -1355,21 +1390,26 @@ * @param key * @param bs */ + @SuppressWarnings("unchecked") private void findAnnotationAtoms(Viewer vwr, String name, - Map<String, SV> map, String key, BS bs) { + SV map, String key, BS bs) { if (map == null) return; System.out.println("Checking " + name + " for " + key); Object data = vwr.extractProperty(map, "[" + key + "]", -1); - if (!(data instanceof SV)) - return; - Lst<SV> list = ((SV) data).getList(); + Lst<SV> list = null; + if (data instanceof Lst) { + list = (Lst<SV>) data; + } else if (data instanceof SV) { + list = ((SV) data).getList(); + } if (list == null) return; // go through all mappings for (int i = 0, n = list.size(); i < n; i++) { - Map<String, SV> mapping = list.get(i).getMap(); + Object o = list.get(i); + Map<String, SV> mapping = (o instanceof SV ? ((SV)o).getMap() : (Map<String, SV>) o); if (mapping == null) return; SV _atoms = mapping.get("_atoms"); @@ -1436,23 +1476,30 @@ /** * Carried out for each unit - * @param viewer * + * @param viewer * @param vals * model-based array of float values for a given validation type * @param unitID * @param val - * @param bsAtoms - * @param modelAtomIndices - * @param resMap - * @param atomMap + * @param bsAtoms + * @param modelAtomIndices + * @param resMap + * @param atomMap + * @param modelMap + * TODO + * + * @return true if this is residue-based validation (to be added to H atoms + * when pdbAddHydrogens is set */ - private static void catalogUnit(Viewer viewer, float[][] vals, String unitID, float val, BS bsAtoms, int[] modelAtomIndices, - Map<String, int[]> resMap, Map<String, Integer> atomMap - - - ) { + private boolean catalogUnit(Viewer viewer, float[][] vals, String unitID, + float val, BS bsAtoms, int[] modelAtomIndices, + Map<String, int[]> resMap, + Map<String, Integer> atomMap, + Map<String, Integer> modelMap + ) { + // (pdbid)|model|chain|RESNAME|resno|ATOMNAME|altcode|inscode|(symmetry) // 0 1 2 3 4 5 6 7 8 @@ -1466,14 +1513,19 @@ // must have at least model, chain, resname, and resno if (s.length < 8 || s[1].length() == 0 || s[2].length() == 0 || s[3].length() == 0 || s[4].length() == 0) - return; - int m = (s[1].length() == 0 ? 0 : PT.parseInt(s[1]) - 1); + return false; + String sm = (s[1].length() == 0 ? "1" : s[1]); + int m = (modelMap == null ? PT.parseInt(sm) - 1 : -1); + Integer im = (m >= 0 ? null : modelMap.get(sm)); + if (im != null) + m = im.intValue(); + if (m >= modelAtomIndices.length) + return false; String res = s[1] + "_" + viewer.getChainID(s[2]) + "_" + s[4] + "_" + s[7].toLowerCase(); - if (m >= modelAtomIndices.length) - return; int i0 = modelAtomIndices[m]; - if (atomMap == null || s[5].length() == 0 ) { + boolean isRes = (atomMap == null || s[5].length() == 0); + if (isRes) { int[] a2 = resMap.get(res); if (a2 != null) for (int j = a2[1], j0 = a2[0]; --j >= j0;) { @@ -1489,6 +1541,7 @@ vals[m][j] += Math.abs(val); } } + return isRes; } ///////////////////// general post-load processing //////////////// @@ -1530,23 +1583,20 @@ if (doCache) dssrCache.put(key, bs); Object data; - if (!isAnnotations) { + if (!isAnnotations && !isValidation) { Map<String, BS> htChains = new Hashtable<String, BS>(); data = vwr.extractProperty(dbObj, key, -1); if (data instanceof Lst<?>) getBsAtoms(vwr, null, (Lst<SV>) data, bs, htChains); return bs; } - - Map<String, SV> map = ((SV) dbObj).getMap(); - SV main = map.get("_map"); - if (main == null) - main = initializeAnnotation(map); - map = main.getMap(); + + SV main = initializeAnnotation((SV) dbObj, type); + SV svMap = main; + Map<String, SV> map = svMap.getMap(); // select within(annotations,"InterPro.* where identifier like '*-like'") int pt = s.indexOf(" where "); String tableName = PT.rep((pt < 0 ? key : key.substring(0, pt)), " ",""); - String newKey = "select " + (isAnnotations ? "mappings" : "outliers") + (pt < 0 ? "" : key.substring(pt)); if (tableName.indexOf(".") < 0) tableName += ".*"; String[] keys = PT.split(tableName, "."); @@ -1556,31 +1606,35 @@ for (; i < keys.length; i++) { tableName += (i == 0 ? "" : ".") + keys[i]; if (keys[i].equals("*")) { - isWild = true; + isWild = !isValidation; break; } - SV svMap = map.get(keys[i]); + svMap = map.get(keys[i]); if (svMap == null) { Logger.info("Annotation database not found: '" + keys[i] + "' note that this is case-sensitive, for example SCOP Pfam, etc. Options include: " + main.getMapKeys(1, true)); return bs; } map = svMap.getMap(); + if (map == null) { + break; + } } + String newKey = "select " + (map == null ? "*" : getDataKey(type)) + (pt < 0 ? "" : key.substring(pt)); Logger.info("looking for " + newKey + " in " + tableName); // this is either the right map or we have a wildcard. - if (i == 0) { + if (i == 0 && map != null) { for (String b : main.getMap().keySet()) for (String a : (map = main.getMap().get(b).getMap()).keySet()) - findAnnotationAtoms(vwr, b + "." + a, map.get(a).getMap(), newKey, bs); + findAnnotationAtoms(vwr, b + "." + a, map.get(a), newKey, bs); } else if (isWild) { for (String a : map.keySet()) - findAnnotationAtoms(vwr, a, map.get(a).getMap(), newKey, bs); + findAnnotationAtoms(vwr, a, map.get(a), newKey, bs); } else { - findAnnotationAtoms(vwr, tableName, map, newKey, bs); + findAnnotationAtoms(vwr, tableName, svMap, newKey, bs); } bs.and(bsModel); } catch (Exception e) { - System.out.println(e.toString() + " in DSSRParser"); + System.out.println(e.toString() + " in AnnotationParser"); bs.clearAll(); } return bs; Modified: trunk/Jmol/src/org/jmol/modelset/ModelLoader.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/ModelLoader.java 2014-07-27 09:39:36 UTC (rev 19884) +++ trunk/Jmol/src/org/jmol/modelset/ModelLoader.java 2014-07-27 12:18:00 UTC (rev 19885) @@ -413,6 +413,9 @@ for (int i = baseModelIndex; i < modelCount; i++) { Map<String, Object> atomProperties = (Map<String, Object>) ms.getInfo(i, "atomProperties"); + // list of properties that are to be transfered to H atoms as well. + String groupList = (String) ms.getInfo(i, + "groupPropertyList"); if (atomProperties == null) continue; for (Map.Entry<String, Object> entry : atomProperties.entrySet()) { @@ -420,8 +423,10 @@ Object value = entry.getValue(); // no deletions yet... BS bs = ms.getModelAtomBitSetIncludingDeleted(i, true); - if (doAddHydrogens) - value = jbr.fixPropertyValue(bs, value); + if (doAddHydrogens) { + boolean isGroup = (groupList != null && PT.isOneOf(key, groupList)); + value = jbr.fixPropertyValue(bs, value, isGroup); + } key = "property_" + key.toLowerCase(); Logger.info("creating " + key + " for model " + ms.getModelName(i)); vwr.setData(key, new Object[] { key, value, bs, Integer.valueOf(JmolDataManager.DATA_TYPE_UNKNOWN), Boolean.FALSE }, ms.ac, 0, Modified: trunk/Jmol/src/org/jmol/modelsetbio/Resolver.java =================================================================== --- trunk/Jmol/src/org/jmol/modelsetbio/Resolver.java 2014-07-27 09:39:36 UTC (rev 19884) +++ trunk/Jmol/src/org/jmol/modelsetbio/Resolver.java 2014-07-27 12:18:00 UTC (rev 19885) @@ -604,27 +604,38 @@ } @Override - public Object fixPropertyValue(BS bsAtoms, Object data) { + public Object fixPropertyValue(BS bsAtoms, Object data, boolean toHydrogens) { Atom[] atoms = ms.at; - if (data instanceof String) { - String[] sData = PT.split((String) data, "\n"); - String[] newData = new String[bsAtoms.cardinality()]; - String lastData = ""; - for (int pt = 0, iAtom = 0, i = bsAtoms.nextSetBit(0); i >= 0; i = bsAtoms - .nextSetBit(i), iAtom++) { - if (atoms[i].getElementNumber() != 1) - lastData = sData[pt++]; - newData[iAtom] = lastData; - } - return PT.join(newData, '\n', 0); - } + // we aren't doing this anymore + // it was for TLS groups +// if (data instanceof String) { +// String[] sData = PT.split((String) data, "\n"); +// String[] newData = new String[bsAtoms.cardinality()]; +// String lastData = ""; +// for (int pt = 0, iAtom = 0, i = bsAtoms.nextSetBit(0); i >= 0; i = bsAtoms +// .nextSetBit(i + 1), iAtom++) { +// if (atoms[i].getElementNumber() == 1) { +// if (!toHydrogens) +// continue; +// } else { +// lastData = sData[pt++]; +// } +// newData[iAtom] = lastData; +// } +// return PT.join(newData, '\n', 0); +// } + // already float data float[] fData = (float[]) data; float[] newData = new float[bsAtoms.cardinality()]; float lastData = 0; for (int pt = 0, iAtom = 0, i = bsAtoms.nextSetBit(0); i >= 0; i = bsAtoms - .nextSetBit(i), iAtom++) { - if (atoms[i].getElementNumber() != 1) + .nextSetBit(i + 1), iAtom++) { + if (atoms[i].getElementNumber() == 1) { + if (!toHydrogens) + continue; + } else { lastData = fData[pt++]; + } newData[iAtom] = lastData; } return newData; Modified: trunk/Jmol/src/org/jmol/script/ScriptCompiler.java =================================================================== --- trunk/Jmol/src/org/jmol/script/ScriptCompiler.java 2014-07-27 09:39:36 UTC (rev 19884) +++ trunk/Jmol/src/org/jmol/script/ScriptCompiler.java 2014-07-27 12:18:00 UTC (rev 19885) @@ -1052,8 +1052,8 @@ } switch (tokCommand) { case T.show: - // allowing for show annotation to take up rest of line - if (nTokens != 2 || lastToken.tok != T.annotations) + // allowing for show annotations and validation to take up rest of line + if (nTokens != 2 || lastToken.tok != T.annotations && lastToken.tok != T.validation) return OK; //$FALL-THROUGH$ case T.load: Modified: trunk/Jmol/src/org/jmol/script/ScriptTokenParser.java =================================================================== --- trunk/Jmol/src/org/jmol/script/ScriptTokenParser.java 2014-07-27 09:39:36 UTC (rev 19884) +++ trunk/Jmol/src/org/jmol/script/ScriptTokenParser.java 2014-07-27 12:18:00 UTC (rev 19885) @@ -685,6 +685,7 @@ case T.smiles: case T.substructure: case T.annotations: + case T.validation: addTokenToPostfix(T.string, theValue); if (!addNextTokenIf(T.comma)) return false; Modified: trunk/Jmol/src/org/jmol/scriptext/MathExt.java =================================================================== --- trunk/Jmol/src/org/jmol/scriptext/MathExt.java 2014-07-27 09:39:36 UTC (rev 19884) +++ trunk/Jmol/src/org/jmol/scriptext/MathExt.java 2014-07-27 12:18:00 UTC (rev 19885) @@ -2326,6 +2326,7 @@ case T.sequence: case T.dssr: case T.annotations: + case T.validation: return mp.addXBs(vwr.ms.getAtoms(tok, SV.sValue(args[args.length - 1]))); } Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2014-07-27 09:39:36 UTC (rev 19884) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2014-07-27 12:18:00 UTC (rev 19885) @@ -17,6 +17,11 @@ ___JmolVersion="14.2.3_2014.07.26" +new feature: select within(validation, "clashes where value>3") + + +JmolVersion="14.2.3_2014.07.26" + code: refactoring dssr/annotations/validation clases note: validation and annotations are currently served by @@ -53,8 +58,12 @@ property_RNA_pucker (711) property_bond_angles (31; max 14.12) property_clashes (2655; max 3.42) - -JmolVersion="14.2.3_2014.07.23" + + -- use examples: + + load + + JmolVersion="14.2.3_2014.07.23" bug fix: write PDB fails Modified: trunk/Jmol/src/org/jmol/viewer/PropertyManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/PropertyManager.java 2014-07-27 09:39:36 UTC (rev 19884) +++ trunk/Jmol/src/org/jmol/viewer/PropertyManager.java 2014-07-27 12:18:00 UTC (rev 19885) @@ -167,7 +167,9 @@ "JSpecView" , "<key>", "", "scriptQueueInfo" , "", "", "nmrInfo" , "<elementSymbol> or 'all' or 'shifts'", "all", - "variableInfo","<name>","all" + "variableInfo","<name>","all", + "annotationInfo" , atomExpression, "{visible}", + "validationInfo" , atomExpression, "{visible}" }; private final static int PROP_APPLET_INFO = 0; @@ -218,7 +220,9 @@ private final static int PROP_SCRIPT_QUEUE_INFO = 39; private final static int PROP_NMR_INFO = 40; private final static int PROP_VAR_INFO = 41; - private final static int PROP_COUNT = 42; + private final static int PROP_ANN_INFO = 42; + private final static int PROP_VAL_INFO = 43; + private final static int PROP_COUNT = 44; //// static methods used by Eval and Viewer //// @@ -615,6 +619,10 @@ return vwr.getStateInfo3(myParam.toString(), 0, 0); case PROP_TRANSFORM_INFO: return vwr.tm.getMatrixRotate(); + case PROP_ANN_INFO: + return getAnnotationInfo(myParam, T.annotations); + case PROP_VAL_INFO: + return getAnnotationInfo(myParam, T.validation); } String[] data = new String[PROP_COUNT]; for (int i = 0; i < PROP_COUNT; i++) { @@ -1606,6 +1614,20 @@ vwr.getAtomBitSet(atomExpression), false)); } + private SV getAnnotationInfo(Object atomExpression, int type) { + BS bsAtoms = vwr.getAtomBitSet(atomExpression); + int iModel = vwr.ms.getModelBS(bsAtoms, false).nextSetBit(0); + if (iModel < 0) + return null; + Map<String, Object> modelinfo = vwr.ms.getModelAuxiliaryInfo(iModel); + SV objAnn = (SV) modelinfo.get(type == T.annotations ? "annotations" + : "validation"); + if (objAnn == null || objAnn.tok != T.hash) + return null; + vwr.getAnnotationParser().initializeAnnotation(objAnn, type); + return objAnn.getMap().get("_list"); + } + @SuppressWarnings("unchecked") private Lst<Map<String, Object>> getMeasurementInfo() { return (Lst<Map<String, Object>>) vwr.getShapeProperty(JC.SHAPE_MEASURES, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |