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));
}
}
}
}