Search in sources :

Example 1 with BedWriter

use of au.edu.wehi.idsv.bed.BedWriter in project gridss by PapenfussLab.

the class IntervalCoverageAccumulator method writeToBed.

public void writeToBed(File bed) throws IOException {
    try (BedWriter writer = new BedWriter(dictionary, bed)) {
        for (int i = 0; i < coverage.length; i++) {
            ObjectBidirectionalIterator<Entry> it = coverage[i].iterator();
            while (it.hasNext()) {
                Entry e = it.next();
                int start = e.getIntKey();
                int binWidth = coverage[i].getBinSize(start);
                int end = start + binWidth - 1;
                writer.write(i, start, end, coverage[i].getMeanValue(start));
            }
        }
    }
}
Also used : Entry(it.unimi.dsi.fastutil.ints.Int2DoubleMap.Entry) BedWriter(au.edu.wehi.idsv.bed.BedWriter)

Aggregations

BedWriter (au.edu.wehi.idsv.bed.BedWriter)1 Entry (it.unimi.dsi.fastutil.ints.Int2DoubleMap.Entry)1