+ public final static String createUriForSeqWeb( final PhylogenyNode node,
+ final Configuration conf,
+ final TreePanel tp ) {
+ String uri_str = null;
+ final String upkb = ForesterUtil.extractUniProtKbProteinSeqIdentifier( node );
+ if ( !ForesterUtil.isEmpty( upkb ) ) {
+ try {
+ uri_str = ForesterUtil.UNIPROT_KB + URLEncoder.encode( upkb, ForesterConstants.UTF8 );
+ }
+ catch ( final UnsupportedEncodingException e ) {
+ showErrorMessage( tp, e.toString() );
+ e.printStackTrace();
+ }
+ }
+ if ( ForesterUtil.isEmpty( uri_str ) ) {
+ final String v = ForesterUtil.extractGenbankAccessor( node );
+ if ( !ForesterUtil.isEmpty( v ) ) {
+ try {
+ if ( SequenceIdParser.isProtein( v ) ) {
+ uri_str = ForesterUtil.NCBI_PROTEIN + URLEncoder.encode( v, ForesterConstants.UTF8 );
+ }
+ else {
+ uri_str = ForesterUtil.NCBI_NUCCORE + URLEncoder.encode( v, ForesterConstants.UTF8 );
+ }
+ }
+ catch ( final UnsupportedEncodingException e ) {
+ showErrorMessage( tp, e.toString() );
+ e.printStackTrace();
+ }
+ }
+ }
+ if ( ForesterUtil.isEmpty( uri_str ) ) {
+ final String v = ForesterUtil.extractRefSeqAccessorAccessor( node );
+ if ( !ForesterUtil.isEmpty( v ) ) {
+ try {
+ if ( SequenceIdParser.isProtein( v ) ) {
+ uri_str = ForesterUtil.NCBI_PROTEIN + URLEncoder.encode( v, ForesterConstants.UTF8 );
+ }
+ else {
+ uri_str = ForesterUtil.NCBI_NUCCORE + URLEncoder.encode( v, ForesterConstants.UTF8 );
+ }
+ }
+ catch ( final UnsupportedEncodingException e ) {
+ showErrorMessage( tp, e.toString() );
+ e.printStackTrace();
+ }
+ }
+ }
+ if ( ForesterUtil.isEmpty( uri_str ) ) {
+ final String v = ForesterUtil.extractGInumber( node );
+ if ( !ForesterUtil.isEmpty( v ) ) {
+ try {
+ uri_str = ForesterUtil.NCBI_GI + URLEncoder.encode( v, ForesterConstants.UTF8 );
+ }
+ catch ( final UnsupportedEncodingException e ) {
+ showErrorMessage( tp, e.toString() );
+ e.printStackTrace();
+ }
+ }
+ }
+ return uri_str;
+ }
+