in progress
[jalview.git] / forester / java / src / org / forester / util / ForesterUtil.java
index 5af580b..58dbf45 100644 (file)
@@ -96,6 +96,17 @@ public final class ForesterUtil {
         }
     }
 
+    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
      * minColor, if value is equal to max the returned color is maxColor,
@@ -573,8 +584,8 @@ public final class ForesterUtil {
                                          final Map<?, ?> data,
                                          final String entry_separator,
                                          final String data_separator ) throws IOException {
+        boolean first = true;
         for( final Entry<?, ?> entry : data.entrySet() ) {
-            boolean first = true;
             if ( !first ) {
                 writer.write( data_separator );
             }