final boolean openInNewWindow = (response == 2);
/*
- * Create the AlignFrame first (which creates the new alignment's datasets),
- * before attempting sequence mapping.
- */
- AlignFrame newAlignFrame = new AlignFrame(al, AlignFrame.DEFAULT_WIDTH,
- AlignFrame.DEFAULT_HEIGHT);
- newAlignFrame.setTitle(title);
-
- /*
* Identify protein and dna alignments. Make a copy of this one if opening
* in a new split pane.
*/
AlignmentI protein = al.isNucleotide() ? thisAlignment : al;
final AlignmentI cdna = al.isNucleotide() ? al : thisAlignment;
+ /*
+ * Map sequences. At least one should get mapped as we have already passed
+ * the test for 'mappability'. Any mappings made will be added to the
+ * protein alignment. Note creating dataset sequences on the new alignment
+ * is a pre-requisite for building mappings.
+ */
+ al.setDataset(null);
+ AlignmentUtils.mapProteinToCdna(protein, cdna);
+
+ /*
+ * Create the AlignFrame for the added alignment. Note this will include the
+ * cDNA consensus annotation if it is protein (because the alignment holds
+ * mappings to nucleotide)
+ */
+ AlignFrame newAlignFrame = new AlignFrame(al, AlignFrame.DEFAULT_WIDTH,
+ AlignFrame.DEFAULT_HEIGHT);
+ newAlignFrame.setTitle(title);
newAlignFrame.statusBar.setText(MessageManager.formatMessage(
"label.successfully_loaded_file", new Object[]
{ title }));
AlignFrame.DEFAULT_HEIGHT);
}
- /*
- * Map sequences. At least one should get mapped as we have already passed
- * the test for 'mappability'. Any mappings made will be added to the
- * protein alignment.
- */
- AlignmentUtils.mapProteinToCdna(protein, cdna);
-
try
{
newAlignFrame.setMaximum(jalview.bin.Cache.getDefault(
AlignmentI complement, Set<AlignedCodonFrame> mappings)
{
/*
- * Open in split pane. DNA sequence above, protein below.
+ * Make a new frame with a copy of the alignment we are adding to. If this
+ * is protein, the new frame will have a cDNA consensus annotation row
+ * added.
*/
AlignFrame copyMe = new AlignFrame(complement,
AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
proteinFrame.setVisible(true);
String linkedTitle = MessageManager
.getString("label.linked_view_title");
+
+ /*
+ * Open in split pane. DNA sequence above, protein below.
+ */
JInternalFrame splitFrame = new SplitFrame(cdnaFrame, proteinFrame);
Desktop.addInternalFrame(splitFrame, linkedTitle, -1, -1);