MCPcopy Create free account
hub / github.com/BirolLab/RNA-Bloom / emptyClusterFastaBuffer

Method emptyClusterFastaBuffer

src/rnabloom/olc/Layout.java:2493–2507  ·  view source on GitHub ↗
(HashMap<Integer, ArrayDeque<CompressedFastaRecord>> clusterRecords, 
            String outdir, boolean append)

Source from the content-addressed store, hash-verified

2491 }
2492
2493 private void emptyClusterFastaBuffer(HashMap<Integer, ArrayDeque<CompressedFastaRecord>> clusterRecords,
2494 String outdir, boolean append) throws IOException {
2495 if (!clusterRecords.isEmpty()) {
2496 for (Map.Entry<Integer, ArrayDeque<CompressedFastaRecord>> e : clusterRecords.entrySet()) {
2497 int cid = e.getKey();
2498 String filePath = outdir + File.separator + cid + File.separator + cid + FASTA_EXT + GZIP_EXT;
2499 FastaWriter fw = new FastaWriter(filePath, append);
2500 for (CompressedFastaRecord f : e.getValue()) {
2501 fw.write(f.name, f.seqbits.toString());
2502 }
2503 fw.close();
2504 }
2505 clusterRecords.clear();
2506 }
2507 }
2508
2509 private void emptyOrphanRecords(ArrayDeque<CompressedFastaRecord> records,
2510 String outdir, boolean append) throws IOException {

Callers 1

Calls 3

writeMethod · 0.95
closeMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected