From 619edf1dd8026422bf60d9d746947559cad4be28 Mon Sep 17 00:00:00 2001 From: "cmzmasek@gmail.com" Date: Thu, 28 Jul 2011 22:34:16 +0000 Subject: [PATCH] search binary characters --- .../org/forester/phylogeny/PhylogenyMethods.java | 45 ++++++++++++++------ 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/forester/java/src/org/forester/phylogeny/PhylogenyMethods.java b/forester/java/src/org/forester/phylogeny/PhylogenyMethods.java index b118fb5..2d238a2 100644 --- a/forester/java/src/org/forester/phylogeny/PhylogenyMethods.java +++ b/forester/java/src/org/forester/phylogeny/PhylogenyMethods.java @@ -985,15 +985,16 @@ public class PhylogenyMethods { } } } - else if ( node.getNodeData().isHasSequence() + if ( !match && node.getNodeData().isHasSequence() && match( node.getNodeData().getSequence().getName(), query, case_sensitive, partial ) ) { match = true; } - else if ( node.getNodeData().isHasSequence() + if ( !match && node.getNodeData().isHasSequence() && match( node.getNodeData().getSequence().getSymbol(), query, case_sensitive, partial ) ) { match = true; } - else if ( node.getNodeData().isHasSequence() + if ( !match + && node.getNodeData().isHasSequence() && ( node.getNodeData().getSequence().getAccession() != null ) && match( node.getNodeData().getSequence().getAccession().getValue(), query, @@ -1001,7 +1002,7 @@ public class PhylogenyMethods { partial ) ) { match = true; } - else if ( node.getNodeData().isHasSequence() + if ( !match && node.getNodeData().isHasSequence() && ( node.getNodeData().getSequence().getDomainArchitecture() != null ) ) { final DomainArchitecture da = node.getNodeData().getSequence().getDomainArchitecture(); I: for( int i = 0; i < da.getNumberOfDomains(); ++i ) { @@ -1011,9 +1012,16 @@ public class PhylogenyMethods { } } } - else if ( node.getNodeData().getBinaryCharacters() != null ) { - final String[] bc_ary = node.getNodeData().getBinaryCharacters().getPresentCharactersAsStringArray(); - I: for( final String bc : bc_ary ) { + if ( !match && ( node.getNodeData().getBinaryCharacters() != null ) ) { + final String[] bcp_ary = node.getNodeData().getBinaryCharacters().getPresentCharactersAsStringArray(); + I: for( final String bc : bcp_ary ) { + if ( match( bc, query, case_sensitive, partial ) ) { + match = true; + break I; + } + } + final String[] bcg_ary = node.getNodeData().getBinaryCharacters().getGainedCharactersAsStringArray(); + I: for( final String bc : bcg_ary ) { if ( match( bc, query, case_sensitive, partial ) ) { match = true; break I; @@ -1076,15 +1084,16 @@ public class PhylogenyMethods { } } } - else if ( node.getNodeData().isHasSequence() + if ( !match && node.getNodeData().isHasSequence() && match( node.getNodeData().getSequence().getName(), query, case_sensitive, partial ) ) { match = true; } - else if ( node.getNodeData().isHasSequence() + if ( !match && node.getNodeData().isHasSequence() && match( node.getNodeData().getSequence().getSymbol(), query, case_sensitive, partial ) ) { match = true; } - else if ( node.getNodeData().isHasSequence() + if ( !match + && node.getNodeData().isHasSequence() && ( node.getNodeData().getSequence().getAccession() != null ) && match( node.getNodeData().getSequence().getAccession().getValue(), query, @@ -1092,7 +1101,7 @@ public class PhylogenyMethods { partial ) ) { match = true; } - else if ( node.getNodeData().isHasSequence() + if ( !match && node.getNodeData().isHasSequence() && ( node.getNodeData().getSequence().getDomainArchitecture() != null ) ) { final DomainArchitecture da = node.getNodeData().getSequence().getDomainArchitecture(); I: for( int i = 0; i < da.getNumberOfDomains(); ++i ) { @@ -1102,10 +1111,18 @@ public class PhylogenyMethods { } } } - else if ( node.getNodeData().getBinaryCharacters() != null ) { - final String[] bc_ary = node.getNodeData().getBinaryCharacters() + if ( !match && ( node.getNodeData().getBinaryCharacters() != null ) ) { + final String[] bcp_ary = node.getNodeData().getBinaryCharacters() .getPresentCharactersAsStringArray(); - I: for( final String bc : bc_ary ) { + I: for( final String bc : bcp_ary ) { + if ( match( bc, query, case_sensitive, partial ) ) { + match = true; + break I; + } + } + final String[] bcg_ary = node.getNodeData().getBinaryCharacters() + .getGainedCharactersAsStringArray(); + I: for( final String bc : bcg_ary ) { if ( match( bc, query, case_sensitive, partial ) ) { match = true; break I; -- 1.7.10.2