}
AptxUtil.printAppletMessage( "Archaeopteryx", "parser is " + parser.getName() );
final Phylogeny[] phys = factory.create( url.openStream(), parser );
- for( final Phylogeny phy : phys ) {
- System.out.println( phy.toString() );
- }
- if ( nhx_or_nexus && internal_numbers_are_confidences ) {
- for( final Phylogeny phy : phys ) {
- PhylogenyMethods.transferInternalNodeNamesToConfidence( phy );
+ if ( phys != null ) {
+ if ( nhx_or_nexus && internal_numbers_are_confidences ) {
+ for( final Phylogeny phy : phys ) {
+ PhylogenyMethods.transferInternalNodeNamesToConfidence( phy );
+ }
}
- }
- if ( midpoint_reroot ) {
- for( final Phylogeny phy : phys ) {
- PhylogenyMethods.midpointRoot( phy );
- PhylogenyMethods.orderAppearance( phy.getRoot(), true, true, DESCENDANT_SORT_PRIORITY.NODE_NAME );
+ if ( midpoint_reroot ) {
+ for( final Phylogeny phy : phys ) {
+ PhylogenyMethods.midpointRoot( phy );
+ PhylogenyMethods.orderAppearance( phy.getRoot(), true, true, DESCENDANT_SORT_PRIORITY.NODE_NAME );
+ }
}
}
return phys;
.isValidatePhyloXmlAgainstSchema(), configuration.isReplaceUnderscoresInNhParsing(), configuration
.isInternalNumberAreConfidenceForNhParsing(), configuration.getTaxonomyExtraction(), configuration
.isMidpointReroot() );
+ if ( phys == null ) {
+ ForesterUtil.printErrorMessage( NAME, "phylogenies from [" + tree_url + "] are null" );
+ }
+ else if ( phys.length < 1 ) {
+ ForesterUtil.printErrorMessage( NAME, "phylogenies from [" + tree_url + "] are empty" );
+ }
+ else {
+ AptxUtil.printAppletMessage( NAME, "loaded " + phys.length + " phylogenies from: " + tree_url );
+ }
AptxUtil.printAppletMessage( ArchaeopteryxA.NAME, "loaded " + phys.length + " phylogenies from: "
+ tree_url );
AptxUtil.addPhylogeniesToTabs( phys,
public final static boolean __SYNTH_LF = false; // TODO remove me
public final static boolean ALLOW_DDBJ_BLAST = false;
public final static String PRG_NAME = "Archaeopteryx";
- final static String VERSION = "0.984 FX";
- final static String PRG_DATE = "140121";
+ final static String VERSION = "0.985 CC";
+ final static String PRG_DATE = "140218";
final static String DEFAULT_CONFIGURATION_FILE_NAME = "_aptx_configuration_file";
final static String[] DEFAULT_FONT_CHOICES = { "Arial", "Helvetica",
"Verdana", "Tahoma", "Dialog", "Lucida Sans", "SansSerif", "Sans-serif", "Sans" };
System.out.println( "failed." );
failed++;
}
+ System.out.print( "phyloXML parsing from URL: " );
+ if ( Test.testPhyloXMLparsingFromURL() ) {
+ System.out.println( "OK." );
+ succeeded++;
+ }
+ else {
+ System.out.println( "failed." );
+ failed++;
+ }
System.out.println();
final Runtime rt = java.lang.Runtime.getRuntime();
final long free_memory = rt.freeMemory() / 1000000;
return true;
}
+ public static final boolean testPhyloXMLparsingFromURL() {
+ try {
+ final String s = "https://sites.google.com/site/cmzmasek/home/software/archaeopteryx/examples/archaeopteryx_a/apaf_bcl2.xml";
+ final URL u = new URL( s );
+ final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
+ final Phylogeny[] phys = factory.create( u.openStream(), PhyloXmlParser.createPhyloXmlParser() );
+ if ( ( phys == null ) || ( phys.length != 2 ) ) {
+ return false;
+ }
+ }
+ catch ( final Exception e ) {
+ e.printStackTrace();
+ }
+ return true;
+ }
+
public static final boolean testNHXparsingFromURL() {
try {
final String s = "https://sites.google.com/site/cmzmasek/home/software/archaeopteryx/examples/simple/simple_1.nh";