- // some stat on gene tree:
- // filename, name
- // number of external nodes, strppided nodes
- // some stats on sepcies tree, external nodes,
- // filename, name
- // internal nodes
- // how many of which are polytomies
- //wrote log file to
- // if ( allow_stripping_of_gene_tree ) {
- // stripped x nodes, y external nodes remain
- // }
+ }
+
+ private static void printMappedNodesToLog( final EasyWriter log_writer, final GSDI gsdi ) throws IOException {
+ final SortedSet<String> ss = new TreeSet<String>();
+ for( final PhylogenyNode n : gsdi.getMappedExternalSpeciesTreeNodes() ) {
+ ss.add( n.toString() );
+ }
+ log_writer.println( "The following " + ss.size() + " species were used: " );
+ for( final String s : ss ) {
+ log_writer.println( " " + s );
+ }
+ }
+
+ private static void printStrippedGeneTreeNodesToLog( final EasyWriter log_writer, final GSDI gsdi )
+ throws IOException {
+ final SortedMap<String, Integer> sm = new TreeMap<String, Integer>();
+ for( final PhylogenyNode n : gsdi.getStrippedExternalGeneTreeNodes() ) {
+ final String s = n.toString();
+ if ( sm.containsKey( s ) ) {
+ sm.put( s, sm.get( s ) + 1 );
+ }
+ else {
+ sm.put( s, 1 );
+ }
+ }
+ log_writer.println( "The following " + sm.size() + " nodes were stripped from the gene tree: " );
+ for( final String s : sm.keySet() ) {
+ final int count = sm.get( s );
+ if ( count == 1 ) {
+ log_writer.println( " " + s );
+ }
+ else {
+ log_writer.println( " " + s + " [" + count + "]" );
+ }
+ }
+ }
+
+ private static void printStrippedSpeciesTreeNodesToLog( final EasyWriter log_writer, final GSDI gsdi )
+ throws IOException {
+ final SortedSet<String> ss = new TreeSet<String>();
+ for( final PhylogenyNode n : gsdi.getStrippedSpeciesTreeNodes() ) {
+ ss.add( n.toString() );
+ }
+ log_writer.println( "The following " + ss.size() + " nodes were stripped from the species tree: " );
+ for( final String n : ss ) {
+ log_writer.println( " " + n );
+ }