fixed uniquify seq[]
authorjprocter <Jim Procter>
Mon, 22 Aug 2005 15:40:28 +0000 (15:40 +0000)
committerjprocter <Jim Procter>
Mon, 22 Aug 2005 15:40:28 +0000 (15:40 +0000)
src/jalview/analysis/SeqsetUtils.java

index 78f7278..662322a 100755 (executable)
@@ -36,6 +36,7 @@ import jalview.datamodel.*;
  */\r
 public class SeqsetUtils\r
 {\r
+\r
   /**\r
    * Store essential properties of a sequence in a hashtable for later recovery\r
    *  Keys are Name, Start, End, SeqFeatures, PdbId\r
@@ -116,20 +117,18 @@ public class SeqsetUtils
     Hashtable map = new Hashtable();\r
     String[] un_names = new String[sequences.length];\r
 \r
-    if (!write_names)\r
+    for (int i = 0; i < sequences.length; i++)\r
     {\r
-      for (int i = 0; i < sequences.length; i++)\r
-      {\r
-        String safename = new String("Sequence" + i);\r
-        map.put(safename, SeqCharacterHash(sequences[i]));\r
+      String safename = unique_name(i);\r
+      map.put(safename, SeqCharacterHash(sequences[i]));\r
 \r
-        if (write_names)\r
-        {\r
-          sequences[i].setName(safename);\r
-        }\r
+      if (write_names)\r
+      {\r
+        sequences[i].setName(safename);\r
       }\r
     }\r
 \r
+\r
     return map;\r
   }\r
 \r