| 2263 | } |
| 2264 | |
| 2265 | private int[] writeClusterFastaFiles(ArrayList<ArrayDeque<CompressedFastaRecord>> clusterRecords, String outdir) throws IOException { |
| 2266 | int size = clusterRecords.size(); |
| 2267 | int[] counts = new int[size]; |
| 2268 | for (int cid=0; cid<size; ++cid) { |
| 2269 | String filePath = outdir + File.separator + cid + File.separator + cid + FASTA_EXT + GZIP_EXT; |
| 2270 | FastaWriter fw = new FastaWriter(filePath, false); |
| 2271 | ArrayDeque<CompressedFastaRecord> records = clusterRecords.get(cid); |
| 2272 | for (CompressedFastaRecord f : records) { |
| 2273 | fw.write(f.name, f.seqbits.toString()); |
| 2274 | } |
| 2275 | fw.close(); |
| 2276 | counts[cid] = records.size(); |
| 2277 | } |
| 2278 | return counts; |
| 2279 | } |
| 2280 | |
| 2281 | public int[] extractClustersFromOverlaps(String outdir, int maxMergedClusterSize) throws IOException { |
| 2282 | Timer timer = new Timer(); |