(String[] args)
| 95 | } |
| 96 | |
| 97 | public static void main (String[] args) throws Exception { |
| 98 | String line; |
| 99 | BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); |
| 100 | while ((line = in.readLine()) != null) { |
| 101 | if (line.startsWith(">THREE")) break; |
| 102 | } |
| 103 | |
| 104 | StringBuilder sbuilder = new StringBuilder(); |
| 105 | while ((line = in.readLine()) != null) { |
| 106 | sbuilder.append(line); |
| 107 | } |
| 108 | |
| 109 | ExecutorService pool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); |
| 110 | int[] fragmentLengths = { 1, 2, 3, 4, 6, 12, 18 }; |
| 111 | List<Future<Map<String, knucleotide>>> futures = pool.invokeAll(createFragmentTasks(sbuilder.toString(), fragmentLengths)); |
| 112 | pool.shutdown(); |
| 113 | |
| 114 | // Print the length 1 & 2 counts. We know the offsets of the tasks, so we can cheat. |
| 115 | System.out.println(writeFrequencies(futures.get(0).get())); |
| 116 | System.out.println(writeFrequencies(sumTwoMaps(futures.get(1).get(), futures.get(2).get()))); |
| 117 | |
| 118 | System.out.println(writeCount(futures, "ggt")); |
| 119 | System.out.println(writeCount(futures, "ggta")); |
| 120 | System.out.println(writeCount(futures, "ggtatt")); |
| 121 | System.out.println(writeCount(futures, "ggtattttaatt")); |
| 122 | System.out.println(writeCount(futures, "ggtattttaatttatagt")); |
| 123 | } |
| 124 | |
| 125 | } |
nothing calls this directly
no test coverage detected