- final Alignment copyAlignment = new Alignment(new Alignment(
- AlignFrame.this.viewport.getSequenceSelection()));
+ /*
+ * Make a copy of this alignment (sharing the same dataset
+ * sequences). If we are DNA, drop introns and update mappings
+ */
+ AlignmentI copyAlignment = null;
+ final SequenceI[] sequenceSelection = AlignFrame.this.viewport
+ .getSequenceSelection();
+ if (dna)
+ {
+ copyAlignment = AlignmentUtils.makeExonAlignment(
+ sequenceSelection, cf);
+ al.getCodonFrames().clear();
+ al.getCodonFrames().addAll(cf);
+ final StructureSelectionManager ssm = StructureSelectionManager
+ .getStructureSelectionManager(Desktop.instance);
+ ssm.addMappings(cf);
+ }
+ else
+ {
+ copyAlignment = new Alignment(new Alignment(
+ sequenceSelection));
+ }