- * replace an existing sequence associated annotation with another, creating
- * association as necessary
- *
- * @param newAnnot
- * - annotation row used to create an instance on the dataset
- * sequence.
- * @param typeName
- * - label used to match existing row
- * @param calcId
- * - calcId for existing row
- * @param aSeq
- * - alignment sequence with reference to destination dataet sequence
- */
- protected void replaceAnnotationOnAlignmentWith(
- AlignmentAnnotation newAnnot, String typeName, String calcId,
- SequenceI aSeq)
- {
- SequenceI dsseq = aSeq.getDatasetSequence();
- while (dsseq.getDatasetSequence() != null)
- {
- dsseq = dsseq.getDatasetSequence();
- }
- // look for same annotation on dataset and lift this one over
- List<AlignmentAnnotation> dsan = dsseq.getAlignmentAnnotations(calcId,
- typeName);
- if (dsan != null && dsan.size() > 0)
- {
- for (AlignmentAnnotation dssan : dsan)
- {
- dsseq.removeAlignmentAnnotation(dssan);
- }
- }
- AlignmentAnnotation dssan = new AlignmentAnnotation(newAnnot);
- dsseq.addAlignmentAnnotation(dssan);
- dssan.adjustForAlignment();
- }
-
- /**