import jalview.datamodel.ColumnSelection;
import jalview.datamodel.ContactListI;
import jalview.datamodel.ContactRange;
+import jalview.datamodel.GraphLine;
import jalview.datamodel.HiddenColumns;
import jalview.datamodel.SequenceI;
import jalview.gui.JalviewColourChooser.ColourChooserListener;
import jalview.util.Platform;
import jalview.viewmodel.ViewportListenerI;
import jalview.viewmodel.ViewportRanges;
+import jalview.ws.datamodel.alphafold.PAEContactMatrix;
/**
* AnnotationPanel displays visible portion of annotation rows below unwrapped
if (graphStretch != -1)
{
- if (aa[graphStretch].graph == AlignmentAnnotation.CUSTOMRENDERER)
+ if (aa[graphStretch].graph == AlignmentAnnotation.CONTACT_MAP)
{
+ // data in row has position on y as well as x axis
if (evt.isAltDown() || evt.isAltGraphDown())
{
dragMode = DragMode.MatrixSelect;
}
else
{
+ GraphLine thr = aa[graphStretch].getThreshold();
int currentX = getColumnForXPos(evt.getX());
ContactListI forCurrentX = av.getContactList(aa[graphStretch],
currentX);
int fr, to;
fr = Math.min(cXci.cStart, cXci.cEnd);
to = Math.max(cXci.cStart, cXci.cEnd);
- for (int c = fr; c <= to; c++)
+ // select corresponding range in segment under mouse
{
- av.getColumnSelection().addElement(c);
+ for (int c = fr; c <= to; c++)
+ {
+ av.getColumnSelection().addElement(c);
+ }
+ av.getColumnSelection().addElement(currentX);
+ }
+ // PAE SPECIFIC
+ // and also select everything lower than the max range adjacent
+ // (kind of works)
+ if (PAEContactMatrix.PAEMATRIX.equals(aa[graphStretch].getCalcId()))
+ {
+ int c = fr - 1;
+ ContactRange cr = forCurrentX.getRangeFor(fr, to);
+ double cval;
+ // TODO: could use GraphLine instead of arbitrary picking
+ // TODO: could report mean/median/variance for partitions (contiguous selected vs unselected regions and inter-contig regions)
+ // controls feathering - what other elements in row/column should we select
+ double thresh=cr.getMean()+(cr.getMax()-cr.getMean())*.15;
+ while (c > 0)
+ {
+ cval = forCurrentX.getContactAt(c);
+ if (// cr.getMin() <= cval &&
+ cval <= thresh)
+ {
+ av.getColumnSelection().addElement(c--);
+ }
+ else
+ {
+ break;
+ }
+ }
+ c = to;
+ while (c < forCurrentX.getContactHeight())
+ {
+ cval = forCurrentX.getContactAt(c);
+ if (// cr.getMin() <= cval &&
+ cval <= thresh)
+ {
+ av.getColumnSelection().addElement(c++);
+ }
+ else
+ {
+ break;
+ }
+ }
}
- av.getColumnSelection().addElement(currentX);
}
}
}
* but could also be a matrix drag
*/
if ((evt.isAltDown() || evt.isAltGraphDown()) && (av.getAlignment()
- .getAlignmentAnnotation()[graphStretch].graph == AlignmentAnnotation.CUSTOMRENDERER))
+ .getAlignmentAnnotation()[graphStretch].graph == AlignmentAnnotation.CONTACT_MAP))
{
/*
* dragging in a matrix
tooltip = ann.annotations[column].description;
}
// TODO abstract tooltip generator so different implementations can be built
- if (ann.graph == AlignmentAnnotation.CUSTOMRENDERER)
+ if (ann.graph == AlignmentAnnotation.CONTACT_MAP)
{
ContactListI clist = av.getContactList(ann, column);
if (clist != null)