JAL-2089 patch broken merge to master for Release 2.10.0b1
[jalview.git] / src / MCview / Atom.java
index 4d000af..904e307 100755 (executable)
@@ -20,6 +20,8 @@
  */
 package MCview;
 
+import jalview.schemes.ResidueProperties;
+
 import java.awt.Color;
 
 public class Atom
@@ -73,6 +75,8 @@ public class Atom
     name = str.substring(12, 15).trim();
 
     resName = str.substring(17, 20);
+    // JAL-1828 treat MSE Selenomethionine as MET (etc)
+    resName = ResidueProperties.getCanonicalAminoAcid(resName);
 
     chain = str.substring(21, 22);
 
@@ -105,6 +109,24 @@ 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;