friendlier sequence names for protein products
authorjprocter <Jim Procter>
Sat, 29 Sep 2007 13:50:38 +0000 (13:50 +0000)
committerjprocter <Jim Procter>
Sat, 29 Sep 2007 13:50:38 +0000 (13:50 +0000)
src/jalview/datamodel/xdb/embl/EmblEntry.java

index 350c44e..9d12ccf 100644 (file)
@@ -542,10 +542,10 @@ public class EmblEntry
     if (prseq != null && prname != null && prid != null)
     {
       // extract proteins.
-      product = new Sequence(sourceDb + "|" + "EMBLCDS|" + prid
-              +((prname.length()==0) ? "" : " " + prname), prseq, prstart, prstart
+      product = new Sequence(prid
+              , prseq, prstart, prstart
               + prseq.length() - 1);
-      product.setDescription("Protein Product from " + sourceDb);
+      product.setDescription(((prname.length()==0) ? "Protein Product from " + sourceDb : prname));
       
       if (!noPeptide)
       {
@@ -584,7 +584,7 @@ public class EmblEntry
         {
           // TODO: Add a DbRef back to the parent EMBL sequence with the exon
           // map
-
+          // if given a dataset reference, search dataset for parent EMBL sequence if it exists and set its map
           // make a new feature annotating the coding contig
         }
         else
@@ -646,6 +646,10 @@ public class EmblEntry
           if (map!=null && map.getTo()!=null)
           {
             map.getTo().addDBRef(new DBRefEntry(ref.getSource(), ref.getVersion(), ref.getAccessionId())); // don't copy map over.
+            if (map.getTo().getName().indexOf(prid)==0)
+            {
+              map.getTo().setName(jalview.datamodel.DBRefSource.UNIPROT+"|"+ref.getAccessionId());
+            }
           }
         }
         if (product != null)