JAL-2210 JAL-2232 remove version number from ENACDS excession
authorJim Procter <jprocter@issues.jalview.org>
Mon, 3 Oct 2016 08:18:03 +0000 (09:18 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Mon, 3 Oct 2016 08:18:03 +0000 (09:18 +0100)
src/jalview/ws/dbsources/Uniprot.java

index 7ecd324..e26ccda 100644 (file)
@@ -30,7 +30,6 @@ import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
 import jalview.datamodel.UniprotEntry;
 import jalview.datamodel.UniprotFile;
-import jalview.util.DBRefUtils;
 import jalview.ws.ebi.EBIFetchClient;
 import jalview.ws.seqfetcher.DbSourceProxyImpl;
 
@@ -230,9 +229,10 @@ public class Uniprot extends DbSourceProxyImpl
                 .get("protein sequence ID");
         if (cdsId != null && cdsId.trim().length() > 0)
         {
-          dbr = new DBRefEntry(DBRefSource.EMBLCDS, DBRefSource.UNIPROT
-                  + ":"
-                  + dbVersion, cdsId.trim());
+          // remove version
+          String[] vrs = cdsId.split("\\.");
+          dbr = new DBRefEntry(DBRefSource.EMBLCDS, vrs.length > 1 ? vrs[1]
+                  : DBRefSource.UNIPROT + ":" + dbVersion, vrs[0]);
           dbRefs.add(dbr);
         }
       }