+ /**\r
+ * Read AACon result with no alignment files. This method leaves incoming\r
+ * the InputStream results open!\r
+ * \r
+ * @param results\r
+ * output file of AAConservation\r
+ * @return Map with keys {@link Method} -> float[]\r
+ */\r
+ public static HashSet<Score> readAAConResults(InputStream results) {\r
+ if (results == null) {\r
+ throw new NullPointerException(\r
+ "InputStream with results must be provided");\r
+ }\r
+ HashSet<Score> annotations = new HashSet<Score>();\r
+ Scanner sc = new Scanner(results);\r
+ sc.useDelimiter("#");\r
+ while (sc.hasNext()) {\r
+ String line = sc.next();\r
+ int spacePos = line.indexOf(" ");\r
+ assert spacePos > 0 : "Space is expected as delimited between method "\r
+ + "name and values!";\r
+ String methodLine = line.substring(0, spacePos);\r
+ Method method = Method.getMethod(methodLine);\r
+ assert method != null : "Method " + methodLine\r
+ + " is not recognized! ";\r
+ Scanner valuesScanner = new Scanner(line.substring(spacePos));\r
+ ArrayList<Float> values = new ArrayList<Float>();\r
+ while (valuesScanner.hasNextDouble()) {\r
+ Double value = valuesScanner.nextDouble();\r
+ values.add(value.floatValue());\r
+ }\r
+ annotations.add(new Score(method, values));\r
+ }\r
+ return annotations;\r
+ }\r
+\r