JAL-1965 formatting
authorJim Procter <jprocter@issues.jalview.org>
Fri, 13 Nov 2015 12:47:16 +0000 (12:47 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Fri, 13 Nov 2015 12:47:16 +0000 (12:47 +0000)
src/jalview/analysis/SequenceIdMatcher.java

index 17ff216..0fde224 100755 (executable)
@@ -90,8 +90,7 @@ public class SequenceIdMatcher
    *          - when true, "myseq" matches "X|myseq" and "myseq"
    * @param seqs
    */
-  public SequenceIdMatcher(boolean wordBasedMatch,
-          List<SequenceI> seqs)
+  public SequenceIdMatcher(boolean wordBasedMatch, List<SequenceI> seqs)
   {
     wordBased = wordBasedMatch;
     names = new HashMap<SeqIdName, Set<SequenceI>>();
@@ -124,39 +123,38 @@ public class SequenceIdMatcher
 
   public void addSeq(SequenceI seq)
   {
-      // TODO: deal with ID collisions - SequenceI should be appended to list
-      // associated with this key.
+    // TODO: deal with ID collisions - SequenceI should be appended to list
+    // associated with this key.
     addSeqIdName(new SeqIdName(seq.getDisplayId(true)), seq);
-      if (wordBased)
+    if (wordBased)
+    {
+      for (SeqIdName key : getWordsFor(seq))
       {
-        for (SeqIdName key : getWordsFor(seq))
-        {
         addSeqIdName(key, seq);
-        }
       }
-      SequenceI dbseq = seq;
+    }
+    SequenceI dbseq = seq;
     // TODO add test for database xref resolution
-      while (dbseq.getDatasetSequence() != null)
-      {
-        dbseq = dbseq.getDatasetSequence();
-      }
-      // add in any interesting identifiers
-      if (dbseq.getDBRefs() != null)
+    while (dbseq.getDatasetSequence() != null)
+    {
+      dbseq = dbseq.getDatasetSequence();
+    }
+    // add in any interesting identifiers
+    if (dbseq.getDBRefs() != null)
+    {
+      DBRefEntry dbr[] = dbseq.getDBRefs();
+      SeqIdName sid = null;
+      for (int r = 0; r < dbr.length; r++)
       {
-        DBRefEntry dbr[] = dbseq.getDBRefs();
-        SeqIdName sid = null;
-        for (int r = 0; r < dbr.length; r++)
+        sid = new SeqIdName(dbr[r].getAccessionId());
+        if (!names.containsKey(sid))
         {
-          sid = new SeqIdName(dbr[r].getAccessionId());
-          if (!names.containsKey(sid))
-          {
           addSeqIdName(sid, seq);
-          }
         }
+      }
     }
   }
 
-
   /**
    * generate word based keys for the given sequence
    *