writer.close();
}
+ 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 Writer writer,
final List<Phylogeny> trees,
final int phyloxml_level,
}
PhylogenyDataUtil.appendOpen( getWriter(), PhyloXmlMapping.CLADE );
}
- if ( indentation != null ) {
- PhyloXmlNodeWriter.toPhyloXml( getWriter(), node, getPhyloXmlLevel(), indentation.toString() );
- }
- else {
- PhyloXmlNodeWriter.toPhyloXml( getWriter(), node, getPhyloXmlLevel(), "" );
- }
+ PhyloXmlNodeWriter.toPhyloXml( getWriter(),
+ node,
+ getPhyloXmlLevel(),
+ indentation != null ? indentation.toString() : "" );
if ( node.isExternal() ) {
getWriter().write( ForesterUtil.LINE_SEPARATOR );
if ( indentation != null ) {
if ( isIndentPhyloxml() ) {
getWriter().write( createIndentation().toString() );
}
- PhylogenyDataUtil.appendOpen( getWriter(), PhyloXmlMapping.CLADE );
+ if ( node.isCollapse() ) {
+ PhylogenyDataUtil.appendOpen( getWriter(),
+ PhyloXmlMapping.CLADE,
+ PhyloXmlMapping.NODE_COLLAPSE,
+ "true" );
+ }
+ else {
+ PhylogenyDataUtil.appendOpen( getWriter(), PhyloXmlMapping.CLADE );
+ }
}
else if ( ( getOutputFormt() == FORMAT.NHX ) || ( getOutputFormt() == FORMAT.NH ) ) {
getBuffer().append( "(" );