patch for JAL-935 - warning messages raised when alignment and tree leaves are not...
authorjprocter <jprocter@compbio.dundee.ac.uk>
Fri, 16 Sep 2011 10:30:36 +0000 (11:30 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Fri, 16 Sep 2011 10:30:36 +0000 (11:30 +0100)
src/jalview/analysis/AlignmentSorter.java

index 158fe81..797af0c 100755 (executable)
@@ -456,15 +456,15 @@ public class AlignmentSorter
       // TODO: JBPNote - decide if this is always an error
       // (eg. not when a tree is associated to another alignment which has more
       // sequences)
-      if (tmp.size() < nSeq)
+      if (tmp.size() != nSeq)
       {
         addStrays(align, tmp);
       }
 
       if (tmp.size() != nSeq)
       {
-        System.err.println("ERROR: tmp.size()=" + tmp.size() + " != nseq="
-                + nSeq + " in getOrderByTree");
+        System.err.println("WARNING: tmp.size()=" + tmp.size() + " != nseq="
+                + nSeq + " in getOrderByTree - tree contains sequences not in alignment");
       }
     }
 
@@ -560,7 +560,7 @@ public class AlignmentSorter
       {
         if (node.element() instanceof SequenceI)
         {
-          if (!tmp.contains(node.element()))
+          if (!tmp.contains(node.element())) //  && (seqset==null || seqset.size()==0 || seqset.contains(tmp)))
           {
             tmp.addElement((SequenceI) node.element());
           }