&& ( field != PhylogenyMethods.PhylogenyNodeField.TAXONOMY_COMMON_NAME )
&& ( field != PhylogenyMethods.PhylogenyNodeField.TAXONOMY_SCIENTIFIC_NAME ) ) {
if ( extr_taxonomy_pf_only ) {
- ( ( NHXParser ) parser )
- .setTaxonomyExtraction( PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ ( ( NHXParser ) parser ).setTaxonomyExtraction( NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
replace_underscores = false;
}
else if ( extr_taxonomy ) {
- ( ( NHXParser ) parser ).setTaxonomyExtraction( PhylogenyMethods.TAXONOMY_EXTRACTION.YES );
+ ( ( NHXParser ) parser ).setTaxonomyExtraction( NHXParser.TAXONOMY_EXTRACTION.YES );
replace_underscores = false;
}
}
else {
- ( ( NHXParser ) parser ).setTaxonomyExtraction( PhylogenyMethods.TAXONOMY_EXTRACTION.NO );
+ ( ( NHXParser ) parser ).setTaxonomyExtraction( NHXParser.TAXONOMY_EXTRACTION.NO );
}
( ( NHXParser ) parser ).setReplaceUnderscores( replace_underscores );
( ( NHXParser ) parser ).setIgnoreQuotes( ignore_quotes );
+++ /dev/null
-// $Id:
-// FORESTER -- software libraries and applications
-// for evolutionary biology research and applications.
-//
-// Copyright (C) 2008-2009 Christian M. Zmasek
-// Copyright (C) 2008-2009 Burnham Institute for Medical Research
-// All rights reserved
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-//
-// Contact: phylosoft @ gmail . com
-// WWW: www.phylosoft.org/forester
-
-package org.forester.application;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.PrintWriter;
-
-import org.forester.io.parsers.PhylogenyParser;
-import org.forester.io.parsers.util.ParserUtils;
-import org.forester.phylogeny.Phylogeny;
-import org.forester.phylogeny.PhylogenyMethods;
-import org.forester.phylogeny.PhylogenyNode;
-import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory;
-import org.forester.phylogeny.factories.PhylogenyFactory;
-
-public class printAllSpecies {
-
- public static void main( final String args[] ) {
- Phylogeny tree = null;
- PhylogenyNode node = null;
- PrintWriter out = null;
- File infile = null, outfile = null;
- if ( args.length != 2 ) {
- System.err.println( "\nprintAllSpecies: Wrong number of arguments." );
- System.err.println( "Usage: \"java printAllSpecies <infile> <outfile>\"\n" );
- System.exit( -1 );
- }
- infile = new File( args[ 0 ] );
- outfile = new File( args[ 1 ] );
- try {
- final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
- final PhylogenyParser pp = ParserUtils.createParserDependingOnFileType( infile, true );
- tree = factory.create( infile, pp )[ 0 ];
- }
- catch ( final Exception e ) {
- System.err.println( e + "\nCould not read " + infile + "\n" );
- System.exit( -1 );
- }
- node = tree.getFirstExternalNode();
- try {
- out = new PrintWriter( new FileWriter( outfile ), true );
- while ( node != null ) {
- out.println( PhylogenyMethods.getSpecies( node ) );
- node = node.getNextExternalNode();
- }
- }
- catch ( final Exception e ) {
- System.err.println( e + "\nException during writing.\n" );
- System.exit( -1 );
- }
- finally {
- out.close();
- }
- }
-}
+++ /dev/null
-// $Id:
-// FORESTER -- software libraries and applications
-// for evolutionary biology research and applications.
-//
-// Copyright (C) 2008-2009 Christian M. Zmasek
-// Copyright (C) 2008-2009 Burnham Institute for Medical Research
-// All rights reserved
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-//
-// Contact: phylosoft @ gmail . com
-// WWW: www.phylosoft.org/forester
-
-package org.forester.application;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.PrintWriter;
-
-import org.forester.io.parsers.PhylogenyParser;
-import org.forester.io.parsers.util.ParserUtils;
-import org.forester.phylogeny.Phylogeny;
-import org.forester.phylogeny.PhylogenyNode;
-import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory;
-import org.forester.phylogeny.factories.PhylogenyFactory;
-
-public class printSameOrder {
-
- public static void main( final String args[] ) {
- Phylogeny tree = null;
- PhylogenyNode node = null;
- PrintWriter out = null;
- File infile = null, outfile = null;
- if ( args.length != 2 ) {
- System.err.println( "\nprintSameOrder: Wrong number of arguments." );
- System.err.println( "Usage: \"java printSameOrder <infile> <outfile>\"\n" );
- System.exit( -1 );
- }
- infile = new File( args[ 0 ] );
- outfile = new File( args[ 1 ] );
- try {
- final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
- final PhylogenyParser pp = ParserUtils.createParserDependingOnFileType( infile, true );
- tree = factory.create( infile, pp )[ 0 ];
- }
- catch ( final Exception e ) {
- System.err.println( e + "\nCould not read " + infile + "\n" );
- System.exit( -1 );
- }
- node = tree.getFirstExternalNode();
- try {
- out = new PrintWriter( new FileWriter( outfile ), true );
- while ( node != null ) {
- out.println( node.getName() );
- node = node.getNextExternalNode();
- }
- }
- catch ( final Exception e ) {
- System.err.println( e + "\nException during writing.\n" );
- System.exit( -1 );
- }
- finally {
- out.close();
- }
- }
-}
final PhylogenyParser pp_bl = ParserUtils.createParserDependingOnFileType( infile_bl, true );
final PhylogenyParser pp_s = ParserUtils.createParserDependingOnFileType( infile_support_vals, true );
if ( pp_bl instanceof NHXParser ) {
- ( ( NHXParser ) pp_bl ).setTaxonomyExtraction( PhylogenyMethods.TAXONOMY_EXTRACTION.YES );
+ ( ( NHXParser ) pp_bl ).setTaxonomyExtraction( NHXParser.TAXONOMY_EXTRACTION.YES );
}
phylogeny_w_bl = factory.create( infile_bl, pp_bl )[ index_of_tree_w_bl ];
phylogeny_w_support_vals = factory.create( infile_support_vals, pp_s )[ 0 ];
final NHXParser nhx = ( NHXParser ) p;
nhx.setReplaceUnderscores( conf.isReplaceUnderscoresInNhParsing() );
nhx.setIgnoreQuotes( false );
- PhylogenyMethods.TAXONOMY_EXTRACTION te = PhylogenyMethods.TAXONOMY_EXTRACTION.NO;
+ NHXParser.TAXONOMY_EXTRACTION te = NHXParser.TAXONOMY_EXTRACTION.NO;
if ( conf.isExtractPfamTaxonomyCodesInNhParsing() ) {
- te = PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY;
+ te = NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY;
}
nhx.setTaxonomyExtraction( te );
}
final String name = n.getName().trim();
if ( !ForesterUtil.isEmpty( name ) ) {
final String code = ParserUtils
- .extractTaxonomyCodeFromNodeName( name, PhylogenyMethods.TAXONOMY_EXTRACTION.YES );
+ .extractTaxonomyCodeFromNodeName( name, NHXParser.TAXONOMY_EXTRACTION.YES );
if ( !ForesterUtil.isEmpty( code ) ) {
PhylogenyMethods.setTaxonomyCode( n, code );
}
private void setSpecialOptionsForNhxParser( final NHXParser nhx ) {
nhx.setReplaceUnderscores( getOptions().isReplaceUnderscoresInNhParsing() );
- PhylogenyMethods.TAXONOMY_EXTRACTION te = PhylogenyMethods.TAXONOMY_EXTRACTION.NO;
+ NHXParser.TAXONOMY_EXTRACTION te = NHXParser.TAXONOMY_EXTRACTION.NO;
if ( getOptions().isExtractPfamTaxonomyCodesInNhParsing() ) {
- te = PhylogenyMethods.TAXONOMY_EXTRACTION.YES;
+ te = NHXParser.TAXONOMY_EXTRACTION.YES;
}
nhx.setTaxonomyExtraction( te );
}
break;
case NH:
parser = new NHXParser();
- ( ( NHXParser ) parser ).setTaxonomyExtraction( PhylogenyMethods.TAXONOMY_EXTRACTION.NO );
+ ( ( NHXParser ) parser ).setTaxonomyExtraction( NHXParser.TAXONOMY_EXTRACTION.NO );
( ( NHXParser ) parser ).setReplaceUnderscores( true );
( ( NHXParser ) parser ).setGuessRootedness( true );
break;
case NH_EXTRACT_TAXONOMY:
parser = new NHXParser();
- ( ( NHXParser ) parser )
- .setTaxonomyExtraction( PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ ( ( NHXParser ) parser ).setTaxonomyExtraction( NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
( ( NHXParser ) parser ).setReplaceUnderscores( false );
( ( NHXParser ) parser ).setGuessRootedness( true );
break;
case PFAM:
parser = new NHXParser();
- ( ( NHXParser ) parser )
- .setTaxonomyExtraction( PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ ( ( NHXParser ) parser ).setTaxonomyExtraction( NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
( ( NHXParser ) parser ).setReplaceUnderscores( false );
( ( NHXParser ) parser ).setGuessRootedness( true );
break;
case NHX:
parser = new NHXParser();
- ( ( NHXParser ) parser ).setTaxonomyExtraction( PhylogenyMethods.TAXONOMY_EXTRACTION.NO );
+ ( ( NHXParser ) parser ).setTaxonomyExtraction( NHXParser.TAXONOMY_EXTRACTION.NO );
( ( NHXParser ) parser ).setReplaceUnderscores( false );
( ( NHXParser ) parser ).setGuessRootedness( true );
break;
import org.forester.io.parsers.util.ParserUtils;
import org.forester.io.parsers.util.PhylogenyParserException;
import org.forester.phylogeny.Phylogeny;
-import org.forester.phylogeny.PhylogenyMethods;
import org.forester.phylogeny.PhylogenyNode;
import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory;
import org.forester.phylogeny.factories.PhylogenyFactory;
final boolean is_rooted ) throws IOException {
final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
final NHXParser pars = new NHXParser();
- pars.setTaxonomyExtraction( PhylogenyMethods.TAXONOMY_EXTRACTION.NO );
+ pars.setTaxonomyExtraction( NHXParser.TAXONOMY_EXTRACTION.NO );
pars.setReplaceUnderscores( isReplaceUnderscores() );
pars.setIgnoreQuotes( isIgnoreQuotes() );
if ( rooted_info_present ) {
public final class NHXParser implements PhylogenyParser {
- public static final PhylogenyMethods.TAXONOMY_EXTRACTION TAXONOMY_EXTRACTION_DEFAULT = PhylogenyMethods.TAXONOMY_EXTRACTION.NO;
- final static private boolean GUESS_ROOTEDNESS_DEFAULT = true;
- final static private boolean GUESS_IF_SUPPORT_VALUES = true;
- final static private boolean IGNORE_QUOTES_DEFAULT = false;
- final static public boolean REPLACE_UNDERSCORES_DEFAULT = false;
- private boolean _saw_closing_paren;
- final static private byte STRING = 0;
- final static private byte STRING_BUFFER = 1;
- final static private byte CHAR_ARRAY = 2;
- final static private byte BUFFERED_READER = 3;
- private boolean _guess_rootedness;
- private boolean _has_next;
- private boolean _ignore_quotes;
- private byte _input_type;
- private int _source_length;
- private PhylogenyNode _current_node;
- private StringBuilder _current_anotation;
- private Object _nhx_source;
- private int _clade_level;
- private List<Phylogeny> _phylogenies;
- private Phylogeny _current_phylogeny;
- private PhylogenyMethods.TAXONOMY_EXTRACTION _taxonomy_extraction;
- private boolean _replace_underscores;
- public final static Pattern UC_LETTERS_NUMBERS_PATTERN = Pattern
- .compile( "^[A-Z0-9]+$" );
- public final static Pattern NUMBERS_ONLY_PATTERN = Pattern
- .compile( "^[0-9\\.]+$" );
- public final static Pattern MB_PROB_PATTERN = Pattern
- .compile( "prob=([^,]+)" );
- public final static Pattern MB_PROB_SD_PATTERN = Pattern
- .compile( "prob_stddev=([^,]+)" );
- public final static Pattern MB_BL_PATTERN = Pattern
- .compile( "length_median=([^,]+)" );
+ public static final TAXONOMY_EXTRACTION TAXONOMY_EXTRACTION_DEFAULT = NHXParser.TAXONOMY_EXTRACTION.NO;
+ final static private boolean GUESS_ROOTEDNESS_DEFAULT = true;
+ final static private boolean GUESS_IF_SUPPORT_VALUES = true;
+ final static private boolean IGNORE_QUOTES_DEFAULT = false;
+ final static public boolean REPLACE_UNDERSCORES_DEFAULT = false;
+ private boolean _saw_closing_paren;
+ final static private byte STRING = 0;
+ final static private byte STRING_BUFFER = 1;
+ final static private byte CHAR_ARRAY = 2;
+ final static private byte BUFFERED_READER = 3;
+ private boolean _guess_rootedness;
+ private boolean _has_next;
+ private boolean _ignore_quotes;
+ private byte _input_type;
+ private int _source_length;
+ private PhylogenyNode _current_node;
+ private StringBuilder _current_anotation;
+ private Object _nhx_source;
+ private int _clade_level;
+ private List<Phylogeny> _phylogenies;
+ private Phylogeny _current_phylogeny;
+ private NHXParser.TAXONOMY_EXTRACTION _taxonomy_extraction;
+ private boolean _replace_underscores;
+ public final static Pattern UC_LETTERS_NUMBERS_PATTERN = Pattern.compile( "^[A-Z0-9]+$" );
+ public final static Pattern NUMBERS_ONLY_PATTERN = Pattern.compile( "^[0-9\\.]+$" );
+ public final static Pattern MB_PROB_PATTERN = Pattern.compile( "prob=([^,]+)" );
+ public final static Pattern MB_PROB_SD_PATTERN = Pattern.compile( "prob_stddev=([^,]+)" );
+ public final static Pattern MB_BL_PATTERN = Pattern.compile( "length_median=([^,]+)" );
public NHXParser() {
init();
return _source_length;
}
- public PhylogenyMethods.TAXONOMY_EXTRACTION getTaxonomyExtraction() {
+ public NHXParser.TAXONOMY_EXTRACTION getTaxonomyExtraction() {
return _taxonomy_extraction;
}
_source_length = source_length;
}
- public void setTaxonomyExtraction( final PhylogenyMethods.TAXONOMY_EXTRACTION taxonomy_extraction ) {
+ public void setTaxonomyExtraction( final NHXParser.TAXONOMY_EXTRACTION taxonomy_extraction ) {
_taxonomy_extraction = taxonomy_extraction;
}
public static void parseNHX( String s,
final PhylogenyNode node_to_annotate,
- final PhylogenyMethods.TAXONOMY_EXTRACTION taxonomy_extraction,
+ final NHXParser.TAXONOMY_EXTRACTION taxonomy_extraction,
final boolean replace_underscores ) throws NHXFormatException,
PhyloXmlDataFormatException {
- if ( ( taxonomy_extraction != PhylogenyMethods.TAXONOMY_EXTRACTION.NO ) && replace_underscores ) {
+ if ( ( taxonomy_extraction != NHXParser.TAXONOMY_EXTRACTION.NO ) && replace_underscores ) {
throw new IllegalArgumentException( "cannot extract taxonomies and replace under scores at the same time" );
}
if ( ( s != null ) && ( s.length() > 0 ) ) {
if ( !s.startsWith( ":" ) ) {
node_to_annotate.setName( t.nextToken() );
if ( !replace_underscores
- && ( !is_nhx && ( taxonomy_extraction != PhylogenyMethods.TAXONOMY_EXTRACTION.NO ) ) ) {
+ && ( !is_nhx && ( taxonomy_extraction != NHXParser.TAXONOMY_EXTRACTION.NO ) ) ) {
final String tax = ParserUtils.extractTaxonomyCodeFromNodeName( node_to_annotate.getName(),
taxonomy_extraction );
if ( !ForesterUtil.isEmpty( tax ) ) {
final int blu = ForesterUtil.limitRangeForColor( Integer.parseInt( st.nextToken() ) );
return new Color( red, green, blu );
}
+
+ public static enum TAXONOMY_EXTRACTION {
+ NO, YES, PFAM_STYLE_ONLY;
+ }
}
* @return
*/
public static String extractTaxonomyCodeFromNodeName( final String name,
- final PhylogenyMethods.TAXONOMY_EXTRACTION taxonomy_extraction ) {
+ final NHXParser.TAXONOMY_EXTRACTION taxonomy_extraction ) {
if ( ( name.indexOf( "_" ) > 0 )
&& ( name.length() < 31 )
// && ( name.lastIndexOf( "_" ) == name.indexOf( "_" ) )
&& ( name.indexOf( "|" ) < 0 )
&& ( name.indexOf( "." ) < 0 )
- && ( ( taxonomy_extraction != PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY ) || ( name
- .indexOf( "/" ) >= 0 ) )
+ && ( ( taxonomy_extraction != NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY ) || ( name.indexOf( "/" ) >= 0 ) )
&& ( ( ( name.indexOf( "/" ) ) < 0 ) || ( name.indexOf( "/" ) > name.indexOf( "_" ) ) ) ) {
final String[] s = name.split( "[_/]" );
if ( s.length > 1 ) {
TAXONOMY_ID;
}
- public static enum TAXONOMY_EXTRACTION {
- NO, YES, PFAM_STYLE_ONLY;
- }
-
public static enum DESCENDANT_SORT_PRIORITY {
TAXONOMY, SEQUENCE, NODE_NAME;
}
public static PhylogenyNode createInstanceFromNhxString( final String nhx ) throws NHXFormatException,
PhyloXmlDataFormatException {
- return new PhylogenyNode( nhx, PhylogenyMethods.TAXONOMY_EXTRACTION.NO, false );
+ return new PhylogenyNode( nhx, NHXParser.TAXONOMY_EXTRACTION.NO, false );
}
public static PhylogenyNode createInstanceFromNhxString( final String nhx,
- final PhylogenyMethods.TAXONOMY_EXTRACTION taxonomy_extraction )
+ final NHXParser.TAXONOMY_EXTRACTION taxonomy_extraction )
throws NHXFormatException, PhyloXmlDataFormatException {
return new PhylogenyNode( nhx, taxonomy_extraction, false );
}
public static PhylogenyNode createInstanceFromNhxString( final String nhx,
- final PhylogenyMethods.TAXONOMY_EXTRACTION taxonomy_extraction,
+ final NHXParser.TAXONOMY_EXTRACTION taxonomy_extraction,
final boolean replace_underscores )
throws NHXFormatException, PhyloXmlDataFormatException {
return new PhylogenyNode( nhx, taxonomy_extraction, replace_underscores );
}
private PhylogenyNode( final String nhx,
- final PhylogenyMethods.TAXONOMY_EXTRACTION taxonomy_extraction,
+ final NHXParser.TAXONOMY_EXTRACTION taxonomy_extraction,
final boolean replace_underscores ) throws NHXFormatException, PhyloXmlDataFormatException {
// init();
NHXParser.parseNHX( nhx, this, taxonomy_extraction, replace_underscores );
final NHXParser nhx = ( NHXParser ) p;
nhx.setReplaceUnderscores( false );
nhx.setIgnoreQuotes( true );
- nhx.setTaxonomyExtraction( PhylogenyMethods.TAXONOMY_EXTRACTION.YES );
+ nhx.setTaxonomyExtraction( NHXParser.TAXONOMY_EXTRACTION.YES );
}
final Phylogeny[] gene_trees = factory.create( gene_trees_file, p );
// Removes from species_tree all species not found in gene_tree.
import org.forester.phylogeny.Phylogeny;
import org.forester.phylogeny.PhylogenyBranch;
import org.forester.phylogeny.PhylogenyMethods;
-import org.forester.phylogeny.PhylogenyMethods.TAXONOMY_EXTRACTION;
import org.forester.phylogeny.PhylogenyNode;
import org.forester.phylogeny.PhylogenyNode.NH_CONVERSION_SUPPORT_VALUE_STYLE;
import org.forester.phylogeny.data.BinaryCharacters;
}
final PhylogenyNode n1 = new PhylogenyNode();
final PhylogenyNode n2 = PhylogenyNode
- .createInstanceFromNhxString( "", PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
final PhylogenyNode n3 = PhylogenyNode
- .createInstanceFromNhxString( "n3", PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "n3", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
final PhylogenyNode n4 = PhylogenyNode
- .createInstanceFromNhxString( "n4:0.01", PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "n4:0.01", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( n1.isHasAssignedEvent() ) {
return false;
}
return false;
}
final NHXParser nhxp = new NHXParser();
- nhxp.setTaxonomyExtraction( PhylogenyMethods.TAXONOMY_EXTRACTION.NO );
+ nhxp.setTaxonomyExtraction( NHXParser.TAXONOMY_EXTRACTION.NO );
nhxp.setReplaceUnderscores( true );
final Phylogeny uc0 = factory.create( "(A__A_,_B_B)", nhxp )[ 0 ];
if ( !uc0.getRoot().getChildNode( 0 ).getName().equals( "A A " ) ) {
return false;
}
final PhylogenyNode n8 = PhylogenyNode
- .createInstanceFromNhxString( "n8_ECOLI/12:0.01",
- PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "n8_ECOLI/12:0.01", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !n8.getName().equals( "n8_ECOLI/12" ) ) {
return false;
}
return false;
}
final PhylogenyNode n9 = PhylogenyNode
- .createInstanceFromNhxString( "n9_ECOLI/12=12:0.01",
- PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "n9_ECOLI/12=12:0.01", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !n9.getName().equals( "n9_ECOLI/12=12" ) ) {
return false;
}
return false;
}
final PhylogenyNode n10 = PhylogenyNode
- .createInstanceFromNhxString( "n10.ECOLI", PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "n10.ECOLI", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !n10.getName().equals( "n10.ECOLI" ) ) {
return false;
}
final PhylogenyNode n20 = PhylogenyNode
- .createInstanceFromNhxString( "n20_ECOLI/1-2", PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "n20_ECOLI/1-2", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !n20.getName().equals( "n20_ECOLI/1-2" ) ) {
return false;
}
if ( !PhylogenyMethods.getSpecies( n20 ).equals( "ECOLI" ) ) {
return false;
}
- final PhylogenyNode n20x = PhylogenyNode
- .createInstanceFromNhxString( "n20_ECOL1/1-2", PhylogenyMethods.TAXONOMY_EXTRACTION.YES );
+ final PhylogenyNode n20x = PhylogenyNode.createInstanceFromNhxString( "n20_ECOL1/1-2",
+ NHXParser.TAXONOMY_EXTRACTION.YES );
if ( !n20x.getName().equals( "n20_ECOL1/1-2" ) ) {
return false;
}
return false;
}
final PhylogenyNode n20xx = PhylogenyNode
- .createInstanceFromNhxString( "n20_eCOL1/1-2", PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "n20_eCOL1/1-2", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !n20xx.getName().equals( "n20_eCOL1/1-2" ) ) {
return false;
}
return false;
}
final PhylogenyNode n20xxx = PhylogenyNode
- .createInstanceFromNhxString( "n20_ecoli/1-2", PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "n20_ecoli/1-2", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !n20xxx.getName().equals( "n20_ecoli/1-2" ) ) {
return false;
}
return false;
}
final PhylogenyNode n20xxxx = PhylogenyNode
- .createInstanceFromNhxString( "n20_Ecoli/1-2", PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "n20_Ecoli/1-2", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !n20xxxx.getName().equals( "n20_Ecoli/1-2" ) ) {
return false;
}
if ( PhylogenyMethods.getSpecies( n20xxxx ).length() > 0 ) {
return false;
}
- final PhylogenyNode n21 = PhylogenyNode
- .createInstanceFromNhxString( "n21_PIG", PhylogenyMethods.TAXONOMY_EXTRACTION.YES );
+ final PhylogenyNode n21 = PhylogenyNode.createInstanceFromNhxString( "n21_PIG",
+ NHXParser.TAXONOMY_EXTRACTION.YES );
if ( !n21.getName().equals( "n21_PIG" ) ) {
return false;
}
return false;
}
final PhylogenyNode n21x = PhylogenyNode
- .createInstanceFromNhxString( "n21_PIG", PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "n21_PIG", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !n21x.getName().equals( "n21_PIG" ) ) {
return false;
}
return false;
}
final PhylogenyNode n22 = PhylogenyNode
- .createInstanceFromNhxString( "n22/PIG", PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "n22/PIG", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !n22.getName().equals( "n22/PIG" ) ) {
return false;
}
return false;
}
final PhylogenyNode n23 = PhylogenyNode
- .createInstanceFromNhxString( "n23/PIG_1", PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "n23/PIG_1", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !n23.getName().equals( "n23/PIG_1" ) ) {
return false;
}
return false;
}
final PhylogenyNode a = PhylogenyNode
- .createInstanceFromNhxString( "n10_ECOLI/1-2", PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "n10_ECOLI/1-2", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !a.getName().equals( "n10_ECOLI/1-2" ) ) {
return false;
}
return false;
}
final PhylogenyNode b = PhylogenyNode
- .createInstanceFromNhxString( "n10_ECOLI1/1-2",
- PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "n10_ECOLI1/1-2", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !b.getName().equals( "n10_ECOLI1/1-2" ) ) {
return false;
}
}
final PhylogenyNode c = PhylogenyNode
.createInstanceFromNhxString( "n10_RATAF12/1000-2000",
- PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !c.getName().equals( "n10_RATAF12/1000-2000" ) ) {
return false;
}
}
final PhylogenyNode c1 = PhylogenyNode
.createInstanceFromNhxString( "n10_BOVIN_1/1000-2000",
- PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !c1.getName().equals( "n10_BOVIN_1/1000-2000" ) ) {
return false;
}
}
final PhylogenyNode c2 = PhylogenyNode
.createInstanceFromNhxString( "n10_Bovin_1/1000-2000",
- PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !c2.getName().equals( "n10_Bovin_1/1000-2000" ) ) {
return false;
}
return false;
}
final PhylogenyNode d = PhylogenyNode
- .createInstanceFromNhxString( "n10_RAT1/1-2", PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "n10_RAT1/1-2", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !d.getName().equals( "n10_RAT1/1-2" ) ) {
return false;
}
return false;
}
final PhylogenyNode e = PhylogenyNode
- .createInstanceFromNhxString( "n10_RAT1", PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "n10_RAT1", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !e.getName().equals( "n10_RAT1" ) ) {
return false;
}
if ( !ForesterUtil.isEmpty( PhylogenyMethods.getSpecies( e ) ) ) {
return false;
}
- final PhylogenyNode e2 = PhylogenyNode
- .createInstanceFromNhxString( "n10_RAT1", PhylogenyMethods.TAXONOMY_EXTRACTION.YES );
+ final PhylogenyNode e2 = PhylogenyNode.createInstanceFromNhxString( "n10_RAT1",
+ NHXParser.TAXONOMY_EXTRACTION.YES );
if ( !e2.getName().equals( "n10_RAT1" ) ) {
return false;
}
if ( !PhylogenyMethods.getSpecies( e2 ).equals( "RAT" ) ) {
return false;
}
- final PhylogenyNode e3 = PhylogenyNode
- .createInstanceFromNhxString( "n10_RAT~", PhylogenyMethods.TAXONOMY_EXTRACTION.YES );
+ final PhylogenyNode e3 = PhylogenyNode.createInstanceFromNhxString( "n10_RAT~",
+ NHXParser.TAXONOMY_EXTRACTION.YES );
if ( !e3.getName().equals( "n10_RAT~" ) ) {
return false;
}
}
final PhylogenyNode n11 = PhylogenyNode
.createInstanceFromNhxString( "n111111_ECOLI/jdj:0.4",
- PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !n11.getName().equals( "n111111_ECOLI/jdj" ) ) {
return false;
}
}
final PhylogenyNode n12 = PhylogenyNode
.createInstanceFromNhxString( "n111111-ECOLI---/jdj:0.4",
- PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !n12.getName().equals( "n111111-ECOLI---/jdj" ) ) {
return false;
}
if ( PhylogenyMethods.getSpecies( n12 ).length() > 0 ) {
return false;
}
- final PhylogenyNode m = PhylogenyNode
- .createInstanceFromNhxString( "n10_MOUSEa", PhylogenyMethods.TAXONOMY_EXTRACTION.YES );
+ final PhylogenyNode m = PhylogenyNode.createInstanceFromNhxString( "n10_MOUSEa",
+ NHXParser.TAXONOMY_EXTRACTION.YES );
if ( !m.getName().equals( "n10_MOUSEa" ) ) {
return false;
}
if ( !PhylogenyMethods.getSpecies( m ).equals( "MOUSE" ) ) {
return false;
}
- final PhylogenyNode o = PhylogenyNode
- .createInstanceFromNhxString( "n10_MOUSE_", PhylogenyMethods.TAXONOMY_EXTRACTION.YES );
+ final PhylogenyNode o = PhylogenyNode.createInstanceFromNhxString( "n10_MOUSE_",
+ NHXParser.TAXONOMY_EXTRACTION.YES );
if ( !o.getName().equals( "n10_MOUSE_" ) ) {
return false;
}
return false;
}
final PhylogenyNode n13 = PhylogenyNode
- .createInstanceFromNhxString( "blah_12345/1-2",
- PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "blah_12345/1-2", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !n13.getName().equals( "blah_12345/1-2" ) ) {
return false;
}
return false;
}
final PhylogenyNode n14 = PhylogenyNode
- .createInstanceFromNhxString( "blah_12X45/1-2",
- PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "blah_12X45/1-2", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !n14.getName().equals( "blah_12X45/1-2" ) ) {
return false;
}
}
final PhylogenyNode n15 = PhylogenyNode
.createInstanceFromNhxString( "something_wicked[123]",
- PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !n15.getName().equals( "something_wicked" ) ) {
return false;
}
return false;
}
final PhylogenyNode n16 = PhylogenyNode
- .createInstanceFromNhxString( "something_wicked2[9]",
- PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "something_wicked2[9]", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !n16.getName().equals( "something_wicked2" ) ) {
return false;
}
return false;
}
final PhylogenyNode n17 = PhylogenyNode
- .createInstanceFromNhxString( "something_wicked3[a]",
- PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( "something_wicked3[a]", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !n17.getName().equals( "something_wicked3" ) ) {
return false;
}
return false;
}
final PhylogenyNode n18 = PhylogenyNode
- .createInstanceFromNhxString( ":0.5[91]", PhylogenyMethods.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ .createInstanceFromNhxString( ":0.5[91]", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !isEqual( n18.getDistanceToParent(), 0.5 ) ) {
return false;
}
final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
final Phylogeny s1 = factory.create( Test.PATH_TO_TEST_DATA + "rio_species.xml", new PhyloXmlParser() )[ 0 ];
final NHXParser p = new NHXParser();
- p.setTaxonomyExtraction( TAXONOMY_EXTRACTION.YES );
+ p.setTaxonomyExtraction( NHXParser.TAXONOMY_EXTRACTION.YES );
final Phylogeny g1[] = factory.create( new File( Test.PATH_TO_TEST_DATA
+ "rio_Bcl-2_e1_20_mafft_05_40_fme.mlt" ), p );
for( final Phylogeny gt : g1 ) {