X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FAlignFrame.java;h=04cee93018aabc56b33bb56fe86abe3cc5e1a0d8;hb=d211aa8ae5e8bde93be7f42ab2f23f88464c6e3c;hp=b310ab9f448bfe79bf310a04214a883a78ff125c;hpb=1488d223bc6be5b47695a8153205cc9ff8c8095d;p=jalview.git diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index b310ab9..04cee93 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -4734,6 +4734,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, AlignmentI xrefsAlignment = makeCrossReferencesAlignment(dataset, xrefs); + if (!dna) + { + xrefsAlignment = AlignmentUtils.makeCdsAlignment( + xrefsAlignment.getSequencesArray(), dataset, sel); + xrefsAlignment.alignAs(alignment); + } AlignFrame newFrame = new AlignFrame(xrefsAlignment, DEFAULT_WIDTH, DEFAULT_HEIGHT); @@ -4761,13 +4767,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, * sequences). If we are DNA, drop introns and update mappings */ AlignmentI copyAlignment = null; - final SequenceI[] sequenceSelection = AlignFrame.this.viewport - .getSequenceSelection(); boolean copyAlignmentIsAligned = false; if (dna) { - copyAlignment = AlignmentUtils.makeCdsAlignment( - sequenceSelection, dataset, xrefsAlignment); + copyAlignment = AlignmentUtils.makeCdsAlignment(sel, dataset, + xrefsAlignment.getSequencesArray()); if (copyAlignment.getHeight() == 0) { System.err.println("Failed to make CDS alignment"); @@ -4787,8 +4791,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } else { - copyAlignment = AlignmentUtils.makeCopyAlignment( - sequenceSelection, xrefs.getSequencesArray()); + copyAlignment = AlignmentUtils.makeCopyAlignment(sel, + xrefs.getSequencesArray(), dataset); } copyAlignment.setGapCharacter(AlignFrame.this.viewport .getGapCharacter()); @@ -4821,7 +4825,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, * align cdna to protein - currently only if * fetching and aligning Ensembl transcripts! */ - if (DBRefSource.ENSEMBL.equalsIgnoreCase(source)) + if (dna && DBRefSource.ENSEMBL.equalsIgnoreCase(source)) { copyAlignment.alignAs(xrefsAlignment); } @@ -4880,6 +4884,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, * Makes an alignment containing the given sequences, and adds them to the * given dataset, which is also set as the dataset for the new alignment * + * TODO: refactor to DatasetI method + * * @param dataset * @param seqs * @return