public final class ResultMulti {
- private final String _separator;
- private final List<Prefix> _greatest_common_prefixes = new ArrayList<>();
- private final List<Prefix> _greatest_common_prefixes_up = new ArrayList<>();
- private final List<Prefix> _greatest_common_prefixes_down = new ArrayList<>();
- private List<Prefix> _all = null;
- private List<Prefix> _collapsed = null;
- private List<Prefix> _cleaned_spec = null;
- private boolean _has_specifics = false;
- private List<Prefix> _all_up = null;
- private List<Prefix> _collapsed_up = null;
- private List<Prefix> _cleaned_spec_up = null;
- private boolean _has_specifics_up = false;
- private List<Prefix> _all_down = null;
- private List<Prefix> _collapsed_down = null;
- private List<Prefix> _cleaned_spec_down = null;
- private boolean _has_specifics_down = false;
- private String _query_name_prefix = "";
+ private final static double MIN_DIFF = 1E-5;
+ private final String _separator;
+ private final List<Prefix> _greatest_common_prefixes = new ArrayList<>();
+ private final List<Prefix> _greatest_common_prefixes_up = new ArrayList<>();
+ private final List<Prefix> _greatest_common_prefixes_down = new ArrayList<>();
+ private List<Prefix> _all = null;
+ private List<Prefix> _collapsed = null;
+ private List<Prefix> _cleaned_spec = null;
+ private boolean _has_specifics = false;
+ private List<Prefix> _all_up = null;
+ private List<Prefix> _collapsed_up = null;
+ private List<Prefix> _cleaned_spec_up = null;
+ private boolean _has_specifics_up = false;
+ private List<Prefix> _all_down = null;
+ private List<Prefix> _collapsed_down = null;
+ private List<Prefix> _cleaned_spec_down = null;
+ private boolean _has_specifics_down = false;
+ private int _matches = 0;
+ private int _ref_tree_ext_nodes = 0;
+ private String _query_name_prefix = "";
ResultMulti( final String separator ) {
+ if ( ForesterUtil.isEmpty( separator ) ) {
+ throw new IllegalArgumentException( "separator must not be null or empty" );
+ }
_separator = separator;
reset();
}
return _query_name_prefix;
}
+ public int getNumberOfMatches() {
+ return _matches;
+ }
+
+ public int getReferenceTreeNumberOfExternalNodes() {
+ return _ref_tree_ext_nodes;
+ }
+
@Override
public final String toString() {
final StringBuilder sb = new StringBuilder();
sb.append( ForesterUtil.LINE_SEPARATOR );
}
}
+ sb.append( ForesterUtil.LINE_SEPARATOR );
+ sb.append( "Total Number of Matches: " + getNumberOfMatches() + "/" + getReferenceTreeNumberOfExternalNodes() );
+ sb.append( ForesterUtil.LINE_SEPARATOR );
return sb.toString();
}
_query_name_prefix = query_name_prefix;
}
+ void setTotalNumberOfMatches( final int matches ) {
+ if ( _matches > 0 ) {
+ throw new IllegalStateException( "illegal attempt to change the number of matches" );
+ }
+ _matches = matches;
+ }
+
+ public void setReferenceTreeNumberOfExternalNodes( final int ext_nodes ) {
+ if ( _ref_tree_ext_nodes > 0 ) {
+ throw new IllegalStateException( "illegal attempt to change the number of external nodes" );
+ }
+ _ref_tree_ext_nodes = ext_nodes;
+ }
+
final void analyze( final double cutoff_for_specifics ) throws UserException {
reset();
analyzeGreatestCommonPrefixes( _greatest_common_prefixes, _separator, cutoff_for_specifics );
final List<Prefix> l = obtainAllPrefixes( greatest_common_prefixes, separator );
if ( !ForesterUtil.isEmpty( l ) ) {
sortPrefixesAccordingToConfidence( l );
- _all = removeLessSpecificPrefixes( l );
+ _all = removeLessSpecificPrefixes( l, separator );
_collapsed = collapse( _all );
_has_specifics = false;
if ( cutoff >= 0 ) {
- _cleaned_spec = obtainSpecifics( cutoff, _all, _collapsed );
+ _cleaned_spec = obtainSpecifics( cutoff, _all, _collapsed, separator );
if ( !ForesterUtil.isEmpty( _cleaned_spec ) ) {
_has_specifics = true;
}
final List<Prefix> l = obtainAllPrefixes( greatest_common_prefixes_up, separator );
if ( !ForesterUtil.isEmpty( l ) ) {
sortPrefixesAccordingToConfidence( l );
- _all_up = removeLessSpecificPrefixes( l );
+ _all_up = removeLessSpecificPrefixes( l, separator );
_collapsed_up = collapse( _all_up );
_has_specifics_up = false;
if ( cutoff >= 0 ) {
- _cleaned_spec_up = obtainSpecifics( cutoff, _all_up, _collapsed_up );
+ _cleaned_spec_up = obtainSpecifics( cutoff, _all_up, _collapsed_up, separator );
if ( !ForesterUtil.isEmpty( _cleaned_spec_up ) ) {
_has_specifics_up = true;
}
final List<Prefix> l = obtainAllPrefixes( greatest_common_prefixes_down, separator );
if ( !ForesterUtil.isEmpty( l ) ) {
sortPrefixesAccordingToConfidence( l );
- _all_down = removeLessSpecificPrefixes( l );
+ _all_down = removeLessSpecificPrefixes( l, separator );
_collapsed_down = collapse( _all_down );
_has_specifics_down = false;
if ( cutoff >= 0 ) {
- _cleaned_spec_down = obtainSpecifics( cutoff, _all_down, _collapsed_down );
+ _cleaned_spec_down = obtainSpecifics( cutoff, _all_down, _collapsed_down, separator );
if ( !ForesterUtil.isEmpty( _cleaned_spec_down ) ) {
_has_specifics_down = true;
}
final static List<Prefix> obtainSpecifics( final double cutoff,
final List<Prefix> cleaned,
- final List<Prefix> collapsed ) {
+ final List<Prefix> collapsed,
+ final String separator ) {
final List<Prefix> cleaned_spec = new ArrayList<>();
final Set<String> collapsed_set = new HashSet<>();
for( final Prefix prefix : collapsed ) {
for( final Prefix o : spec ) {
boolean ok = true;
for( final Prefix i : spec ) {
- if ( ( !o.getPrefix().equals( i.getPrefix() ) ) && ( i.getPrefix().startsWith( o.getPrefix() ) ) ) {
+ if ( ( !o.getPrefix().equals( i.getPrefix() ) )
+ && ( ForesterUtil.isContainsPrefix( i.getPrefix(), o.getPrefix(), separator ) ) ) {
ok = false;
break;
}
+ /* if ( ( !o.getPrefix().equals( i.getPrefix() ) ) && ( i.getPrefix().startsWith( o.getPrefix() ) ) ) {
+ ok = false;
+ break;
+ }*/
}
if ( ok ) {
cleaned_spec.add( o );
confidence_sum += prefix.getConfidence();
}
}
- if ( !ForesterUtil.isEqual( confidence_sum, 1.0, 1E-5 ) ) {
+ if ( !ForesterUtil.isEqual( confidence_sum, 1.0, MIN_DIFF ) ) {
throw new UserException( "confidences add up to " + confidence_sum + " instead of 1.0" );
}
return collapsed;
* I.e. it removes less specific prefixes.
*
*/
- private final static List<Prefix> removeLessSpecificPrefixes( final List<Prefix> l ) {
+ private final static List<Prefix> removeLessSpecificPrefixes( final List<Prefix> l, final String separator ) {
final List<Prefix> cleaned = new ArrayList<>();
for( final Prefix o : l ) {
boolean ok = true;
for( final Prefix i : l ) {
- if ( ( !o.getPrefix().equals( i.getPrefix() ) ) && ( i.getPrefix().startsWith( o.getPrefix() ) )
+ /*if ( ( !o.getPrefix().equals( i.getPrefix() ) ) && ( i.getPrefix().startsWith( o.getPrefix() ) )
+ && ForesterUtil.isEqual( i.getConfidence(),
+ o.getConfidence() ) ) {
+ ok = false;
+ break;
+ }*/
+ if ( ( !o.getPrefix().equals( i.getPrefix() ) )
+ && ( ForesterUtil.isContainsPrefix( i.getPrefix(), o.getPrefix(), separator ) )
&& ForesterUtil.isEqual( i.getConfidence(),
o.getConfidence() ) ) {
ok = false;
}
for( final String key : map.keySet() ) {
for( final Prefix prefix : greatest_common_prefixes ) {
- if ( prefix.getPrefix().startsWith( key ) ) {
+ if ( ForesterUtil.isContainsPrefix( prefix.getPrefix(), key, separator ) ) {
map.put( key, map.get( key ) + prefix.getConfidence() );
}
}
succeeded++;
}
System.out.println( "OK." );
-
System.out.print( "Common prefix: " );
if ( !testCommonPrefix() ) {
System.out.println( "failed." );
succeeded++;
}
System.out.println( "OK." );
-
System.out.print( "Common prefix sep: " );
if ( !testCommonPrefixSep() ) {
System.out.println( "failed." );
succeeded++;
}
System.out.println( "OK." );
-
-
+ System.out.print( "Contains prefix: " );
+ if ( !testContainsPrefix() ) {
+ System.out.println( "failed." );
+ failed++;
+ }
+ else {
+ succeeded++;
+ }
+ System.out.println( "OK." );
System.out.print( "Sequence writer: " );
if ( testSequenceWriter() ) {
System.out.println( "OK." );
}
}
-
private static boolean testEngulfingOverlapRemoval() {
try {
final Domain d0 = new BasicDomain( "d0", 0, 8, ( short ) 1, ( short ) 1, 0.1, 1 );
final Domain d4 = new BasicDomain( "d4", 7, 9, ( short ) 1, ( short ) 1, 0.1, 1 );
final Domain d5 = new BasicDomain( "d4", 0, 9, ( short ) 1, ( short ) 1, 0.1, 1 );
final Domain d6 = new BasicDomain( "d4", 4, 5, ( short ) 1, ( short ) 1, 0.1, 1 );
- final List<Boolean> covered = new ArrayList<Boolean>();
+ final List<Boolean> covered = new ArrayList<>();
covered.add( true ); // 0
covered.add( false ); // 1
covered.add( true ); // 2
final Domain d2 = new BasicDomain( "d2", ( short ) 0, ( short ) 20, ( short ) 1, ( short ) 1, 0.1, 1 );
final Domain d3 = new BasicDomain( "d3", ( short ) 9, ( short ) 10, ( short ) 1, ( short ) 1, 0.1, 1 );
final Domain d4 = new BasicDomain( "d4", ( short ) 7, ( short ) 8, ( short ) 1, ( short ) 1, 0.1, 1 );
- final List<Boolean> covered = new ArrayList<Boolean>();
+ final List<Boolean> covered = new ArrayList<>();
covered.add( true ); // 0
covered.add( false ); // 1
covered.add( true ); // 2
return true;
}
-
private static boolean testCommonPrefix() {
- final List<String> l0 = new ArrayList<String>();
+ final List<String> l0 = new ArrayList<>();
l0.add( "abc" );
if ( !ForesterUtil.greatestCommonPrefix( l0 ).equals( "abc" ) ) {
return false;
}
-
- final List<String> l1 = new ArrayList<String>();
+ final List<String> l1 = new ArrayList<>();
l1.add( "abc" );
l1.add( "abX" );
if ( !ForesterUtil.greatestCommonPrefix( l1 ).equals( "ab" ) ) {
return false;
}
-
- final List<String> l2 = new ArrayList<String>();
+ final List<String> l2 = new ArrayList<>();
l2.add( "abc" );
l2.add( "abX" );
l2.add( "axy" );
if ( !ForesterUtil.greatestCommonPrefix( l2 ).equals( "a" ) ) {
return false;
}
-
- final List<String> l3 = new ArrayList<String>();
+ final List<String> l3 = new ArrayList<>();
l3.add( "abXsdfsdfsdfsdfsdfsd" );
l3.add( "abXsdfsdfsdfsdfsdfsd" );
l3.add( "abc" );
if ( !ForesterUtil.greatestCommonPrefix( l3 ).equals( "ab" ) ) {
return false;
}
-
- final List<String> l4 = new ArrayList<String>();
+ final List<String> l4 = new ArrayList<>();
l4.add( "abXsdfsdfsdfsdfsdfsd" );
l4.add( "abXsdfsdfsdfsdfsdfsd" );
l4.add( "abc" );
if ( !ForesterUtil.greatestCommonPrefix( l4 ).equals( "" ) ) {
return false;
}
-
- final List<String> l5 = new ArrayList<String>();
+ final List<String> l5 = new ArrayList<>();
l5.add( "" );
if ( !ForesterUtil.greatestCommonPrefix( l5 ).equals( "" ) ) {
return false;
}
-
- final List<String> l6 = new ArrayList<String>();
+ final List<String> l6 = new ArrayList<>();
l6.add( "abc" );
l6.add( "abX" );
l6.add( "" );
}
return true;
}
-
+
private static boolean testCommonPrefixSep() {
- final List<String> l0 = new ArrayList<String>();
+ final List<String> l0 = new ArrayList<>();
l0.add( "a.b.c" );
- if ( !ForesterUtil.greatestCommonPrefix( l0, ".").equals( "a.b.c" ) ) {
+ if ( !ForesterUtil.greatestCommonPrefix( l0, "." ).equals( "a.b.c" ) ) {
return false;
}
-
- final List<String> l1 = new ArrayList<String>();
+ final List<String> l1 = new ArrayList<>();
l1.add( "a.b.c" );
l1.add( "a.b.X" );
- if ( !ForesterUtil.greatestCommonPrefix( l1 , ".").equals( "a.b" ) ) {
+ if ( !ForesterUtil.greatestCommonPrefix( l1, "." ).equals( "a.b" ) ) {
return false;
}
-
- final List<String> l2 = new ArrayList<String>();
+ final List<String> l2 = new ArrayList<>();
l2.add( "a.b.c." );
l2.add( "a.b.X." );
l2.add( "a.x.y." );
- if ( !ForesterUtil.greatestCommonPrefix( l2, ".").equals( "a" ) ) {
+ if ( !ForesterUtil.greatestCommonPrefix( l2, "." ).equals( "a" ) ) {
return false;
}
-
- final List<String> l3 = new ArrayList<String>();
+ final List<String> l3 = new ArrayList<>();
l3.add( "a/b/X/s/d/f/s/d/f/s/d/f/s/d/f/s/d/f/s/d/" );
l3.add( "a/b/X/s/d/f/s/d/f/s/d/f/s/d/f/s/d/f/s/d" );
l3.add( "a/b/c" );
if ( !ForesterUtil.greatestCommonPrefix( l3, "/" ).equals( "a/b" ) ) {
return false;
}
-
- final List<String> l4 = new ArrayList<String>();
+ final List<String> l4 = new ArrayList<>();
l4.add( "a.b.X.s.d.f.s.d.f.s.d.f.s.d.f.s.d.f.s.d" );
l4.add( "a.b.X.s.d.f.s.d.f.s.d.f.s.d.f.s.d.f.s.d" );
l4.add( "a.b.c" );
if ( !ForesterUtil.greatestCommonPrefix( l4, "." ).equals( "" ) ) {
return false;
}
-
- final List<String> l5 = new ArrayList<String>();
+ final List<String> l5 = new ArrayList<>();
l5.add( "" );
if ( !ForesterUtil.greatestCommonPrefix( l5, "_" ).equals( "" ) ) {
return false;
}
-
- final List<String> l6 = new ArrayList<String>();
+ final List<String> l6 = new ArrayList<>();
l6.add( "_" );
l6.add( "__" );
if ( !ForesterUtil.greatestCommonPrefix( l6, "_" ).equals( "" ) ) {
return false;
}
-
- final List<String> l7 = new ArrayList<String>();
+ final List<String> l7 = new ArrayList<>();
l7.add( "a,b,c" );
l7.add( "a,b,X" );
l7.add( "" );
if ( !ForesterUtil.greatestCommonPrefix( l7, "," ).equals( "" ) ) {
return false;
}
-
- final List<String> l8 = new ArrayList<String>();
+ final List<String> l8 = new ArrayList<>();
l8.add( "123.304.403.04" );
l8.add( "123.304.403.04.02" );
l8.add( "123.304.403.03.03" );
if ( !ForesterUtil.greatestCommonPrefix( l8, "." ).equals( "123.304.403" ) ) {
return false;
}
-
- final List<String> l9 = new ArrayList<String>();
+ final List<String> l9 = new ArrayList<>();
l9.add( "123.304.403.04" );
l9.add( "123.304.403.04.02" );
l9.add( "123.304.402.03.03" );
if ( !ForesterUtil.greatestCommonPrefix( l9, "." ).equals( "123.304" ) ) {
return false;
}
+ final List<String> l10 = new ArrayList<>();
+ l10.add( "abcde" );
+ l10.add( "adc" );
+ if ( !ForesterUtil.greatestCommonPrefix( l10, "." ).equals( "" ) ) {
+ return false;
+ }
+ return true;
+ }
+
+ private static boolean testContainsPrefix() {
+ if ( !ForesterUtil.isContainsPrefix( "a.b", "a", "." ) ) {
+ return false;
+ }
+ if ( !ForesterUtil.isContainsPrefix( "a.b.c", "a", "." ) ) {
+ return false;
+ }
+ if ( !ForesterUtil.isContainsPrefix( "a.b.c", "a.b", "." ) ) {
+ return false;
+ }
+ if ( !ForesterUtil.isContainsPrefix( "a.b", "a.b", "." ) ) {
+ return false;
+ }
+ if ( !ForesterUtil.isContainsPrefix( "a", "a", "." ) ) {
+ return false;
+ }
+ if ( !ForesterUtil.isContainsPrefix( ".a.b", ".a", "." ) ) {
+ return false;
+ }
+ if ( !ForesterUtil.isContainsPrefix( ".a.b.", ".a", "." ) ) {
+ return false;
+ }
+ if ( !ForesterUtil.isContainsPrefix( ".a.b.", ".a.", "." ) ) {
+ return false;
+ }
+ if ( !ForesterUtil.isContainsPrefix( "a..b.", "a", "." ) ) {
+ return false;
+ }
+ if ( !ForesterUtil.isContainsPrefix( "a..b.", "a..", "." ) ) {
+ return false;
+ }
+ if ( ForesterUtil.isContainsPrefix( "a", "a.b", "." ) ) {
+ return false;
+ }
+ if ( ForesterUtil.isContainsPrefix( "a_b", "a", "." ) ) {
+ return false;
+ }
+ if ( ForesterUtil.isContainsPrefix( ".a.", ".a.b.", "." ) ) {
+ return false;
+ }
+ if ( ForesterUtil.isContainsPrefix( "a.b.c", "a.x", "." ) ) {
+ return false;
+ }
return true;
}
-
private static boolean testUTF8ParsingFromFile() {
try {
final PhyloXmlParser xml_parser = PhyloXmlParser.createPhyloXmlParser();
p.addProteinDomain( A20 );
p.addProteinDomain( B25 );
p.addProteinDomain( D80 );
- List<String> domains_ids = new ArrayList<String>();
+ List<String> domains_ids = new ArrayList<>();
domains_ids.add( "A" );
domains_ids.add( "B" );
domains_ids.add( "C" );
if ( p.contains( domains_ids, true ) ) {
return false;
}
- domains_ids = new ArrayList<String>();
+ domains_ids = new ArrayList<>();
domains_ids.add( "A" );
domains_ids.add( "C" );
domains_ids.add( "D" );
if ( !p.contains( domains_ids, true ) ) {
return false;
}
- domains_ids = new ArrayList<String>();
+ domains_ids = new ArrayList<>();
domains_ids.add( "A" );
domains_ids.add( "D" );
domains_ids.add( "C" );
if ( p.contains( domains_ids, true ) ) {
return false;
}
- domains_ids = new ArrayList<String>();
+ domains_ids = new ArrayList<>();
domains_ids.add( "A" );
domains_ids.add( "A" );
domains_ids.add( "B" );
if ( !p.contains( domains_ids, true ) ) {
return false;
}
- domains_ids = new ArrayList<String>();
+ domains_ids = new ArrayList<>();
domains_ids.add( "A" );
domains_ids.add( "A" );
domains_ids.add( "A" );
if ( !p.contains( domains_ids, true ) ) {
return false;
}
- domains_ids = new ArrayList<String>();
+ domains_ids = new ArrayList<>();
domains_ids.add( "A" );
domains_ids.add( "A" );
domains_ids.add( "B" );
private static boolean testBasicTable() {
try {
- final BasicTable<String> t0 = new BasicTable<String>();
+ final BasicTable<String> t0 = new BasicTable<>();
if ( t0.getNumberOfColumns() != 0 ) {
return false;
}
final ProteinDomain d2 = new ProteinDomain( "domain2", 50, 60 );
final ProteinDomain d3 = new ProteinDomain( "domain3", 70, 80 );
final ProteinDomain d4 = new ProteinDomain( "domain4", 90, 100 );
- final ArrayList<PhylogenyData> domains0 = new ArrayList<PhylogenyData>();
+ final ArrayList<PhylogenyData> domains0 = new ArrayList<>();
domains0.add( d2 );
domains0.add( d0 );
domains0.add( d3 );
if ( ds1.getNumberOfDomains() != 4 ) {
return false;
}
- final ArrayList<PhylogenyData> domains1 = new ArrayList<PhylogenyData>();
+ final ArrayList<PhylogenyData> domains1 = new ArrayList<>();
domains1.add( d1 );
domains1.add( d2 );
domains1.add( d4 );
private static boolean testGeneralTable() {
try {
- final GeneralTable<Integer, String> t0 = new GeneralTable<Integer, String>();
+ final GeneralTable<Integer, String> t0 = new GeneralTable<>();
t0.setValue( 3, 2, "23" );
t0.setValue( 10, 1, "error" );
t0.setValue( 10, 1, "110" );
if ( !t0.getValueAsString( 22349, 3434344 ).equals( "" ) ) {
return false;
}
- final GeneralTable<String, String> t1 = new GeneralTable<String, String>();
+ final GeneralTable<String, String> t1 = new GeneralTable<>();
t1.setValue( "3", "2", "23" );
t1.setValue( "10", "1", "error" );
t1.setValue( "10", "1", "110" );
private static boolean testMafft( final String path ) {
try {
- final List<String> opts = new ArrayList<String>();
+ final List<String> opts = new ArrayList<>();
opts.add( "--maxiterate" );
opts.add( "1000" );
opts.add( "--localpair" );
final MolecularSequence s1 = BasicSequence.createAaSequence( "b", "ABBXEFGHIJJBB" );
final MolecularSequence s2 = BasicSequence.createAaSequence( "c", "AXCXEFGHIJJ--" );
final MolecularSequence s3 = BasicSequence.createAaSequence( "d", "AXDDEFGHIJ---" );
- final List<MolecularSequence> l = new ArrayList<MolecularSequence>();
+ final List<MolecularSequence> l = new ArrayList<>();
l.add( s0 );
l.add( s1 );
l.add( s2 );
final MolecularSequence s1 = BasicSequence.createAaSequence( "b", "AAAIACC" );
final MolecularSequence s2 = BasicSequence.createAaSequence( "c", "AAIIIIF" );
final MolecularSequence s3 = BasicSequence.createAaSequence( "d", "AIIIVVW" );
- final List<MolecularSequence> l = new ArrayList<MolecularSequence>();
+ final List<MolecularSequence> l = new ArrayList<>();
l.add( s0 );
l.add( s1 );
l.add( s2 );
// System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 6, msa, 4 ) );
// System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 6, msa, 5 ) );
// System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 6, msa, 6 ) );
- final List<MolecularSequence> l2 = new ArrayList<MolecularSequence>();
+ final List<MolecularSequence> l2 = new ArrayList<>();
l2.add( BasicSequence.createAaSequence( "1", "AAAAAAA" ) );
l2.add( BasicSequence.createAaSequence( "2", "AAAIACC" ) );
l2.add( BasicSequence.createAaSequence( "3", "AAIIIIF" ) );
final MolecularSequence s3 = BasicSequence.createAaSequence( "d", "DAAA" );
final MolecularSequence s4 = BasicSequence.createAaSequence( "e", "EAAA" );
final MolecularSequence s5 = BasicSequence.createAaSequence( "f", "FAAA" );
- final List<MolecularSequence> l0 = new ArrayList<MolecularSequence>();
+ final List<MolecularSequence> l0 = new ArrayList<>();
l0.add( s0 );
l0.add( s1 );
l0.add( s2 );
final MolecularSequence s_3 = BasicSequence.createAaSequence( "d", "--D--AA-C-------" );
final MolecularSequence s_4 = BasicSequence.createAaSequence( "e", "--E--AA-C-------" );
final MolecularSequence s_5 = BasicSequence.createAaSequence( "f", "--F--AB-CD--Y---" );
- final List<MolecularSequence> l1 = new ArrayList<MolecularSequence>();
+ final List<MolecularSequence> l1 = new ArrayList<>();
l1.add( s_0 );
l1.add( s_1 );
l1.add( s_2 );
final MolecularSequence s__3 = BasicSequence.createAaSequence( "d", "DDDD---" );
final MolecularSequence s__4 = BasicSequence.createAaSequence( "e", "EEEEE--" );
final MolecularSequence s__5 = BasicSequence.createAaSequence( "f", "FFFFFF-" );
- final List<MolecularSequence> l2 = new ArrayList<MolecularSequence>();
+ final List<MolecularSequence> l2 = new ArrayList<>();
l2.add( s__0 );
l2.add( s__1 );
l2.add( s__2 );
try {
final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
PhylogenyNode n;
- List<PhylogenyNode> ext = new ArrayList<PhylogenyNode>();
+ List<PhylogenyNode> ext = new ArrayList<>();
final StringBuffer sb0 = new StringBuffer( "((a,b)ab,(((c,d)cd,e)cde,(f,(g,h))fgh)cdefgh)abcdefgh" );
final Phylogeny t0 = factory.create( sb0.toString(), new NHXParser() )[ 0 ];
t0.getNode( "cd" ).setCollapse( true );
t1.getNode( "cd" ).setCollapse( true );
t1.getNode( "cde" ).setCollapse( true );
n = t1.getNode( "ab" );
- ext = new ArrayList<PhylogenyNode>();
+ ext = new ArrayList<>();
while ( n != null ) {
ext.add( n );
n = n.getNextExternalNodeWhileTakingIntoAccountCollapsedNodes();
t2.getNode( "e" ).setCollapse( true );
t2.getNode( "gh" ).setCollapse( true );
n = t2.getNode( "ab" );
- ext = new ArrayList<PhylogenyNode>();
+ ext = new ArrayList<>();
while ( n != null ) {
ext.add( n );
n = n.getNextExternalNodeWhileTakingIntoAccountCollapsedNodes();
t3.getNode( "gh" ).setCollapse( true );
t3.getNode( "fgh" ).setCollapse( true );
n = t3.getNode( "ab" );
- ext = new ArrayList<PhylogenyNode>();
+ ext = new ArrayList<>();
while ( n != null ) {
ext.add( n );
n = n.getNextExternalNodeWhileTakingIntoAccountCollapsedNodes();
final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
final Phylogeny p0 = factory.create( "(((A,B,C),D),(E,(F,G)))R", new NHXParser() )[ 0 ];
//Archaeopteryx.createApplication( p0 );
- final Set<PhylogenyNode> ex = new HashSet<PhylogenyNode>();
+ final Set<PhylogenyNode> ex = new HashSet<>();
ex.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
ex.add( PhylogenyNode.createInstanceFromNhxString( "B" ) );
ex.add( PhylogenyNode.createInstanceFromNhxString( "C" ) );
final TreeSplitMatrix s0 = new TreeSplitMatrix( p0, false, ex );
// System.out.println( s0.toString() );
//
- Set<PhylogenyNode> query_nodes = new HashSet<PhylogenyNode>();
+ Set<PhylogenyNode> query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "B" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "B" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "C" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "B" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "C" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "D" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "B" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "C" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "G" ) );
if ( !s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "G" ) );
if ( !s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "D" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "C" ) );
if ( !s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "G" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
if ( !s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "G" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
if ( !s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "B" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "G" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "B" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "D" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "D" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "B" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "C" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "G" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "G" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "B" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "D" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "D" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "D" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
// return false;
// }
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "X" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "Y" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "X" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "Y" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
}
///////////////////////////
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "X" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "Y" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "X" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "Y" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "X" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "Y" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "X" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "Y" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "X" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "Y" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "Y" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "G" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "X" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "Y" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "X" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "Y" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "X" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "Y" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "X" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "Y" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
try {
final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
final Phylogeny p0 = factory.create( "(((A,B,C),D),(E,(F,G)))R", new NHXParser() )[ 0 ];
- final Set<PhylogenyNode> ex = new HashSet<PhylogenyNode>();
+ final Set<PhylogenyNode> ex = new HashSet<>();
ex.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
ex.add( PhylogenyNode.createInstanceFromNhxString( "B" ) );
ex.add( PhylogenyNode.createInstanceFromNhxString( "C" ) );
ex.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
ex.add( PhylogenyNode.createInstanceFromNhxString( "G" ) );
final TreeSplitMatrix s0 = new TreeSplitMatrix( p0, true, ex );
- Set<PhylogenyNode> query_nodes = new HashSet<PhylogenyNode>();
+ Set<PhylogenyNode> query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "B" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "B" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "C" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "B" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "C" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "D" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "B" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "C" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "G" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "G" ) );
if ( !s0.match( query_nodes ) ) {
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "D" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "C" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "G" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "G" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "B" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "G" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "B" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "D" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "D" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "B" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "C" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "G" ) );
if ( s0.match( query_nodes ) ) {
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "F" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "G" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "B" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "D" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "D" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
return false;
}
//
- query_nodes = new HashSet<PhylogenyNode>();
+ query_nodes = new HashSet<>();
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "E" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "D" ) );
query_nodes.add( PhylogenyNode.createInstanceFromNhxString( "A" ) );
}
return true;
}
-
+
private static boolean testPhylogenyMethods() {
try {
final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
final Phylogeny t0 = factory.create( "((((A,B)ab,C)abc,D)abcd,E)r", new NHXParser() )[ 0 ];
-
if ( PhylogenyMethods.calculateLevel( t0.getNode( "A" ) ) != 0 ) {
return false;
}
if ( PhylogenyMethods.calculateLevel( t0.getNode( "r" ) ) != 4 ) {
return false;
}
- final Phylogeny t1 = factory.create( "((((A,B)ab,C)abc,D)abcd,E,((((((X)1)2)3)4)5)6)r", new NHXParser() )[ 0 ];
+ final Phylogeny t1 = factory.create( "((((A,B)ab,C)abc,D)abcd,E,((((((X)1)2)3)4)5)6)r",
+ new NHXParser() )[ 0 ];
if ( PhylogenyMethods.calculateLevel( t1.getNode( "r" ) ) != 7 ) {
return false;
}
if ( PhylogenyMethods.calculateLevel( t1.getNode( "abcd" ) ) != 3 ) {
return false;
}
-
}
catch ( final Exception e ) {
e.printStackTrace( System.out );