X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FArchaeopteryx.java;h=7f96bdd1337bd5c5add0fe3f30d4190f7e7b4a5d;hb=bfc7a76aa65c3fafda5602bfff43b3e3222a04f7;hp=8bd8df52971bb78523159d6140bf1bf797e26659;hpb=724bd2bd4cbc5b3ea5ec856d156fa37b93b3d0fb;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/Archaeopteryx.java b/forester/java/src/org/forester/archaeopteryx/Archaeopteryx.java index 8bd8df5..7f96bdd 100644 --- a/forester/java/src/org/forester/archaeopteryx/Archaeopteryx.java +++ b/forester/java/src/org/forester/archaeopteryx/Archaeopteryx.java @@ -31,7 +31,9 @@ import org.forester.io.parsers.PhylogenyParser; import org.forester.io.parsers.nexus.NexusPhylogeniesParser; import org.forester.io.parsers.nhx.NHXParser; import org.forester.io.parsers.phyloxml.PhyloXmlParser; +import org.forester.io.parsers.util.ParserUtils; import org.forester.phylogeny.Phylogeny; +import org.forester.phylogeny.PhylogenyMethods; import org.forester.util.ForesterUtil; // @@ -66,7 +68,7 @@ public final class Archaeopteryx { try { int filename_index = 0; if ( args.length == 0 ) { - conf = new Configuration( null, false, false ); + conf = new Configuration( null, false, false, true ); } else if ( args.length > 0 ) { // check for a config file @@ -77,7 +79,7 @@ public final class Archaeopteryx { if ( args[ 0 ].startsWith( "-open" ) ) { filename_index += 1; } - conf = new Configuration( config_filename, false, false ); + conf = new Configuration( config_filename, false, false, true ); if ( args.length > filename_index ) { f = new File( args[ filename_index ] ); final String err = ForesterUtil.isReadableFile( f ); @@ -85,16 +87,16 @@ public final class Archaeopteryx { ForesterUtil.fatalError( Constants.PRG_NAME, err ); } boolean nhx_or_nexus = false; - final PhylogenyParser p = ForesterUtil.createParserDependingOnFileType( f, conf + final PhylogenyParser p = ParserUtils.createParserDependingOnFileType( f, conf .isValidatePhyloXmlAgainstSchema() ); if ( p instanceof NHXParser ) { nhx_or_nexus = true; final NHXParser nhx = ( NHXParser ) p; nhx.setReplaceUnderscores( conf.isReplaceUnderscoresInNhParsing() ); nhx.setIgnoreQuotes( false ); - ForesterUtil.TAXONOMY_EXTRACTION te = ForesterUtil.TAXONOMY_EXTRACTION.NO; + PhylogenyMethods.TAXONOMY_EXTRACTION te = PhylogenyMethods.TAXONOMY_EXTRACTION.NO; if ( conf.isExtractPfamTaxonomyCodesInNhParsing() ) { - te = ForesterUtil.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY; + te = PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY; } nhx.setTaxonomyExtraction( te ); } @@ -107,10 +109,10 @@ public final class Archaeopteryx { else if ( p instanceof PhyloXmlParser ) { MainFrameApplication.warnIfNotPhyloXmlValidation( conf ); } - phylogenies = ForesterUtil.readPhylogenies( p, f ); + phylogenies = PhylogenyMethods.readPhylogenies( p, f ); if ( nhx_or_nexus && conf.isInternalNumberAreConfidenceForNhParsing() ) { for( final Phylogeny phy : phylogenies ) { - ForesterUtil.transferInternalNodeNamesToConfidence( phy ); + PhylogenyMethods.transferInternalNodeNamesToConfidence( phy ); } } } @@ -123,14 +125,18 @@ public final class Archaeopteryx { if ( f != null ) { title = f.getName(); } + File current_dir = null; + if ( ( phylogenies != null ) && ( phylogenies.length > 0 ) ) { + current_dir = new File( "." ); + } try { - MainFrameApplication.createInstance( phylogenies, conf, title ); + MainFrameApplication.createInstance( phylogenies, conf, title, current_dir ); } catch ( final Exception ex ) { - Util.unexpectedException( ex ); + AptxUtil.unexpectedException( ex ); } catch ( final Error err ) { - Util.unexpectedError( err ); + AptxUtil.unexpectedError( err ); } } } \ No newline at end of file