gsdi work
authorcmzmasek <cmzmasek@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 20 Jun 2012 05:23:53 +0000 (05:23 +0000)
committercmzmasek <cmzmasek@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 20 Jun 2012 05:23:53 +0000 (05:23 +0000)
forester/java/src/org/forester/sdi/GSDI.java

index 5fd72bb..8e2cdf0 100644 (file)
@@ -339,39 +339,43 @@ public final class GSDI extends SDI {
                     continue;
                 }
                 else {
-                    throw new IllegalArgumentException( "gene tree node [" + g + "] has no taxonomic data" );
+                    throw new IllegalArgumentException( "gene tree node " + g + " has no taxonomic data" );
                 }
             }
-            final String tax_str = taxonomyToString( g, tax_comp_base );
-            if ( ForesterUtil.isEmpty( tax_str ) ) {
-                if ( _strip_gene_tree ) {
-                    _stripped_gene_tree_nodes.add( g );
-                    continue;
-                }
-                else {
-                    throw new IllegalArgumentException( "gene tree node [" + g + "] has no appropriate taxonomic data" );
-                }
-            }
-            final PhylogenyNode s = speciestree_ext_nodes.get( tax_str );
-            if ( s == null ) {
-                if ( _strip_gene_tree ) {
-                    _stripped_gene_tree_nodes.add( g );
+            else {
+                final String tax_str = taxonomyToString( g, tax_comp_base );
+                if ( ForesterUtil.isEmpty( tax_str ) ) {
+                    if ( _strip_gene_tree ) {
+                        _stripped_gene_tree_nodes.add( g );
+                    }
+                    else {
+                        throw new IllegalArgumentException( "gene tree node " + g
+                                + " has no appropriate taxonomic data" );
+                    }
                 }
                 else {
-                    throw new IllegalArgumentException( "taxonomy [" + g.getNodeData().getTaxonomy()
-                            + "] not present in species tree" );
+                    final PhylogenyNode s = speciestree_ext_nodes.get( tax_str );
+                    // if ( s == null ) {
+                    //     if ( _strip_gene_tree ) {
+                    //        _stripped_gene_tree_nodes.add( g );
+                    //    }
+                    //     else {
+                    //         throw new IllegalArgumentException( "taxonomy " + g.getNodeData().getTaxonomy()
+                    //                 + " not present in species tree" );
+                    //     }
+                    // }
+                    //  else {
+                    g.setLink( s );
+                    System.out.println( "setting link of " + g + " to " + s );
+                    //  }
                 }
             }
-            else {
-                g.setLink( s );
-                System.out.println( "setting link of " + g + " to " + s );
-            }
-            if ( _strip_gene_tree ) {
-                for( final PhylogenyNode n : _stripped_gene_tree_nodes ) {
-                    if ( _gene_tree.getNode( n.getId() ) != null ) {
-                        _gene_tree.deleteSubtree( _gene_tree.getNode( n.getId() ), true );
-                    }
-                }
+        } // for loop
+        if ( _strip_gene_tree ) {
+            for( final PhylogenyNode n : _stripped_gene_tree_nodes ) {
+                //  if ( _gene_tree.getNode( n.getId() ) != null ) {
+                _gene_tree.deleteSubtree( n, true );
+                //  }
             }
         }
     }