Ejemplo n.º 1
0
  @Override
  public boolean handleDataClick(TrackClickEvent te) {
    MouseEvent e = te.getMouseEvent();
    Feature f = getFeatureAtMousePosition(te);

    // We allow any of these modifier keys for multi-select
    if (!e.isShiftDown() && !e.isControlDown() && !e.isMetaDown()) {
      clearSelectedExons();
    }

    boolean foundExon = false;
    if (f != null && f instanceof IGVFeature) {
      selectedFeature = (IGVFeature) f;
      double location = te.getFrame().getChromosomePosition(e.getX());
      if (selectedFeature.getExons() != null) {
        for (Exon exon : selectedFeature.getExons()) {
          if (location >= exon.getStart() && location < exon.getEnd()) {
            selectedExons.add(exon);
            foundExon = true;
            break;
          }
        }
      }
    }

    ((SelectableFeatureRenderer) getRenderer()).setSelectedExons(selectedExons);

    return foundExon;
  }
Ejemplo n.º 2
0
  public FeatureWrappedAlignment(BasicFeature f) {

    this.readName = f.getName();
    this.chr = f.getChr();
    this.start = f.getStart();
    this.end = f.getEnd();
    strand = f.getStrand();

    if (f.getExonCount() > 0) {
      blocks = new AlignmentBlock[f.getExonCount()];
      int i = 0;
      for (Exon exon : f.getExons()) {
        int length = exon.getLength();
        byte[] seq = new byte[length];
        blocks[i] = new AlignmentBlock(exon.getStart(), seq, seq, this);
        i++;
      }
    }
  }