- /*
- * Add to the sequence (sets copyAnn.datasetSequence), unless the
- * original annotation is already on the sequence.
- */
- if (!seq.hasAnnotation(ann))
- {
- ContactMatrixI cm = seq.getDatasetSequence()
- .getContactMatrixFor(ann);
- if (cm != null)
- {
- seq.addContactListFor(copyAnn, cm);
- }
- seq.addAlignmentAnnotation(copyAnn);
- }
- // adjust for gaps
- copyAnn.adjustForAlignment();
- // add to the alignment and set visible
- alignment.addAnnotation(copyAnn);
- copyAnn.visible = true;
-
- return copyAnn;
+ }
+ copyAnn.restrict(startRes, endRes + 0);
+
+ /*
+ * Add to the sequence (sets copyAnn.datasetSequence), unless the
+ * original annotation is already on the sequence.
+ */
+ if (!seq.hasAnnotation(ann))
+ {
+ ContactMatrixI cm = seq.getDatasetSequence().getContactMatrixFor(ann);
+ if (cm != null)
+ {
+ seq.addContactListFor(copyAnn, cm);
+ }
+ seq.addAlignmentAnnotation(copyAnn);
+ }
+ // adjust for gaps
+ copyAnn.adjustForAlignment();
+ // add to the alignment and set visible
+ alignment.addAnnotation(copyAnn);
+ copyAnn.visible = true;
+
+ return copyAnn;