- String msg = "no common lineage for:\n";
- int counter = 0;
- for( final String[] strings : lineages ) {
- msg += counter + ": ";
- ++counter;
- for( final String string : strings ) {
- msg += string + " ";
+ boolean saw_viruses = false;
+ boolean saw_cellular_organism = false;
+ for( final String[] lineage : lineages ) {
+ if ( lineage.length > 0 ) {
+ if ( lineage[ 0 ].equalsIgnoreCase( UniProtTaxonomy.VIRUSES ) ) {
+ saw_viruses = true;
+ }
+ else if ( lineage[ 0 ].equalsIgnoreCase( UniProtTaxonomy.CELLULAR_ORGANISMS ) ) {
+ saw_cellular_organism = true;
+ }
+ if ( saw_cellular_organism && saw_viruses ) {
+ break;
+ }
+ }
+ }
+ if ( saw_cellular_organism && saw_viruses ) {
+ last_common_lineage.add( UniProtTaxonomy.CELLULAR_ORGANISMS );
+ last_common = UniProtTaxonomy.CELLULAR_ORGANISMS;
+ }
+ else {
+ String msg = "no common lineage for:\n";
+ int counter = 0;
+ for( final String[] strings : lineages ) {
+ msg += counter + ": ";
+ ++counter;
+ for( final String string : strings ) {
+ msg += string + " ";
+ }
+ msg += "\n";