From c0c53d86b63599b080b7c42d80332ad9683b92d6 Mon Sep 17 00:00:00 2001 From: cmzmasek Date: Fri, 21 Jul 2017 15:54:29 -0700 Subject: [PATCH] first prototype --- .../java/src/org/forester/application/cladinator.java | 6 +++--- .../java/src/org/forester/clade_analysis/Analysis.java | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/forester/java/src/org/forester/application/cladinator.java b/forester/java/src/org/forester/application/cladinator.java index 13143b0..d482f7a 100644 --- a/forester/java/src/org/forester/application/cladinator.java +++ b/forester/java/src/org/forester/application/cladinator.java @@ -96,9 +96,9 @@ public final class cladinator { 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() + ")" ); diff --git a/forester/java/src/org/forester/clade_analysis/Analysis.java b/forester/java/src/org/forester/clade_analysis/Analysis.java index a154b12..bddd518 100644 --- a/forester/java/src/org/forester/clade_analysis/Analysis.java +++ b/forester/java/src/org/forester/clade_analysis/Analysis.java @@ -28,7 +28,7 @@ // * 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; @@ -89,22 +89,22 @@ public final class Analysis { } private final static String analyzeSiblings( final PhylogenyNode child, final PhylogenyNode parent ) { - final int qnode_p_index = child.getChildNodeIndex(); - final List qnode_ext_nodes_names_a = new ArrayList<>(); + final int child_index = child.getChildNodeIndex(); + final List ext_nodes_names = new ArrayList<>(); final List 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; } } -- 1.7.10.2