JWS-36 patched Scores writer to put spaces between ranges and space separated scores
authorjprocter <jprocter@compbio.dundee.ac.uk>
Fri, 1 Jun 2012 09:57:51 +0000 (10:57 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Fri, 1 Jun 2012 09:57:51 +0000 (10:57 +0100)
datamodel/compbio/data/sequence/Score.java

index ec4cadc..fed0ef0 100644 (file)
@@ -187,12 +187,13 @@ public class Score implements Comparable<Score> {
         * \r
         * <pre>\r
         * {@code\r
-        * #MethodName <space separated list of values>\r
+        * #MethodName [comma separated list of ranges] <space separated list of values>\r
         *        \r
         * For example:\r
         *       \r
         * #KABAT 0.2 0.3 0.2 0 0.645 0.333 1 1 0 0\r
         * #SMERFS 0.645 0.333 1 1 0 0 0.2 0.3 0.2 0\r
+        * #COILS 22-33, 44-56 0.121 3.212\r
         * }\r
         * </pre>\r
         * \r
@@ -212,17 +213,17 @@ public class Score implements Comparable<Score> {
                        throw new NullPointerException("Writer must be provided!");\r
                }\r
                for (Score score : scores) {\r
-                       writer.write("#" + score.method + " ");\r
+                       writer.write("#" + score.method);\r
                        int count = score.ranges.size();\r
                        for (Range range : score.ranges) {\r
                                count--;\r
-                               writer.write(range.toString());\r
+                               writer.write(" "+range.toString());\r
                                if (count != 0) {\r
-                                       writer.write(", ");\r
+                                       writer.write(",");\r
                                }\r
                        }\r
                        for (Float scoreVal : score.scores) {\r
-                               writer.write(NUMBER_FORMAT.format(scoreVal) + " ");\r
+                               writer.write(" "+NUMBER_FORMAT.format(scoreVal));\r
                        }\r
                        writer.write("\n");\r
                        writer.flush();\r