// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
// 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
// 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
// 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.
// 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
//
// Contact: phylosoft @ gmail . com
// 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
//
// Contact: phylosoft @ gmail . com
import org.forester.phylogeny.PhylogenyNode;
import org.forester.phylogeny.iterators.PhylogenyNodeIterator;
import org.forester.phylogeny.PhylogenyNode;
import org.forester.phylogeny.iterators.PhylogenyNodeIterator;
phylogeny.reRoot( phylogeny.getNode( child0_name ) );
evaluator_phylogeny.reRoot( evaluator_phylogeny.getNode( child0_name ) );
}
phylogeny.reRoot( phylogeny.getNode( child0_name ) );
evaluator_phylogeny.reRoot( evaluator_phylogeny.getNode( child0_name ) );
}
.extractExternalNamesPerNode( phylogeny );
return ( SupportCount.compare( phylogeny,
evaluator_phylogeny,
.extractExternalNamesPerNode( phylogeny );
return ( SupportCount.compare( phylogeny,
evaluator_phylogeny,
*/
private static double compare( final Phylogeny phylogeny,
final Phylogeny evaluator_phylogeny,
*/
private static double compare( final Phylogeny phylogeny,
final Phylogeny evaluator_phylogeny,
final boolean update_support_in_phylogeny,
final double similarity_threshold ) {
int matching_branches = 0;
final boolean update_support_in_phylogeny,
final double similarity_threshold ) {
int matching_branches = 0;
for( final Object element : evaluator_phylogeny_it.next().getAllExternalDescendants() ) {
c1.add( ( ( PhylogenyNode ) element ).getName() );
}
for( final Object element : evaluator_phylogeny_it.next().getAllExternalDescendants() ) {
c1.add( ( ( PhylogenyNode ) element ).getName() );
}
final List<String> c2 = phylogeny_external_names_per_node.get( id );
if ( ( c2.size() == c1.size() ) && c2.containsAll( c1 ) ) {
if ( c2.size() > 1 ) {
final List<String> c2 = phylogeny_external_names_per_node.get( id );
if ( ( c2.size() == c1.size() ) && c2.containsAll( c1 ) ) {
if ( c2.size() > 1 ) {
}
final String child0_name = phylogeny.getFirstExternalNode().getName();
phylogeny.reRoot( phylogeny.getNode( child0_name ) );
}
final String child0_name = phylogeny.getFirstExternalNode().getName();
phylogeny.reRoot( phylogeny.getNode( child0_name ) );
if ( strip_evaluator_phylogenies ) {
unstripped_evaluator_phylogeny = evaluator_phylogeny.copy();
SupportCount.strip( seq_names_to_keep, evaluator_phylogeny );
if ( strip_evaluator_phylogenies ) {
unstripped_evaluator_phylogeny = evaluator_phylogeny.copy();
SupportCount.strip( seq_names_to_keep, evaluator_phylogeny );
}
final double s = SupportCount.compare( phylogeny,
evaluator_phylogenies[ i ],
}
final double s = SupportCount.compare( phylogeny,
evaluator_phylogenies[ i ],
- final HashMap<Integer, ArrayList<String>> phylogeny_external_names_per_node = new HashMap<Integer, ArrayList<String>>();
+ final HashMap<Long, ArrayList<String>> phylogeny_external_names_per_node = new HashMap<Long, ArrayList<String>>();
for( final PhylogenyNodeIterator it = phylogeny.iteratorPostorder(); it.hasNext(); ) {
final PhylogenyNode n = it.next();
final List<PhylogenyNode> l = n.getAllExternalDescendants();
final ArrayList<String> c = new ArrayList<String>();
for( final PhylogenyNodeIterator it = phylogeny.iteratorPostorder(); it.hasNext(); ) {
final PhylogenyNode n = it.next();
final List<PhylogenyNode> l = n.getAllExternalDescendants();
final ArrayList<String> c = new ArrayList<String>();