void liquidate_and_write(hid_t& file, std::vector<Region>& regions,
                         unsigned int extension, const std::string& bam_file_path)
{
  Liquidators liquidators((Liquidator(bam_file_path))); 

  tbb::parallel_for(
    tbb::blocked_range<int>(0, regions.size(), 1),
    [&](const tbb::blocked_range<int>& range)
    {
      liquidate_regions(regions, bam_file_path, range.begin(), range.end(), extension, liquidators);
    },
    tbb::auto_partitioner());

  write(file, regions);
}
void batch_liquidate(std::vector<CountH5Record>& counts,
                     const unsigned int bin_size,
                     const unsigned int extension,
                     const char strand,
                     const std::string& bam_file_path)
{
  Liquidators liquidators((Liquidator(bam_file_path))); 

  tbb::parallel_for(
    tbb::blocked_range<int>(0, counts.size(), 1),
    [&](const tbb::blocked_range<int>& range)
    {
      liquidate_bins(counts, bam_file_path, range.begin(), range.end(), bin_size, extension, strand, liquidators);
    },
    tbb::auto_partitioner());
}