From 64ff443bdfeecd91f83b6b53dc30c412211529df Mon Sep 17 00:00:00 2001 From: cmzmasek Date: Tue, 18 Dec 2012 06:03:10 +0000 Subject: [PATCH] rio --- forester/java/src/org/forester/rio/RIO.java | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/forester/java/src/org/forester/rio/RIO.java b/forester/java/src/org/forester/rio/RIO.java index 30f2fff..5ba246d 100644 --- a/forester/java/src/org/forester/rio/RIO.java +++ b/forester/java/src/org/forester/rio/RIO.java @@ -485,6 +485,27 @@ public final class RIO { final Phylogeny[] gene_trees = factory.create( gene_trees_file, p ); return new RIO( gene_trees, species_tree, algorithm, rerooting, outgroup, -1, -1, produce_log, verbose ); } + + public final static RIO executeAnalysis( final File gene_trees_file, + final Phylogeny species_tree, + final ALGORITHM algorithm, + final REROOTING rerooting, + final String outgroup, + final int first, + final int last, + final boolean produce_log, + final boolean verbose ) throws IOException, SDIException, RIOException { + final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance(); + final PhylogenyParser p = ParserUtils.createParserDependingOnFileType( gene_trees_file, true ); + if ( p instanceof NHXParser ) { + final NHXParser nhx = ( NHXParser ) p; + nhx.setReplaceUnderscores( false ); + nhx.setIgnoreQuotes( true ); + nhx.setTaxonomyExtraction( NHXParser.TAXONOMY_EXTRACTION.YES ); + } + final Phylogeny[] gene_trees = factory.create( gene_trees_file, p ); + return new RIO( gene_trees, species_tree, algorithm, rerooting, outgroup, first, last, produce_log, verbose ); + } public final static RIO executeAnalysis( final Phylogeny[] gene_trees, final Phylogeny species_tree ) throws IOException, SDIException, RIOException { @@ -500,6 +521,18 @@ public final class RIO { final boolean verbose ) throws IOException, SDIException, RIOException { return new RIO( gene_trees, species_tree, algorithm, rerooting, outgroup, -1, -1, produce_log, verbose ); } + + public final static RIO executeAnalysis( final Phylogeny[] gene_trees, + final Phylogeny species_tree, + final ALGORITHM algorithm, + final REROOTING rerooting, + final String outgroup, + final int first, + final int last, + final boolean produce_log, + final boolean verbose ) throws IOException, SDIException, RIOException { + return new RIO( gene_trees, species_tree, algorithm, rerooting, outgroup, first, last, produce_log, verbose ); + } public enum REROOTING { NONE, BY_ALGORITHM, MIDPOINT, OUTGROUP; -- 1.7.10.2