*/
final Iterable<AlignmentAnnotation> matchedAlignmentAnnotations = al
.findAnnotations(seq, dsann.getCalcId(), dsann.label);
- if (matchedAlignmentAnnotations == null
- || !matchedAlignmentAnnotations.iterator().hasNext())
+ boolean found=false;
+ if (matchedAlignmentAnnotations != null)
{
+ for (AlignmentAnnotation matched:matchedAlignmentAnnotations)
+ {
+ if (dsann.description.equals(matched.description))
+ {
+ found=true;
+ break;
+ }
+ }
+ }
+ if (!found) {
result.add(dsann);
if (labelForCalcId != null)
{
@Override
public String getAnnotDescr()
{
- return "Predicted Alignment Error for " + refSeq.getName();
+ return "Predicted Alignment Error"+((refSeq==null) ? "" : (" for " + refSeq.getName()));
}
@Override
public String getAnnotLabel()
{
StringBuilder label = new StringBuilder("PAE Matrix");
- if (this.getReferenceSeq() != null)
- {
- label.append(":").append(this.getReferenceSeq().getDisplayId(false));
- }
+ //if (this.getReferenceSeq() != null)
+ //{
+ // label.append(":").append(this.getReferenceSeq().getDisplayId(false));
+ //}
return label.toString();
}
SequenceI sq = new Sequence("a", "SSSQ");
ContactMatrixI cm = new SeqDistanceContactMatrix(4);
AlignmentAnnotation cm_aan = sq.addContactList(cm);
+ cm_aan.description = cm_aan.description + " cm1";
SequenceI dssq = sq.createDatasetSequence();
- Alignment ds = new Alignment(new SequenceI[] { dssq });
// remove annotation on our non-dataset sequence
sq.removeAlignmentAnnotation(sq.getAnnotation()[0]);
// test transfer
Alignment al = new Alignment(new SequenceI[] { sq });
SortedMap<String, String> tipEntries = new TreeMap<>();
- final Map<SequenceI, List<AlignmentAnnotation>> candidates = new LinkedHashMap<>();
+ Map<SequenceI, List<AlignmentAnnotation>> candidates = new LinkedHashMap<>();
AlignmentUtils.findAddableReferenceAnnotations(al.getSequences(),
tipEntries, candidates, al);
"No contact matrix recovered after reference annotation transfer",
cl);
+ ContactMatrixI cm2 = new SeqDistanceContactMatrix(4);
+ dssq.addContactList(cm2);
+ tipEntries = new TreeMap<>();
+ candidates = new LinkedHashMap<>();
+
+ AlignmentUtils.findAddableReferenceAnnotations(al.getSequences(),
+ tipEntries, candidates, al);
+ AlignmentUtils.addReferenceAnnotations(candidates, al, null);
+ assertTrue("Expected two contact map annotation transferred",
+ al.getAlignmentAnnotation() != null
+ && al.getAlignmentAnnotation().length == 2);
+
}
}