}
ColumnSelection cs = av.getColumnSelection();
HiddenColumns hc = av.getAlignment().getHiddenColumns();
- int offp = (rseq != null) ? rseq.findIndex(rseq.getStart() + colm)
+ AlignmentAnnotation aa = tp.getAssocAnnotation();
+ int offp=-1;
+ if (aa != null)
+ {
+ ContactMatrixI cm = av.getContactMatrix(aa);
+ if (cm instanceof MappableContactMatrixI)
+ {
+ MappableContactMatrixI mcm = (MappableContactMatrixI) cm;
+ int pos[]=mcm.getMappedPositionsFor(rseq, colm);
+ if (pos!=null)
+ {
+ offp=rseq.findIndex(pos[0])-1;
+ } else {
+ offp=-2;
+ }
+ }
+ }
+ if (offp==-1)
+ {
+ // assume a direct mapping to reference or column number
+ offp = (rseq != null) ? rseq.findIndex(rseq.getStart() + colm)
: colm;
+ }
if (!av.hasHiddenColumns())
{
- return cs.contains(offp - 1);
+ return cs.contains(offp);
}
if (hc.isVisible(offp - 1))
{
continue;
}
// TODO: handle ranges...
- offp = seqpos[0];
+ offp = seqpos[0]-1;
}
else
{