X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Fanalysis%2FAncestralTaxonomyInference.java;h=11d678d323ea2bc092f05866a6a4d5807db861e6;hb=e22f363c7273fc888ef911ad1f20d520a6bf030e;hp=6b036ef2d1ae6fd6767f5758021074a053ff43fe;hpb=01586b5c6a1d65eeb20e144b5f858b9742079471;p=jalview.git diff --git a/forester/java/src/org/forester/analysis/AncestralTaxonomyInference.java b/forester/java/src/org/forester/analysis/AncestralTaxonomyInference.java index 6b036ef..11d678d 100644 --- a/forester/java/src/org/forester/analysis/AncestralTaxonomyInference.java +++ b/forester/java/src/org/forester/analysis/AncestralTaxonomyInference.java @@ -20,7 +20,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // // Contact: phylosoft @ gmail . com -// WWW: www.phylosoft.org/forester +// WWW: https://sites.google.com/site/cmzmasek/home/software/forester package org.forester.analysis; @@ -103,17 +103,6 @@ public final class AncestralTaxonomyInference { else { node = "[" + desc.getId() + "]"; } - // final List e = desc.getAllExternalDescendants(); - //TODO remove me! - // System.out.println(); - // int x = 0; - // for( final PhylogenyNode object : e ) { - // System.out.println( x + ":" ); - // System.out.println( object.getName() + " " ); - // x++; - // } - // System.out.println(); - // throw new AncestralTaxonomyInferenceException( "node " + node + " has no or inappropriate taxonomic information" ); } @@ -135,6 +124,7 @@ public final class AncestralTaxonomyInference { if ( last_common_lineage.isEmpty() ) { boolean saw_viruses = false; boolean saw_cellular_organism = false; + boolean saw_x = false; for( final String[] lineage : lineages ) { if ( lineage.length > 0 ) { if ( lineage[ 0 ].equalsIgnoreCase( UniProtTaxonomy.VIRUSES ) ) { @@ -143,14 +133,17 @@ public final class AncestralTaxonomyInference { else if ( lineage[ 0 ].equalsIgnoreCase( UniProtTaxonomy.CELLULAR_ORGANISMS ) ) { saw_cellular_organism = true; } - if ( saw_cellular_organism && saw_viruses ) { + else if ( lineage[ 0 ].equalsIgnoreCase( UniProtTaxonomy.X ) ) { + saw_x = true; + } + if ( ( saw_cellular_organism && saw_viruses ) || saw_x ) { break; } } } - if ( saw_cellular_organism && saw_viruses ) { - last_common_lineage.add( UniProtTaxonomy.CELLULAR_ORGANISMS ); - last_common = UniProtTaxonomy.CELLULAR_ORGANISMS; + if ( ( saw_cellular_organism && saw_viruses ) || saw_x ) { + last_common_lineage.add( UniProtTaxonomy.X ); + last_common = UniProtTaxonomy.X; } else { String msg = "no common lineage for:\n";