final Result res = Analysis.execute( p, query );
System.out.println();
System.out.println( "Result:" );
- System.out.println( "Greatest common prefix a : " + res.getGreatestCommonPrefix() );
- System.out.println( "Greatest common prefix a (up) : " + res.getGreatestCommonPrefixUp() );
- System.out.println( "Greatest common prefix b (down): " + res.getGreatestCommonPrefixDown() );
+ System.out.println( "Greatest common prefix : " + res.getGreatestCommonPrefix() );
+ System.out.println( "Greatest common prefix up : " + res.getGreatestCommonPrefixUp() );
+ System.out.println( "Greatest common prefix down: " + res.getGreatestCommonPrefixDown() );
final double lec_ratio = ( 100.0 * res.getLeastEncompassingCladeSize() ) / res.getTreeSize();
System.out.println( "Least Encompassing Clade has " + res.getLeastEncompassingCladeSize()
+ " external nodes (" + df2.format( lec_ratio ) + "% of a total of " + res.getTreeSize() + ")" );
// * More tests (including multiple children per node), especially on edge cases
// * Utilize relevant support values for warnings
// * Better system for "clade label creation" (e.g. 1.3.4 + 1.3.6 -> 1.3), use
-// specific separator (eg . | _ )
+// specific separator (eg . | _ )
package org.forester.clade_analysis;
}
private final static String analyzeSiblings( final PhylogenyNode child, final PhylogenyNode parent ) {
- final int qnode_p_index = child.getChildNodeIndex();
- final List<String> qnode_ext_nodes_names_a = new ArrayList<>();
+ final int child_index = child.getChildNodeIndex();
+ final List<String> ext_nodes_names = new ArrayList<>();
final List<PhylogenyNode> descs = parent.getDescendants();
for( int i = 0; i < descs.size(); ++i ) {
- if ( i != qnode_p_index ) {
+ if ( i != child_index ) {
final PhylogenyNode d = descs.get( i );
for( final PhylogenyNode n : d.getAllExternalDescendants() ) {
final String name = n.getName();
if ( ForesterUtil.isEmptyTrimmed( name ) ) {
throw new IllegalArgumentException( "external node(s) with empty names found" );
}
- qnode_ext_nodes_names_a.add( name.trim() );
+ ext_nodes_names.add( name.trim() );
}
}
}
- final String greatest_common_prefix_a = ForesterUtil.greatestCommonPrefix( qnode_ext_nodes_names_a );
- return greatest_common_prefix_a;
+ final String greatest_common_prefix = ForesterUtil.greatestCommonPrefix( ext_nodes_names );
+ return greatest_common_prefix;
}
}