From: tcofoegbu Date: Fri, 22 Jul 2016 16:13:53 +0000 (+0100) Subject: JAL-2148 Bugfix in structureImportSettings string-to-enum conversion and further... X-Git-Tag: Release_2_10_0~134 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d28fba781c93c83b6082e74b22a8bf52d241d609;p=jalview.git JAL-2148 Bugfix in structureImportSettings string-to-enum conversion and further enhancement to deal with Atoms from multi-model entries --- diff --git a/src/MCview/Atom.java b/src/MCview/Atom.java index 68a7c21..ab038a0 100755 --- a/src/MCview/Atom.java +++ b/src/MCview/Atom.java @@ -109,6 +109,23 @@ public class Atom } } + @Override + public boolean equals(Object that) + { + if (this == that || that == null) + { + return true; + } + if (that instanceof Atom) + { + Atom other = (Atom) that; + return other.resName.equals(this.resName) + && other.resNumber == this.resNumber + && other.resNumIns.equals(this.resNumIns) + && other.chain.equals(this.chain); + } + return false; + } public Atom(float x, float y, float z) { this.x = x; diff --git a/src/jalview/ext/jmol/JmolParser.java b/src/jalview/ext/jmol/JmolParser.java index 7056f0f..baebe08 100644 --- a/src/jalview/ext/jmol/JmolParser.java +++ b/src/jalview/ext/jmol/JmolParser.java @@ -219,7 +219,12 @@ public class JmolParser extends StructureFile implements JmolStatusListener curAtom.resNumIns = "" + curAtom.resNumber + curAtom.insCode; curAtom.tfactor = atom.getBfactor100() / 100f; curAtom.type = 0; - significantAtoms.add(curAtom); + // significantAtoms.add(curAtom); + // ignore atoms from subsequent models + if (!significantAtoms.contains(curAtom)) + { + significantAtoms.add(curAtom); + } prevAtom = atom; } } @@ -230,6 +235,8 @@ public class JmolParser extends StructureFile implements JmolStatusListener org.jmol.modelset.Atom prevAtom, HashMap chainTerMap) { + // System.out.println("Atom: " + curAtom.getAtomNumber() + // + " Last atom index " + curAtom.group.lastAtomIndex); if (chainTerMap == null || prevAtom == null) { return true; diff --git a/src/jalview/structure/StructureImportSettings.java b/src/jalview/structure/StructureImportSettings.java index e969d4b..3d41a83 100644 --- a/src/jalview/structure/StructureImportSettings.java +++ b/src/jalview/structure/StructureImportSettings.java @@ -109,7 +109,7 @@ public class StructureImportSettings String defaultStructureFileFormat) { StructureImportSettings.defaultStructureFileFormat = PDBEntry.Type - .valueOf(defaultStructureFileFormat); + .valueOf(defaultStructureFileFormat.toUpperCase()); } public static String getDefaultPDBFileParser() @@ -126,7 +126,7 @@ public class StructureImportSettings public static void setDefaultPDBFileParser(String defaultPDBFileParser) { StructureImportSettings.defaultPDBFileParser = StructureParser - .valueOf(defaultPDBFileParser); + .valueOf(defaultPDBFileParser.toUpperCase()); } }