private final Phylogeny finishPhylogeny() throws PhylogenyParserException, NHXFormatException,
PhyloXmlDataFormatException {
- System.out.println( "finishPhylogeny()" + _current_phylogeny );
if ( _current_phylogeny != null ) {
parseNHX( _current_anotation != null ? _current_anotation.toString() : "",
_current_phylogeny.getRoot(),
_current_phylogeny.setRooted( true );
}
}
+ System.out.println( "finishPhylogeny()" + _current_phylogeny );
return _current_phylogeny;
}
return null;
throw new PhylogenyParserException( "error in NH (Newick) formatted data: most likely cause: number of open parens does not equal number of close parens" );
}
if ( _current_phylogeny != null ) {
+ System.out.println( "getNext() going to call finishPhylogeny()" );
_next = finishPhylogeny();
_current_phylogeny = null;
_current_anotation = null;
final PhylogenyNode new_node = new PhylogenyNode();
if ( _clade_level == 0 ) {
if ( _current_phylogeny != null ) {
+ System.out.println( "processOpenParen() going to call finishPhylogeny()" );
phy = finishPhylogeny();
}
_clade_level = 1;
import org.forester.io.parsers.GeneralMsaParser;
import org.forester.io.parsers.HmmscanPerDomainTableParser;
import org.forester.io.parsers.HmmscanPerDomainTableParser.INDIVIDUAL_SCORE_CUTOFF;
-import org.forester.io.parsers.PhylogenyParser;
import org.forester.io.parsers.nexus.NexusBinaryStatesMatrixParser;
import org.forester.io.parsers.nexus.NexusCharactersParser;
import org.forester.io.parsers.nexus.NexusPhylogeniesParser;
String s = "https://sites.google.com/site/cmzmasek/home/software/archaeopteryx/examples/simple/simple_1.nh";
final URL u = new URL( s );
final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
- final PhylogenyParser parser = ParserUtils.createParserDependingOnUrlContents( u, true );
- final Phylogeny[] phys = factory.create( u.openStream(), parser );
+ // final PhylogenyParser parser = new NHXParser();
+ final Phylogeny[] phys = factory.create( u.openStream(), new NHXParser() );
System.out.println( "results 1:" );
for( final Phylogeny phy : phys ) {
System.out.println( phy.toString() );
}
System.out.println( "" );
- final Phylogeny[] phys3 = factory.create( "((a,b),c)", parser );
+ final Phylogeny[] phys3 = factory.create( "((a,b),c)", new NHXParser() );
System.out.println( "results 3:" );
for( final Phylogeny phy : phys3 ) {
System.out.println( phy.toString() );