Пример #1
0
  /**
   * Called from alt-drag zoom
   *
   * @param xBP0
   * @param yBP0
   * @param targetBinSize
   */
  public void zoomToDrawnBox(final int xBP0, final int yBP0, final double targetBinSize) {

    HiCZoom newZoom = currentZoom;
    if (!isResolutionLocked()) {
      List<HiCZoom> zoomList =
          currentZoom.getUnit() == HiC.Unit.BP ? dataset.getBpZooms() : dataset.getFragZooms();
      for (int i = zoomList.size() - 1; i >= 0; i--) {
        if (zoomList.get(i).getBinSize() >= targetBinSize) {
          newZoom = zoomList.get(i);
          break;
        }
      }

      // this addresses draw box to zoom when down from low res pearsons
      // it can't zoom all the way in, but can zoom in a little more up to 500K
      if (isInPearsonsMode() && newZoom.getBinSize() < HiCGlobals.MAX_PEARSON_ZOOM) {
        for (int i = zoomList.size() - 1; i >= 0; i--) {
          if (zoomList.get(i).getBinSize() >= HiCGlobals.MAX_PEARSON_ZOOM) {
            newZoom = zoomList.get(i);
            break;
          }
        }
      }
    }

    safeActuallySetZoomAndLocation(
        newZoom,
        xBP0,
        yBP0,
        newZoom.getBinSize() / targetBinSize,
        false,
        ZoomCallType.DRAG,
        "DragZoom",
        true);
  }
Пример #2
0
  public String getLocationDescription() {
    String xChr = xContext.getChromosome().getName();
    String yChr = yContext.getChromosome().getName();

    if (!(xChr.toLowerCase().contains("chr"))) xChr = "chr" + xChr;
    if (!(yChr.toLowerCase().contains("chr"))) yChr = "chr" + yChr;

    return "setlocation "
        + xChr
        + " "
        + yChr
        + " "
        + currentZoom.getUnit().toString()
        + " "
        + currentZoom.getBinSize()
        + " "
        + xContext.getBinOrigin()
        + " "
        + yContext.getBinOrigin()
        + " "
        + getScaleFactor();
  }