quick fix for the new uniprot name schema - description line for retrieved uniprot...
authorjprocter <Jim Procter>
Thu, 31 Jul 2008 10:11:57 +0000 (10:11 +0000)
committerjprocter <Jim Procter>
Thu, 31 Jul 2008 10:11:57 +0000 (10:11 +0000)
resources/uniprot_mapping.xml
src/jalview/ws/dbsources/Uniprot.java

index d955dd7..0f7ffd5 100755 (executable)
@@ -1,76 +1,79 @@
-<?xml version="1.0"?>\r
-<mapping>\r
-       <class name="jalview.datamodel.UniprotFile">\r
-                 <map-to xml="uniprot"/>               \r
-                 <field name="UniprotEntries" type="jalview.datamodel.UniprotEntry" collection="vector">\r
-                     <bind-xml name="entry"/>\r
-                </field>               \r
-        </class>\r
-                \r
-        <class name="jalview.datamodel.UniprotEntry">\r
-               <field name="name" type="string" collection="vector"/>\r
-               <field name="accession" type="string" collection="vector"/>\r
-               <field name="protein" type="jalview.datamodel.UniprotProteinName">\r
-                       <bind-xml name="protein"/>\r
-               </field>\r
-             \r
-             <field name="UniprotSequence" type="jalview.datamodel.UniprotSequence">\r
-               <bind-xml name="sequence"/> \r
-              </field>\r
-              <field name="feature" type="jalview.datamodel.SequenceFeature" collection="vector"/>\r
-              <field name="dbReference" type="jalview.datamodel.PDBEntry" collection="vector"/>\r
-                      \r
-        </class>\r
-        \r
-        <class name="jalview.datamodel.UniprotProteinName">\r
-               <field name="name" type="string" collection="vector">\r
-                       <bind-xml name="name"/>\r
-               </field>                \r
-        </class>\r
-        \r
-        \r
-        <class name="jalview.datamodel.SequenceFeature">\r
-               <field name="type">\r
-                       <bind-xml node="attribute"/>\r
-               </field>\r
-               <field name="description">\r
-                        <bind-xml node="attribute"/>\r
-               </field>\r
-               <field name="status">\r
-                       <bind-xml node="attribute"/>\r
-               </field>\r
-               <field name="position">\r
-                <bind-xml name="position" node="attribute" location="location/position"/>\r
-                </field>\r
-               <field name="begin">\r
-                <bind-xml name="position" node="attribute" location="location/begin"/>\r
-                </field>\r
-               <field name="end">\r
-                <bind-xml name="position" node="attribute" location="location/end"/>\r
-                </field>\r
-        </class>\r
-       \r
-          <class name="jalview.datamodel.UniprotSequence">\r
-                    <field name="content" type="string">\r
-                       <bind-xml name="sequence" node="text"/>\r
-                    </field>\r
-        </class>\r
-        \r
-        <class name="jalview.datamodel.PDBEntry">\r
-               <field name="type"><bind-xml node="attribute"/></field>\r
-               <field name="id"><bind-xml node="attribute"/></field>\r
-               <field name="property" collection="hashtable">\r
-                       <bind-xml name="property">\r
-                          <class name="org.exolab.castor.mapping.MapItem">\r
-                             <field name="key">\r
-                               <bind-xml name="type" node="attribute"/>\r
-                             </field>\r
-                             <field name="value">\r
-                               <bind-xml node="attribute"/>\r
-                               </field>\r
-                          </class>\r
-                       </bind-xml>\r
-               </field>\r
-        </class>\r
-\r
-</mapping>\r
+<?xml version="1.0"?>
+<mapping>
+       <class name="jalview.datamodel.UniprotFile">
+                 <map-to xml="uniprot"/>               
+                 <field name="UniprotEntries" type="jalview.datamodel.UniprotEntry" collection="vector">
+                     <bind-xml name="entry"/>
+                </field>               
+        </class>
+                
+        <class name="jalview.datamodel.UniprotEntry">
+               <field name="name" type="string" collection="vector"/>
+               <field name="accession" type="string" collection="vector"/>
+               <field name="protein" type="jalview.datamodel.UniprotProteinName"/>
+           <field name="UniprotSequence" type="jalview.datamodel.UniprotSequence">
+               <bind-xml name="sequence"/> 
+           </field>
+           <field name="feature" type="jalview.datamodel.SequenceFeature" collection="vector"/>
+           <field name="dbReference" type="jalview.datamodel.PDBEntry" collection="vector"/>
+                      
+        </class>
+       <class name="jalview.datamodel.UniprotProteinName">
+               <field name="name" collection="vector" type="string">
+                       <bind-xml name="fullName" location="recommendedName" node="element"/>
+               </field>
+       </class>
+        <!-- uniprot protein name is now a collection of collections - the INCLUDES and CONTAINS entries of the uniprot
+               record. This means this doesn't exist anymore...
+        <class name="jalview.datamodel.UniprotProteinName">
+               <field name="name" type="string" collection="vector">
+                       <bind-xml name="name"/>
+               </field>                
+        </class>
+        -->
+        
+        <class name="jalview.datamodel.SequenceFeature">
+               <field name="type">
+                       <bind-xml node="attribute"/>
+               </field>
+               <field name="description">
+                        <bind-xml node="attribute"/>
+               </field>
+               <field name="status">
+                       <bind-xml node="attribute"/>
+               </field>
+               <field name="position">
+                <bind-xml name="position" node="attribute" location="location/position"/>
+                </field>
+               <field name="begin">
+                <bind-xml name="position" node="attribute" location="location/begin"/>
+                </field>
+               <field name="end">
+                <bind-xml name="position" node="attribute" location="location/end"/>
+                </field>
+        </class>
+       
+          <class name="jalview.datamodel.UniprotSequence">
+                    <field name="content" type="string">
+                       <bind-xml name="sequence" node="text"/>
+                    </field>
+        </class>
+        
+        <class name="jalview.datamodel.PDBEntry">
+               <field name="type"><bind-xml node="attribute"/></field>
+               <field name="id"><bind-xml node="attribute"/></field>
+               <field name="property" collection="hashtable">
+                       <bind-xml name="property">
+                          <class name="org.exolab.castor.mapping.MapItem">
+                             <field name="key">
+                               <bind-xml name="type" node="attribute"/>
+                             </field>
+                             <field name="value">
+                               <bind-xml node="attribute"/>
+                               </field>
+                          </class>
+                       </bind-xml>
+               </field>
+        </class>
+
+</mapping>
index 8e7893f..26e9737 100644 (file)
@@ -149,9 +149,12 @@ public class Uniprot extends DbSourceProxyImpl implements DbSourceProxy
             name.append(en2.nextElement());\r
           }\r
 \r
-          if (entry.getProtein() != null)\r
+          if (entry.getProtein()!=null && entry.getProtein().getName()!=null)\r
           {\r
-            name.append(" " + entry.getProtein().getName().elementAt(0));\r
+              for (int nm=0,nmSize=entry.getProtein().getName().size(); nm<nmSize;nm++)\r
+              {\r
+                name.append(" " + entry.getProtein().getName().elementAt(nm));\r
+              }\r
           }\r
 \r
           result.append(name + "\n"\r