public void toPhyloXML( final Phylogeny phy, final int phyloxml_level, final File out_file ) throws IOException { final Writer writer = new BufferedWriter( new PrintWriter( out_file ) ); toPhyloXML( writer, phy, phyloxml_level ); writer.flush(); writer.close(); }
public void toPhyloXML( final Phylogeny[] trees, final int phyloxml_level, final File out_file, final String separator ) throws IOException { final Writer writer = new BufferedWriter( new PrintWriter( out_file ) ); toPhyloXML( writer, trees, phyloxml_level, separator ); writer.flush(); writer.close(); }
public void toPhyloXML( final File out_file, final List<Phylogeny> trees, final int phyloxml_level, final String separator ) throws IOException { final Writer writer = new BufferedWriter( new PrintWriter( out_file ) ); toPhyloXML( writer, trees, phyloxml_level, separator ); writer.flush(); writer.close(); }
private static void writeTree( final Phylogeny p, final File f, final String comment ) throws IOException { final PhylogenyWriter writer = new PhylogenyWriter(); writer.toPhyloXML( f, p, 0 ); System.out.println( comment + " \"" + f + "\"" ); } }
public String toPhyloXML( final int phyloxml_level ) { try { return new PhylogenyWriter().toPhyloXML( this, phyloxml_level ).toString(); } catch ( final IOException e ) { throw new Error( "this should not have happend: " + e.getMessage() ); } }
public static void writePhylogenyToFile( final Phylogeny phylogeny, final String filename ) { final PhylogenyWriter writer = new PhylogenyWriter(); try { writer.toPhyloXML( new File( filename ), phylogeny, 1 ); } catch ( final IOException e ) { ForesterUtil.printWarningMessage( surfacing.PRG_NAME, "failed to write phylogeny to \"" + filename + "\": " + e ); } ForesterUtil.programMessage( surfacing.PRG_NAME, "Wrote phylogeny to \"" + filename + "\"" ); }
static boolean writeAsPhyloXml( final TreePanel tp, final Options op, boolean exception, final File file ) { try { final PhylogenyWriter writer = new PhylogenyWriter(); writer.toPhyloXML( file, tp.getPhylogeny(), 0 ); } catch ( final Exception e ) { exception = true; exceptionOccuredDuringSaveAs( e, tp, tp ); } return exception; }
public static void main( final String[] args ) { // Reading-in of (a) tree(s) from a file. final File treefile = new File( "/home/czmasek/tol_117_TEST.xml" ); PhylogenyParser parser = null; try { parser = ParserUtils.createParserDependingOnFileType( treefile, true ); } catch ( final IOException e ) { e.printStackTrace(); } Phylogeny[] phys = null; try { phys = PhylogenyMethods.readPhylogenies( parser, treefile ); } catch ( final IOException e ) { e.printStackTrace(); } // Writing trees to a file. final File outfile = new File( "/home/czmasek/tol_117_TEST_out.xml" ); try { final PhylogenyWriter writer = new PhylogenyWriter(); writer.toPhyloXML( phys, 0, outfile, ForesterUtil.LINE_SEPARATOR ); } catch ( final Exception e ) { e.printStackTrace(); } } }
w.toPhyloXML( outfile, p, 0 );
writer.toPhyloXML( outfile, phylogeny_w_bl, 0 );
w.toPhyloXML( phy, 0, outfile );
writer.toPhyloXML( out, phylogeny_0, 0 );
writer1.toPhyloXML( outtree1, phy, 0 ); final PhylogenyNodeIterator it2 = phy.iteratorExternalForward(); while ( it2.hasNext() ) { writer2.toPhyloXML( outtree2, phy, 0 );
final PhylogenyWriter w = new PhylogenyWriter(); try { w.toPhyloXML( outfile, ps, 1, ForesterUtil.LINE_SEPARATOR );
writer.toPhyloXML( phy, 0, outtree );
writer.toPhyloXML( file, trees, 0, ForesterUtil.LINE_SEPARATOR );
try { final PhylogenyWriter writer = new PhylogenyWriter(); writer.toPhyloXML( annotated_phylogenies_outfile, phylogenies_list.get( 0 ), 1 ); System.out.println( "Wrote annotated phylogeny to \"" + annotated_phylogenies_outfile + "\"" ); System.out.println();
w.toPhyloXML( phylogeny_outfile, p, 1 );
writer.setIndentPhyloxml( false ); writer.toPhyloXML( phys, 0, outfile, ForesterUtil.LINE_SEPARATOR );
writer.toPhyloXML( targets, 0, outfile, ForesterUtil.LINE_SEPARATOR );