+ String nogapold = jalview.analysis.AlignSeq.extractGaps(
+ jalview.util.Comparison.GapChars, new String(
+ command.string[i]));
+ if (!nogaprep.toLowerCase().equals(nogapold.toLowerCase()))
+ {
+ if (newDSWasNeeded)
+ {
+ SequenceI oldds = command.seqs[i].getDatasetSequence();
+ command.seqs[i].setDatasetSequence(command.oldds[i]);
+ command.oldds[i] = oldds;
+ }
+ else
+ {
+ if (command.oldds == null)
+ {
+ command.oldds = new SequenceI[command.seqs.length];
+ }
+ command.oldds[i] = command.seqs[i].getDatasetSequence();
+ SequenceI newds = new Sequence(
+ command.seqs[i].getDatasetSequence());
+ String fullseq, osp = newds.getSequenceAsString();
+ fullseq = osp.substring(0, ipos) + nogaprep
+ + osp.substring(ipos + nogaprep.length());
+ newds.setSequence(fullseq.toUpperCase());
+ // TODO: JAL-1131 ensure newly created dataset sequence is added to
+ // the set of
+ // dataset sequences associated with the alignment.
+ // TODO: JAL-1131 fix up any annotation associated with new dataset
+ // sequence to ensure that original sequence/annotation relationships
+ // are preserved.
+ command.seqs[i].setDatasetSequence(newds);
+
+ }
+ }