import java.util.List;
import java.util.SortedSet;
import java.util.TreeSet;
+import java.util.regex.Matcher;
import javax.swing.JOptionPane;
ut = obtainTaxonomy( TaxonomyDataManager.getIdTaxCacheMap(), id, qt );
}
}
- //
- // qt = QUERY_TYPE.SN;
- // UniProtTaxonomy ut = obtainTaxonomy( TaxonomyDataManager.getSnTaxCacheMap(), simple_name, qt );
- // if ( ut == null ) {
- // qt = QUERY_TYPE.CODE;
- // ut = obtainTaxonomy( TaxonomyDataManager.getCodeTaxCacheMap(), simple_name, qt );
- // }
- // if ( ut == null ) {
- // qt = QUERY_TYPE.CN;
- // ut = obtainTaxonomy( TaxonomyDataManager.getCnTaxCacheMap(), simple_name, qt );
- // }
+ if ( ut == null ) {
+ String sn = "";
+ final Matcher m = ParserUtils.TAXOMONY_SN_PATTERN_I.matcher( simple_name );
+ if ( m.matches() ) {
+ sn = m.group( 1 );
+ }
+ if ( !ForesterUtil.isEmpty( sn ) ) {
+ qt = QUERY_TYPE.SN;
+ ut = obtainTaxonomy( TaxonomyDataManager.getSnTaxCacheMap(), sn, qt );
+ }
+ }
return ut;
}
+ "]", 80 ), "Error", JOptionPane.ERROR_MESSAGE );
}
_main_frame.getContentPane().repaint();
- if ( ( ( trees != null ) && ( trees.length > 0 ) ) && ( ( new Date().getTime() - start_time ) > 20000 ) ) {
+ if ( ( trees != null ) && ( trees.length > 0 ) ) {
try {
JOptionPane.showMessageDialog( null,
ForesterUtil.wordWrap( "Successfully read in " + trees.length
"http://tolweb.org",
null ) );
clients.add( new BasicPhylogeniesWebserviceClient( TREE_BASE_NAME,
- "Read Tree(s) from TreeBASE study...",
+ "Read Tree(s) from TreeBASE Study...",
"Use TreeBASE to obtain evolutionary tree(s) from a study",
- "Please enter a TreeBASE study (\"S\") identifier (without the \"S\")\n(Examples: 15613, 15632, 14525, 14909)",
+ "Please enter a TreeBASE study (\"S\") identifier (without the \"S\")\n(Examples: 14909, 14525, 15613, 15632)",
WsPhylogenyFormat.TREEBASE_STUDY,
null,
TREEBASE_PHYLOWS_STUDY_URL_BASE
clients.add( new BasicPhylogeniesWebserviceClient( TREE_BASE_NAME,
"Read Tree from TreeBASE...",
"Use TreeBASE to obtain a evolutionary tree",
- "Please enter a TreeBASE tree (\"Tr\") identifier (without the \"Tr\")\n(Examples: 422, 2654, 825, 4931, 2518, 2406, 4934)",
+ "Please enter a TreeBASE tree (\"Tr\") identifier (without the \"Tr\")\n(Examples: 2406, 422, 2654, 825, 4931, 2518, 4934)",
WsPhylogenyFormat.TREEBASE_TREE,
null,
TREEBASE_PHYLOWS_TREE_URL_BASE
.compile( "(?:\\b|_)[a-zA-Z0-9]{3,}_([A-Z][a-z]+_[a-z]{2,}(?:_[a-z][a-z0-9_]+)?)\\b" );
final public static Pattern TAXOMONY_SN_PATTERN_SN = Pattern
.compile( "\\b([A-Z][a-z]+[_ ][a-z]{2,}(?:[_ ][a-z]+)?)(?:\\b|_)" );
+ final public static Pattern TAXOMONY_SN_PATTERN_I = Pattern.compile( "([A-Z][a-z]{2,})" );
final private static Pattern TAXOMONY_CODE_PATTERN_PFS = Pattern.compile( "(?:\\b|_)[A-Z0-9]{4,}_("
+ TAX_CODE + ")/\\d+-\\d+\\b" );
final private static Pattern TAXOMONY_UNIPROT_ID_PATTERN_PFR = Pattern
if ( phylogenies.length != 3 ) {
return false;
}
+ if ( !isEqual( phylogenies[ 2 ].getNode( "Aloysia lycioides 251-76-02169" ).getDistanceToParent(),
+ 0.00100049 ) ) {
+ return false;
+ }
}
catch ( final Exception e ) {
e.printStackTrace( System.out );