@Override
public SequenceI deriveSequence()
{
- SequenceI seq = new Sequence(this);
- if (datasetSequence != null)
- {
- // duplicate current sequence with same dataset
- seq.setDatasetSequence(datasetSequence);
- }
- else
+ Sequence seq=null;
+ if (datasetSequence == null)
{
if (isValidDatasetSequence())
{
// Use this as dataset sequence
+ seq = new Sequence(getName(), "", 1, -1);
seq.setDatasetSequence(this);
+ seq.initSeqFrom(this, getAnnotation());
+ return seq;
}
else
{
// Create a new, valid dataset sequence
- SequenceI ds = seq;
- ds.setSequence(AlignSeq.extractGaps(
- jalview.util.Comparison.GapChars, new String(sequence)));
- setDatasetSequence(ds);
- ds.setSequenceFeatures(getSequenceFeatures());
- seq = this; // and return this sequence as the derived sequence.
+ createDatasetSequence();
}
}
- return seq;
+ return new Sequence(this);
}
/*