JAL-2144 TODO - new methods for canonicalisation and comparison of source strings...
[jalview.git] / src / jalview / gui / AlignFrame.java
index 88b0c35..891fdd6 100644 (file)
@@ -4734,13 +4734,10 @@ 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.getSequencesArray(), dataset, sel);
             xrefsAlignment.alignAs(alignment);
           }
 
@@ -4773,8 +4770,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           boolean copyAlignmentIsAligned = false;
           if (dna)
           {
-            copyAlignment = AlignmentUtils.makeCdsAlignment(
-                    sequenceSelection, dataset,
+            copyAlignment = AlignmentUtils.makeCdsAlignment(sel, dataset,
                     xrefsAlignment.getSequencesArray());
             if (copyAlignment.getHeight() == 0)
             {
@@ -4795,8 +4791,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           }
           else
           {
-            copyAlignment = AlignmentUtils.makeCopyAlignment(
-                    sequenceSelection, xrefs.getSequencesArray(), dataset);
+            copyAlignment = AlignmentUtils.makeCopyAlignment(sel,
+                    xrefs.getSequencesArray(), dataset);
           }
           copyAlignment.setGapCharacter(AlignFrame.this.viewport
                   .getGapCharacter());
@@ -4829,6 +4825,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
              * align cdna to protein - currently only if 
              * fetching and aligning Ensembl transcripts!
              */
+            // TODO: generalise for other sources of locus/transcript/cds data
             if (dna && DBRefSource.ENSEMBL.equalsIgnoreCase(source))
             {
               copyAlignment.alignAs(xrefsAlignment);
@@ -4888,6 +4885,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