JAL-2106 JAL-2154 cross-refs from Ensembl should verify as cross refs only
[jalview.git] / src / jalview / ext / ensembl / EnsemblXref.java
index fa86865..313572f 100644 (file)
@@ -29,20 +29,25 @@ class EnsemblXref extends EnsemblRestClient
 
   private static final String GO_GENE_ONTOLOGY = "GO";
 
+  private String dbName = "ENSEMBL (xref)";
+
   /**
    * Constructor given the target domain to fetch data from
    * 
    * @param d
    */
-  public EnsemblXref(String d)
+  public EnsemblXref(String d, String dbSource, String version)
   {
     super(d);
+    dbName = dbSource;
+    xrefVersion = dbSource + ":" + version;
+    
   }
 
   @Override
   public String getDbName()
   {
-    return "ENSEMBL (xref)";
+    return dbName;
   }
 
   @Override
@@ -152,7 +157,7 @@ class EnsemblXref extends EnsemblRestClient
         if (dbName != null && id != null)
         {
           dbName = DBRefUtils.getCanonicalName(dbName);
-          DBRefEntry dbref = new DBRefEntry(dbName, "0", id);
+          DBRefEntry dbref = new DBRefEntry(dbName, getXRefVersion(), id);
           result.add(dbref);
         }
       }
@@ -163,6 +168,18 @@ class EnsemblXref extends EnsemblRestClient
     return result;
   }
 
+  private String xrefVersion = "ENSEMBL:0";
+
+  /**
+   * version string for Xrefs - for 2.10, hardwired for ENSEMBL:0
+   * 
+   * @return
+   */
+  public String getXRefVersion()
+  {
+    return xrefVersion;
+  }
+
   /**
    * Returns the URL for the REST endpoint to fetch all cross-references for an
    * identifier. Note this may return protein cross-references for nucleotide.