From: gmungoc Date: Wed, 6 Jul 2016 11:42:11 +0000 (+0100) Subject: JAL-2110 cross-refs from protein to show cds not non-coding sequences X-Git-Tag: Release_2_10_0~140^2~5^2~17 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=90ad4273c7105b7763247192e1c6739eed30ba4c;hp=c14d9e8c9ff59de1857d4834ee70e80abf623415;p=jalview.git JAL-2110 cross-refs from protein to show cds not non-coding sequences --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 19b5b8c..88b0c35 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -4734,6 +4734,15 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, AlignmentI xrefsAlignment = makeCrossReferencesAlignment(dataset, xrefs); + final SequenceI[] sequenceSelection = AlignFrame.this.viewport + .getSequenceSelection(); + if (!dna) + { + xrefsAlignment = AlignmentUtils.makeCdsAlignment( + xrefsAlignment.getSequencesArray(), dataset, + sequenceSelection); + xrefsAlignment.alignAs(alignment); + } AlignFrame newFrame = new AlignFrame(xrefsAlignment, DEFAULT_WIDTH, DEFAULT_HEIGHT); @@ -4761,13 +4770,12 @@ 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); + sequenceSelection, dataset, + xrefsAlignment.getSequencesArray()); if (copyAlignment.getHeight() == 0) { System.err.println("Failed to make CDS alignment"); @@ -4821,7 +4829,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); }