@Override
 public void onTraversalDone(Long result) {
   super.onTraversalDone(result);
   out.println("Interval\tCallStatus\tCOV\tAVG");
   for (GenomeLoc interval : intervalList) {
     IntervalStatistics stats = intervalMap.get(interval);
     out.println(
         String.format(
             "%s\t%s\t%d\t%f",
             interval, stats.callableStatus(), stats.totalCoverage(), stats.averageCoverage()));
   }
 }
  @Override
  public void initialize() {
    super.initialize();

    if (intervalTrack == null)
      throw new UserException("This tool currently only works if you provide an interval track");

    parser =
        new GenomeLocParser(
            getToolkit()
                .getMasterSequenceDictionary()); // Important to initialize the parser before
                                                 // creating the intervals below

    List<GenomeLoc> originalList =
        intervalTrack.getIntervals(
            getToolkit()); // The original list of targets provided by the user that will be
                           // expanded or not depending on the options provided
    intervalList = new TreeSet<GenomeLoc>(new GenomeLocComparator());
    intervalMap = new HashMap<GenomeLoc, IntervalStatistics>(originalList.size() * 2);
    for (GenomeLoc interval : originalList) addAndExpandIntervalToLists(interval);

    intervalListIterator = intervalList.iterator();
  }