for (SequenceFeature sf : overlaps)
{
Color featureColour = fc.getColor(sf);
- int visibleStart = Math.max(sf.getBegin(),
- visiblePositions.getBegin());
+
+ /*
+ * if feature starts/ends outside the visible range,
+ * restrict to visible positions (or if a contact feature,
+ * to a single position)
+ */
+ int visibleStart = sf.getBegin();
+ if (visibleStart < visiblePositions.getBegin())
+ {
+ visibleStart = sf.isContactFeature() ? sf.getEnd()
+ : visiblePositions.getBegin();
+ }
+ int visibleEnd = sf.getEnd();
+ if (visibleEnd > visiblePositions.getEnd())
+ {
+ visibleEnd = sf.isContactFeature() ? sf.getBegin()
+ : visiblePositions.getEnd();
+ }
+
int featureStartCol = seq.findIndex(visibleStart);
- int visibleEnd = Math.min(sf.getEnd(), visiblePositions.getEnd());
int featureEndCol = sf.begin == sf.end ? featureStartCol : seq
.findIndex(visibleEnd);