public void balanceValues() {
   float value2Balance = 0;
   if ((-1 * minValue) > maxValue) value2Balance = -1 * minValue;
   else value2Balance = -1 * maxValue;
   // set zero as base value
   bases.add(0, new Integer(1));
   values.add(0, new Float(0));
   // any negative values? Don't set unless so.
   if (minValue < 0) {
     bases.add(0, new Integer(0));
     values.add(0, new Float(value2Balance));
   }
 }
  /**
   * Makes a stair step heat map from an array of windows in bar format. One per chromosome. Don't
   * forget to set the barDirectory and score Index!!!!!!!
   */
  public void makeStairStepBarFiles() {
    // make bar parser
    BarParser bp = new BarParser();
    bp.setZipCompress(true);
    HashMap<String, String> tagVals = new HashMap<String, String>();
    tagVals.put(BarParser.GRAPH_TYPE_TAG, BarParser.GRAPH_TYPE_STAIRSTEP);
    tagVals.put(BarParser.GRAPH_TYPE_COLOR_TAG, "#FF00FF"); // fusha
    tagVals.put(BarParser.SOURCE_TAG, bedFile.toString());

    // for each chromosome
    System.out.print("Printing... ");
    Iterator<String> it = bedLinesHash.keySet().iterator();
    while (it.hasNext()) {
      chromosome = it.next();
      System.out.print(chromosome + " ");
      windows = bedLinesHash.get(chromosome);
      // add blocks
      assembleBlocks();
      // balance by adding max or min at zero base
      balanceValues();
      // write bar file
      File barFile = new File(barDirectory, chromosome + ".bar");
      bp.writeBarFile(
          barFile,
          chromosome,
          genomeVersion,
          '.',
          Num.arrayListOfIntegerToInts(bases),
          Num.arrayListOfFloatToArray(values),
          tagVals);
      // clear ArrayLists
      bases.clear();
      values.clear();
    }
    System.out.println();
  }
 /** Adds a gr line to the global ArrayLists for later burning to bar. */
 public void add(int base, float value) {
   bases.add(new Integer(base));
   values.add(new Float(value));
 }