Display nucleotides
authoramwaterhouse <Andrew Waterhouse>
Thu, 22 Sep 2005 15:49:05 +0000 (15:49 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 22 Sep 2005 15:49:05 +0000 (15:49 +0000)
src/jalview/appletgui/SeqPanel.java
src/jalview/gui/SeqPanel.java

index fb11579..9c3a1e8 100755 (executable)
@@ -244,19 +244,32 @@ public class SeqPanel
       return;\r
     }\r
 \r
-    Object obj = ResidueProperties.aa2Triplet.get(sequence.getCharAt(res) + "");\r
-    String aa = "";\r
-    if (obj != null)\r
+    StringBuffer text = new StringBuffer("Sequence " + (seq + 1) + " ID: " +\r
+            sequence.getName());\r
+\r
+    Object obj = null;\r
+    if (av.alignment.isNucleotide())\r
+    {\r
+      obj = ResidueProperties.nucleotideName.get(sequence.getCharAt(res) +\r
+          "");\r
+      if(obj!=null)\r
+        text.append(" Nucleotide: ");\r
+    }\r
+    else\r
     {\r
-      aa = obj.toString();\r
+      obj = ResidueProperties.aa2Triplet.get(sequence.getCharAt(res) + "");\r
+      if(obj!=null)\r
+        text.append("  Residue: ");\r
     }\r
 \r
-    StringBuffer text = new StringBuffer("Sequence " + (seq + 1) + " ID: " +\r
-                                         sequence.getName());\r
-    if (aa != "")\r
+    if (obj != null)\r
     {\r
-      text.append("  Residue: " + aa + " (" +\r
-                  av.getAlignment().getSequenceAt(seq).findPosition(res) + ")");\r
+\r
+      if (obj != "")\r
+      {\r
+        text.append(obj + " (" +\r
+                    av.getAlignment().getSequenceAt(seq).findPosition(res) + ")");\r
+      }\r
     }\r
 \r
     ap.alignFrame.statusBar.setText(text.toString());\r
index 8486ac1..ab5ed30 100755 (executable)
@@ -342,25 +342,35 @@ public class SeqPanel extends JPanel
 \r
       if (res > sequence.getLength())\r
       {\r
-          return;\r
-        }\r
+        return;\r
+      }\r
 \r
-        Object obj = ResidueProperties.aa2Triplet.get(sequence.getCharAt(res) +\r
-                "");\r
-        String aa = "";\r
+        StringBuffer text = new StringBuffer("Sequence " + (seq + 1) + " ID: " +\r
+                sequence.getName());\r
 \r
-        if (obj != null)\r
+        Object obj = null;\r
+        if (av.alignment.isNucleotide())\r
         {\r
-            aa = obj.toString();\r
+          obj = ResidueProperties.nucleotideName.get(sequence.getCharAt(res) +\r
+              "");\r
+          if(obj!=null)\r
+            text.append(" Nucleotide: ");\r
+        }\r
+        else\r
+        {\r
+          obj = ResidueProperties.aa2Triplet.get(sequence.getCharAt(res) + "");\r
+          if(obj!=null)\r
+            text.append("  Residue: ");\r
         }\r
 \r
-        StringBuffer text = new StringBuffer("Sequence " + (seq + 1) + " ID: " +\r
-                sequence.getName());\r
-\r
-        if (aa != "")\r
+        if (obj != null)\r
         {\r
-            text.append("  Residue: " + aa + " (" +\r
-                av.getAlignment().getSequenceAt(seq).findPosition(res) + ")");\r
+\r
+          if (obj != "")\r
+          {\r
+            text.append( obj + " (" +\r
+                        av.getAlignment().getSequenceAt(seq).findPosition(res) + ")");\r
+          }\r
         }\r
 \r
         ap.alignFrame.statusBar.setText(text.toString());\r