}
}
FirstSeq = 0;
- al.setDataset(null);
+ if (currentView.getDataset() != null)
+ {
+ al.setDataset(currentView.getDataset());
+ }
+ else
+ {
+ al.setDataset(null);
+ }
jalview.io.JnetAnnotationMaker.add_annotation(prediction, al,
FirstSeq, false, predMap);
}
else
{
- al.setDataset(null);
+ if (currentView.getDataset() != null)
+ {
+ al.setDataset(currentView.getDataset());
+
+ }
+ else
+ {
+ al.setDataset(null);
+ }
jalview.io.JnetAnnotationMaker.add_annotation(prediction, al,
FirstSeq, true, predMap);
SequenceI profileseq = al.getSequenceAt(0); // this includes any gaps.
}
}
}
+ // transfer to dataset
+ for (AlignmentAnnotation alant : al.getAlignmentAnnotation())
+ {
+ if (alant.sequenceRef != null)
+ {
+ replaceAnnotationOnAlignmentWith(alant, alant.label,
+ "jalview.jws1.Jpred", alant.sequenceRef);
+ }
+ }
return new Object[]
{ al, alcsel }; // , FirstSeq, noMsa};
}
/**
+ * copied from JabawsCalcWorker
+ *
+ * @param newAnnot
+ * @param typeName
+ * @param calcId
+ * @param aSeq
+ */
+ 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();
+ }
+
+ /**
* Given an alignment where all other sequences except profileseq are
* aligned to the ungapped profileseq, insert gaps in the other sequences to
* realign them with the residues in profileseq