- af.addToDisplay(embedded);
- }
- else
- {
- SplitFrame sf = new SplitFrame(af, af2);
- sf.addToDisplay(embedded, JalviewLite.this);
+ AlignmentI al1 = af.viewport.getAlignment();
+ AlignmentI al2 = af2.viewport.getAlignment();
+ AlignmentI cdna = al1.isNucleotide() ? al1 : al2;
+ AlignmentI prot = al1.isNucleotide() ? al2 : al1;
+ if (AlignmentUtils.mapProteinAlignmentToCdna(prot, cdna))
+ {
+ al2.alignAs(al1);
+ SplitFrame sf = new SplitFrame(af, af2);
+ sf.addToDisplay(embedded, JalviewLite.this);
+ return;
+ }
+ else
+ {
+ String msg = "Could not map any sequence in " + af2.getTitle()
+ + " as "
+ + (al1.isNucleotide() ? "protein product" : "cDNA")
+ + " for " + af.getTitle();
+ System.err.println(msg);
+ }