JAL-2738 use GeneLocus extends DBRefEntry to hold chromosomal mappings
[jalview.git] / src / jalview / gui / CrossRefAction.java
index 21a0a84..51ac2ee 100644 (file)
@@ -176,10 +176,14 @@ public class CrossRefAction implements Runnable
       /*
        * copy feature rendering settings to split frame
        */
-      newFrame.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer()
-              .transferSettings(myFeatureStyling);
-      copyThis.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer()
-              .transferSettings(myFeatureStyling);
+      FeatureRenderer fr1 = newFrame.alignPanel.getSeqPanel().seqCanvas
+              .getFeatureRenderer();
+      fr1.transferSettings(myFeatureStyling);
+      fr1.findAllFeatures(true);
+      FeatureRenderer fr2 = copyThis.alignPanel.getSeqPanel().seqCanvas
+              .getFeatureRenderer();
+      fr2.transferSettings(myFeatureStyling);
+      fr2.findAllFeatures(true);
 
       /*
        * apply 'database source' feature configuration
@@ -336,7 +340,7 @@ public class CrossRefAction implements Runnable
 
     /*
      * hack: ignore cross-references to Ensembl protein ids
-     * (can't fetch chromosomal mapping for these)
+     * (or use map/translation perhaps?)
      * todo: is there an equivalent in EnsemblGenomes?
      */
     if (accession.startsWith("ENSP"))
@@ -352,12 +356,12 @@ public class CrossRefAction implements Runnable
             seq.getLength());
     if (geneLoci != null)
     {
-      MapList map = geneLoci.getMap();
+      MapList map = geneLoci.getMapping();
       int mappedFromLength = MappingUtils.getLength(map.getFromRanges());
       if (mappedFromLength == seq.getLength())
       {
         seq.setGeneLoci(geneLoci.getSpeciesId(), geneLoci.getAssemblyId(),
-                geneLoci.getChromosomeId(), geneLoci.getMap());
+                geneLoci.getChromosomeId(), map);
         retrievedLoci.put(dbref, geneLoci);
         return true;
       }
@@ -370,12 +374,12 @@ public class CrossRefAction implements Runnable
             seq.getLength());
     if (geneLoci != null)
     {
-      MapList map = geneLoci.getMap();
+      MapList map = geneLoci.getMapping();
       int mappedFromLength = MappingUtils.getLength(map.getFromRanges());
       if (mappedFromLength == seq.getLength())
       {
         seq.setGeneLoci(geneLoci.getSpeciesId(), geneLoci.getAssemblyId(),
-                geneLoci.getChromosomeId(), geneLoci.getMap());
+                geneLoci.getChromosomeId(), map);
         retrievedLoci.put(dbref, geneLoci);
         return true;
       }