in progress
[jalview.git] / forester / java / src / org / forester / tools / SupportCount.java
index a3c7fa8..e542c5e 100644 (file)
@@ -5,7 +5,7 @@
 // Copyright (C) 2008-2009 Christian M. Zmasek
 // Copyright (C) 2008-2009 Burnham Institute for Medical Research
 // All rights reserved
-// 
+//
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
@@ -15,7 +15,7 @@
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 // Lesser General Public License for more details.
-// 
+//
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -33,6 +33,7 @@ import java.util.NoSuchElementException;
 
 import org.forester.phylogeny.Phylogeny;
 import org.forester.phylogeny.PhylogenyMethods;
+import org.forester.phylogeny.PhylogenyMethods.DESCENDANT_SORT_PRIORITY;
 import org.forester.phylogeny.PhylogenyNode;
 import org.forester.phylogeny.iterators.PhylogenyNodeIterator;
 
@@ -195,11 +196,17 @@ public final class SupportCount {
             if ( strip_evaluator_phylogenies ) {
                 unstripped_evaluator_phylogeny = evaluator_phylogeny.copy();
                 SupportCount.strip( seq_names_to_keep, evaluator_phylogeny );
-                evaluator_phylogeny.orderAppearance( true ); // This is for
+                PhylogenyMethods.orderAppearance( evaluator_phylogeny.getRoot(),
+                                                  true,
+                                                  true,
+                                                  DESCENDANT_SORT_PRIORITY.TAXONOMY ); // This is for
                 // easer
                 // comparison if
                 // phylos are saved
                 // to file.
+                evaluator_phylogeny.externalNodesHaveChanged();
+                evaluator_phylogeny.hashIDs();
+                evaluator_phylogeny.recalculateNumberOfExternalDescendants( true );
             }
             final double s = SupportCount.compare( phylogeny,
                                                    evaluator_phylogenies[ i ],
@@ -207,7 +214,10 @@ public final class SupportCount {
                                                    true,
                                                    similarity_threshold );
             if ( ( similarity_threshold < 0.0 ) || ( s >= similarity_threshold ) ) {
-                unstripped_evaluator_phylogeny.orderAppearance( true );
+                PhylogenyMethods.orderAppearance( unstripped_evaluator_phylogeny.getRoot(),
+                                                  true,
+                                                  true,
+                                                  DESCENDANT_SORT_PRIORITY.TAXONOMY );
                 evaluator_phylogenies_above_threshold.add( unstripped_evaluator_phylogeny );
             }
             if ( verbose ) {