From: <ha...@us...> - 2010-11-07 23:00:29
|
Revision: 14605 http://jmol.svn.sourceforge.net/jmol/?rev=14605&view=rev Author: hansonr Date: 2010-11-07 23:00:22 +0000 (Sun, 07 Nov 2010) Log Message: ----------- version=12.1.20 PDB read/write bug fix. # bug fix: WRITE PDB not padding to 80 char # TODO: WRITE PDB not adding TER records # bug fix: PDB reader not flagging models as PDB properly when all groups are same amino acid Modified Paths: -------------- trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/PdbReader.java trunk/Jmol/src/org/jmol/modelset/ModelCollection.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties Modified: trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/PdbReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/PdbReader.java 2010-11-07 21:28:12 UTC (rev 14604) +++ trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/PdbReader.java 2010-11-07 23:00:22 UTC (rev 14605) @@ -69,6 +69,7 @@ private Map<String, String> htHetero = null; private Map<String, Map<String, Object>> htSites = null; private String currentGroup3; + private int currentResno = Integer.MIN_VALUE; private Map<String, Boolean> htElementsInCurrentGroup; private int maxSerial; private int[] chainAtomCounts; @@ -558,10 +559,12 @@ if (atom.group3 == null) { if (currentGroup3 != null) { currentGroup3 = null; + currentResno = Integer.MIN_VALUE; htElementsInCurrentGroup = null; } - } else if (!atom.group3.equals(currentGroup3)) { + } else if (!atom.group3.equals(currentGroup3) || atom.sequenceNumber != currentResno) { currentGroup3 = atom.group3; + currentResno = atom.sequenceNumber; htElementsInCurrentGroup = htFormul.get(atom.group3); nRes++; if (atom.group3.equals("UNK")) @@ -855,9 +858,10 @@ } private void checkNotPDB() { - if (atomSetCollection.getAtomCount() > 0 && nUNK == nRes) + if (nRes > 0 && nUNK == nRes) atomSetCollection.setAtomSetAuxiliaryInfo("isPDB", Boolean.FALSE); nUNK = nRes = 0; + currentGroup3 = null; } private void cryst1() throws Exception { Modified: trunk/Jmol/src/org/jmol/modelset/ModelCollection.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/ModelCollection.java 2010-11-07 21:28:12 UTC (rev 14604) +++ trunk/Jmol/src/org/jmol/modelset/ModelCollection.java 2010-11-07 23:00:22 UTC (rev 14605) @@ -1138,23 +1138,25 @@ || Character.isDigit(sa.charAt(0))); if (!models[a.modelIndex].isPDB) tokens = (leftJustify ? - (t4x == null ? LabelToken.compile(viewer, "HETATM%5.-5i %-4.4a%1AUNK %1c 1%1E %8.3x%8.3y%8.3z%6.2Q%6.2b %2[symbol]\n", '\0', null) + (t4x == null ? LabelToken.compile(viewer, "HETATM%5.-5i %-4.4a%1AUNK %1c 1%1E %8.3x%8.3y%8.3z%6.2Q%6.2b ", '\0', null) : t4x) - : (t3x == null ? LabelToken.compile(viewer, "HETATM%5.-5i %-3.3a%1AUNK %1c 1%1E %8.3x%8.3y%8.3z%6.2Q%6.2b %2[symbol]\n", '\0', null) + : (t3x == null ? LabelToken.compile(viewer, "HETATM%5.-5i %-3.3a%1AUNK %1c 1%1E %8.3x%8.3y%8.3z%6.2Q%6.2b ", '\0', null) : t3x)); else if (a.isHetero()) tokens = (leftJustify ? - (t4h == null ? LabelToken.compile(viewer, "HETATM%5.-5i %-4.4a%1A%3.-3n %1c%4.-4R%1E %8.3x%8.3y%8.3z%6.2Q%6.2b %2[symbol]\n", '\0', null) + (t4h == null ? LabelToken.compile(viewer, "HETATM%5.-5i %-4.4a%1A%3.-3n %1c%4.-4R%1E %8.3x%8.3y%8.3z%6.2Q%6.2b ", '\0', null) : t4h) - : (t3h == null ? LabelToken.compile(viewer, "HETATM%5.-5i %-3.3a%1A%3.-3n %1c%4.-4R%1E %8.3x%8.3y%8.3z%6.2Q%6.2b %2[symbol]\n", '\0', null) + : (t3h == null ? LabelToken.compile(viewer, "HETATM%5.-5i %-3.3a%1A%3.-3n %1c%4.-4R%1E %8.3x%8.3y%8.3z%6.2Q%6.2b ", '\0', null) : t3h)); else tokens = (leftJustify ? - (t4a == null ? LabelToken.compile(viewer, "ATOM %5.-5i %-4.4a%1A%3.-3n %1c%4.-4R%1E %8.3x%8.3y%8.3z%6.2Q%6.2b %2[symbol]\n", '\0', null) + (t4a == null ? LabelToken.compile(viewer, "ATOM %5.-5i %-4.4a%1A%3.-3n %1c%4.-4R%1E %8.3x%8.3y%8.3z%6.2Q%6.2b ", '\0', null) : t4a) - : (t3a == null ? LabelToken.compile(viewer, "ATOM %5.-5i %-3.3a%1A%3.-3n %1c%4.-4R%1E %8.3x%8.3y%8.3z%6.2Q%6.2b %2[symbol]\n", '\0', null) + : (t3a == null ? LabelToken.compile(viewer, "ATOM %5.-5i %-3.3a%1A%3.-3n %1c%4.-4R%1E %8.3x%8.3y%8.3z%6.2Q%6.2b ", '\0', null) : t3a)); - sb.append(LabelToken.formatLabel(viewer, a, null, tokens, '\0', null)); + String XX = a.getElementSymbol(false).toUpperCase(); + sb.append(LabelToken.formatLabel(viewer, a, null, tokens, '\0', null)) + .append(XX.length() == 1 ? " " + XX : XX.substring(0, 2)).append(" \n"); } if (showModels) sb.append("ENDMDL\n"); Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2010-11-07 21:28:12 UTC (rev 14604) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2010-11-07 23:00:22 UTC (rev 14605) @@ -1,8 +1,12 @@ # Developers: to add a description of changes you have made, # add it on a line starting with # below the "version=..." line -# version=12.1.20_dev +version=12.1.20 +# bug fix: WRITE PDB not padding to 80 char +# TODO: WRITE PDB not adding TER records +# bug fix: PDB reader not flagging models as PDB properly when all groups are same amino acid + # -------------------------------------------------------------- # version=12.1.19 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |