JAL-1705 refactored cross-reference fetching (CCDS, Uniprot, PDB)
[jalview.git] / src / jalview / ext / ensembl / EnsemblGene.java
index 5b57e5e..1325bec 100644 (file)
@@ -154,6 +154,11 @@ public class EnsemblGene extends EnsemblSeqProxy
     }
 
     Sequence transcript = new Sequence(accId, seqChars, 1, transcriptLength);
+    String geneName = (String) transcriptFeature.getValue(NAME);
+    if (geneName != null)
+    {
+      transcript.setDescription(geneName);
+    }
     transcript.createDatasetSequence();
 
     al.addSequence(transcript);
@@ -178,9 +183,7 @@ public class EnsemblGene extends EnsemblSeqProxy
 
   /**
    * Returns a list of the transcript features on the sequence whose Parent is
-   * the gene for the accession id. Also removes all transcript features from
-   * the gene sequence, as we have no further need for them and they obscure
-   * more useful features on the display.
+   * the gene for the accession id.
    * 
    * @param accId
    * @param geneSequence
@@ -191,7 +194,6 @@ public class EnsemblGene extends EnsemblSeqProxy
   {
     List<SequenceFeature> transcriptFeatures = new ArrayList<SequenceFeature>();
 
-    List<SequenceFeature> keptFeatures = new ArrayList<SequenceFeature>();
     String parentIdentifier = "gene:" + accId;
     SequenceFeature[] sfs = geneSequence.getSequenceFeatures();
 
@@ -207,14 +209,8 @@ public class EnsemblGene extends EnsemblSeqProxy
             transcriptFeatures.add(sf);
           }
         }
-        else
-        {
-          keptFeatures.add(sf);
-        }
       }
     }
-    SequenceFeature[] featuresRetained = keptFeatures.toArray(new SequenceFeature[keptFeatures.size()]);
-    geneSequence.getDatasetSequence().setSequenceFeatures(featuresRetained);
 
     return transcriptFeatures;
   }
@@ -294,4 +290,13 @@ public class EnsemblGene extends EnsemblSeqProxy
     return false;
   }
 
+  @Override
+  protected List<String> getCrossReferenceDatabases()
+  {
+    // found these for ENSG00000157764 on 30/01/2016:
+    // return new String[] {"Vega_gene", "OTTG", "ENS_LRG_gene", "ArrayExpress",
+    // "EntrezGene", "HGNC", "MIM_GENE", "MIM_MORBID", "WikiGene"};
+    return super.getCrossReferenceDatabases();
+  }
+
 }