import org.forester.io.parsers.util.ParserUtils;
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.data.Accession;
import org.forester.phylogeny.data.BranchColor;
final boolean phyloxml_validate_against_xsd,
final boolean replace_underscores,
final boolean internal_numbers_are_confidences,
- final TAXONOMY_EXTRACTION taxonomy_extraction )
- throws FileNotFoundException, IOException {
+ final TAXONOMY_EXTRACTION taxonomy_extraction,
+ final boolean midpoint_reroot ) throws FileNotFoundException,
+ IOException {
final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
final PhylogenyParser parser;
boolean nhx_or_nexus = false;
PhylogenyMethods.transferInternalNodeNamesToConfidence( phy );
}
}
+ if ( midpoint_reroot ) {
+ for( final Phylogeny phy : phys ) {
+ PhylogenyMethods.midpointRoot( phy );
+ PhylogenyMethods.orderAppearance( phy.getRoot(), true, true, DESCENDANT_SORT_PRIORITY.NODE_NAME );
+ }
+ }
return phys;
}