in progress
[jalview.git] / forester / java / src / org / forester / util / ForesterUtil.java
index de93bd1..1c914c8 100644 (file)
@@ -95,6 +95,21 @@ public final class ForesterUtil {
             sb.append( separator );
         }
     }
+    
+    final public static String getForesterLibraryInformation() {
+        return "forester " + ForesterConstants.FORESTER_VERSION + " (" + ForesterConstants.FORESTER_DATE  + ")";
+    }
+
+    public static boolean seqIsLikelyToBeAa( final String s ) {
+        final String seq = s.toLowerCase();
+        if ( ( seq.indexOf( 'r' ) > -1 ) || ( seq.indexOf( 'd' ) > -1 ) || ( seq.indexOf( 'e' ) > -1 )
+                || ( seq.indexOf( 'q' ) > -1 ) || ( seq.indexOf( 'h' ) > -1 ) || ( seq.indexOf( 'k' ) > -1 )
+                || ( seq.indexOf( 'w' ) > -1 ) || ( seq.indexOf( 's' ) > -1 ) || ( seq.indexOf( 'm' ) > -1 )
+                || ( seq.indexOf( 'p' ) > -1 ) || ( seq.indexOf( 'v' ) > -1 ) ) {
+            return true;
+        }
+        return false;
+    }
 
     /**
      * This calculates a color. If value is equal to min the returned color is
@@ -720,20 +735,29 @@ public final class ForesterUtil {
     }
 
     final public static void printProgramInformation( final String prg_name,
+                                                      final String desc,
                                                       final String prg_version,
                                                       final String date,
                                                       final String email,
-                                                      final String www ) {
-        final int l = prg_name.length() + prg_version.length() + date.length() + 4;
+                                                      final String www,
+                                                      final String based_on ) {
+        String my_prg_name = new String( prg_name );
+        if ( !ForesterUtil.isEmpty( desc ) ) {
+            my_prg_name += ( " - " + desc );
+        }
+        final int l = my_prg_name.length() + prg_version.length() + date.length() + 4;
         System.out.println();
-        System.out.println( prg_name + " " + prg_version + " (" + date + ")" );
+        System.out.println( my_prg_name + " " + prg_version + " (" + date + ")" );
         for( int i = 0; i < l; ++i ) {
             System.out.print( "_" );
         }
         System.out.println();
         System.out.println();
-        System.out.println( "WWW    : " + www );
-        System.out.println( "Contact: " + email );
+        System.out.println( "WWW     : " + www );
+        System.out.println( "Contact : " + email );
+        if ( !ForesterUtil.isEmpty( based_on ) ) {
+            System.out.println( "Based on: " + based_on );
+        }
         if ( !ForesterUtil.isEmpty( ForesterUtil.JAVA_VERSION ) && !ForesterUtil.isEmpty( ForesterUtil.JAVA_VENDOR ) ) {
             System.out.println();
             System.out.println( "[running on Java " + ForesterUtil.JAVA_VERSION + " " + ForesterUtil.JAVA_VENDOR + "]" );
@@ -741,6 +765,14 @@ public final class ForesterUtil {
         System.out.println();
     }
 
+    final public static void printProgramInformation( final String prg_name,
+                                                      final String prg_version,
+                                                      final String date,
+                                                      final String email,
+                                                      final String www ) {
+        printProgramInformation( prg_name, null, prg_version, date, email, www, null );
+    }
+
     final public static void printWarningMessage( final String prg_name, final String message ) {
         System.out.println( "[" + prg_name + "] > warning: " + message );
     }