Esempio n. 1
0
 public void setSelectedChromosomesNoRefresh(
     Chromosome xChrom, Chromosome yChrom, Context xContext, Context yContext) {
   chrBox1.setSelectedIndex(yChrom.getIndex());
   chrBox2.setSelectedIndex(xChrom.getIndex());
   rulerPanelX.setContext(xContext, HiCRulerPanel.Orientation.HORIZONTAL);
   rulerPanelY.setContext(yContext, HiCRulerPanel.Orientation.VERTICAL);
   resolutionSlider.setEnabled(!xChrom.getName().equals(Globals.CHR_ALL));
 }
Esempio n. 2
0
  public void unsafeRefreshChromosomes(SuperAdapter superAdapter) {

    if (chrBox1.getSelectedIndex() == 0 || chrBox2.getSelectedIndex() == 0) {
      chrBox1.setSelectedIndex(0);
      chrBox2.setSelectedIndex(0);
    }

    Chromosome chr1 = (Chromosome) chrBox1.getSelectedItem();
    Chromosome chr2 = (Chromosome) chrBox2.getSelectedItem();

    Chromosome chrX = chr1.getIndex() < chr2.getIndex() ? chr1 : chr2;
    Chromosome chrY = chr1.getIndex() < chr2.getIndex() ? chr2 : chr1;

    setNormalizationDisplayState(superAdapter.getHiC());

    superAdapter.unsafeUpdateHiCChromosomes(chrX, chrY);

    updateThumbnail(superAdapter.getHiC());
  }
Esempio n. 3
0
  private void unsafeSave1DTrackToWigFile(
      Chromosome chromosomeForPosition, PrintWriter printWriter, int binStartPosition)
      throws IOException {
    int resolution = getZoom().getBinSize();
    for (Chromosome chromosome : chromosomes) {
      if (chromosome.getName().equals(Globals.CHR_ALL)) continue;
      Matrix matrix = null;
      if (displayOption == MatrixType.OBSERVED) {
        matrix = dataset.getMatrix(chromosomeForPosition, chromosome);
      } else if (displayOption == MatrixType.CONTROL) {
        matrix = controlDataset.getMatrix(chromosomeForPosition, chromosome);
      }

      if (matrix == null) continue;

      MatrixZoomData zd = matrix.getZoomData(currentZoom);
      printWriter.println(
          "fixedStep chrom=chr"
              + chromosome.getName().replace("chr", "")
              + " start=1 step="
              + resolution
              + " span="
              + resolution);

      int[] regionIndices;
      if (chromosomeForPosition.getIndex() < chromosome.getIndex()) {
        regionIndices = new int[] {binStartPosition, binStartPosition, 0, chromosome.getLength()};
      } else {
        regionIndices = new int[] {0, chromosome.getLength(), binStartPosition, binStartPosition};
      }

      zd.dump1DTrackFromCrossHairAsWig(
          printWriter,
          chromosomeForPosition,
          binStartPosition,
          chromosomeForPosition.getIndex() == chromosome.getIndex(),
          regionIndices,
          normalizationType,
          displayOption,
          getExpectedValues());
    }
  }
Esempio n. 4
0
 private boolean isIntraChromosomal() {
   Chromosome chr1 = (Chromosome) chrBox1.getSelectedItem();
   Chromosome chr2 = (Chromosome) chrBox2.getSelectedItem();
   return chr1.getIndex() != chr2.getIndex();
 }
Esempio n. 5
0
 /*
  * Only accessed from within another unsafe method in Heatmap Panel class,
  * which in turn is encapsulated (i.e. made safe)
  */
 public void unsafeSetSelectedChromosomes(
     SuperAdapter superAdapter, Chromosome xChrom, Chromosome yChrom) {
   chrBox1.setSelectedIndex(yChrom.getIndex());
   chrBox2.setSelectedIndex(xChrom.getIndex());
   unsafeRefreshChromosomes(superAdapter);
 }