{
if (datasetSequence == null)
{
- datasetSequence = new Sequence(getName(), AlignSeq.extractGaps(
+ Sequence dsseq = new Sequence(getName(), AlignSeq.extractGaps(
jalview.util.Comparison.GapChars, getSequenceAsString()),
getStart(), getEnd());
- datasetSequence.setSequenceFeatures(getSequenceFeatures());
- datasetSequence.setDescription(getDescription());
- setSequenceFeatures(null);
- // move database references onto dataset sequence
- datasetSequence.setDBRefs(getDBRefs());
- setDBRefs(null);
- datasetSequence.setPDBId(getAllPDBEntries());
- setPDBId(null);
+
+ datasetSequence = dsseq;
+
+ dsseq.setDescription(description);
+ // move features and database references onto dataset sequence
+ dsseq.sequenceFeatures = sequenceFeatures;
+ sequenceFeatures=null;
+ dsseq.dbrefs = dbrefs;
+ dbrefs=null;
+ // TODO: search and replace any references to this sequence with
+ // references to the dataset sequence in Mappings on dbref
+ dsseq.pdbIds = pdbIds;
+ pdbIds = null;
datasetSequence.updatePDBIds();
if (annotation != null)
{
+ // annotation is cloned rather than moved, to preserve what's currently
+ // on the alignment
for (AlignmentAnnotation aa : annotation)
{
AlignmentAnnotation _aa = new AlignmentAnnotation(aa);