X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FArchaeopteryx.java;h=648fd6537f678a6d01b60cd15694fbfbf3b6a82b;hb=6ffcf85ecb3a59181ef75a41d679952cf085f457;hp=46ac48cc68b51ba1bfa143344341934728fdc998;hpb=5958d8c92c06f76da04a466ef7636e93a640b6a3;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/Archaeopteryx.java b/forester/java/src/org/forester/archaeopteryx/Archaeopteryx.java index 46ac48c..648fd65 100644 --- a/forester/java/src/org/forester/archaeopteryx/Archaeopteryx.java +++ b/forester/java/src/org/forester/archaeopteryx/Archaeopteryx.java @@ -21,7 +21,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // // Contact: phylosoft @ gmail . com -// WWW: www.phylosoft.org/forester +// WWW: https://sites.google.com/site/cmzmasek/home/software/forester package org.forester.archaeopteryx; @@ -36,12 +36,6 @@ import org.forester.phylogeny.Phylogeny; import org.forester.phylogeny.PhylogenyMethods; import org.forester.util.ForesterUtil; -// -// java -javaagent:shiftone-jrat.jar -cp -// $HOME/SOFTWARE_DEV/ECLIPSE_WORKSPACE/forester-atv/java/forester.jar:. -// org.forester.archaeopteryx.Archaeopteryx -// -c $HOME/SOFTWARE_DEV/ECLIPSE_WORKSPACE/forester-atv/_aptx_configuration_file -// public final class Archaeopteryx { public static MainFrame createApplication( final Phylogeny phylogeny ) { @@ -60,6 +54,12 @@ public final class Archaeopteryx { return MainFrameApplication.createInstance( phylogenies, config_file_name, title ); } + public static MainFrame createApplication( final Phylogeny phylogeny, final Configuration config, final String title ) { + final Phylogeny[] phylogenies = new Phylogeny[ 1 ]; + phylogenies[ 0 ] = phylogeny; + return MainFrameApplication.createInstance( phylogenies, config, title ); + } + public static void main( final String args[] ) { Phylogeny[] phylogenies = null; String config_filename = null; @@ -94,11 +94,7 @@ public final class Archaeopteryx { final NHXParser nhx = ( NHXParser ) p; nhx.setReplaceUnderscores( conf.isReplaceUnderscoresInNhParsing() ); nhx.setIgnoreQuotes( false ); - PhylogenyMethods.TAXONOMY_EXTRACTION te = PhylogenyMethods.TAXONOMY_EXTRACTION.NO; - if ( conf.isExtractPfamTaxonomyCodesInNhParsing() ) { - te = PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY; - } - nhx.setTaxonomyExtraction( te ); + nhx.setTaxonomyExtraction( conf.getTaxonomyExtraction() ); } else if ( p instanceof NexusPhylogeniesParser ) { nhx_or_nexus = true; @@ -112,7 +108,7 @@ public final class Archaeopteryx { phylogenies = PhylogenyMethods.readPhylogenies( p, f ); if ( nhx_or_nexus && conf.isInternalNumberAreConfidenceForNhParsing() ) { for( final Phylogeny phy : phylogenies ) { - PhylogenyMethods.transferInternalNodeNamesToConfidence( phy ); + PhylogenyMethods.transferInternalNodeNamesToConfidence( phy, "" ); } } } @@ -125,14 +121,21 @@ 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 ) { - AptxUtil.unexpectedException( ex ); + catch ( final OutOfMemoryError e ) { + AptxUtil.outOfMemoryError( e ); + } + catch ( final Exception e ) { + AptxUtil.unexpectedException( e ); } - catch ( final Error err ) { - AptxUtil.unexpectedError( err ); + catch ( final Error e ) { + AptxUtil.unexpectedError( e ); } } } \ No newline at end of file