Vector accession;\r
Vector feature;\r
Vector dbrefs;\r
- Vector proteinName;\r
+ UniprotProteinName protName;\r
\r
public void setAccession(Vector items)\r
{\r
return accession;\r
}\r
\r
- public void setProteinName(Vector items)\r
+ public void setProtein(UniprotProteinName names)\r
{\r
- proteinName = items;\r
+ protName = names;\r
}\r
\r
- public Vector getProteinName()\r
+\r
+ public UniprotProteinName getProtein()\r
{\r
- return proteinName;\r
+ return protName;\r
}\r
\r
public void setName(Vector na)\r
--- /dev/null
+/*\r
+ * Jalview - A Sequence Alignment Editor and Viewer\r
+ * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\r
+ */\r
+package jalview.datamodel;\r
+\r
+public class UniprotProteinName\r
+{\r
+ /**\r
+ * internal content storage\r
+ */\r
+ private java.util.Vector names;\r
+\r
+ public void setName(java.util.Vector names)\r
+ {\r
+ this.names = names;\r
+ }\r
+\r
+ public java.util.Vector getName()\r
+ {\r
+ return names;\r
+ }\r
+\r
+}\r
{\r
EBIFetchClient ebi = new EBIFetchClient();\r
File file = ebi.fetchDataAsFile("uniprot:" + id, "xml", null);\r
+ // File file = new File("H:/jalview/classes/fer1.xml");\r
SequenceFeatureFetcher sff = new SequenceFeatureFetcher();\r
Vector entries = sff.getUniprotEntries(file);\r
\r
while (en.hasMoreElements())\r
{\r
UniprotEntry entry = (UniprotEntry) en.nextElement();\r
+\r
StringBuffer name = new StringBuffer(">UniProt/Swiss-Prot");\r
Enumeration en2 = entry.getAccession().elements();\r
while (en2.hasMoreElements())\r
name.append(en2.nextElement());\r
}\r
\r
- if (entry.getProteinName() != null)\r
- name.append(" " + entry.getProteinName().elementAt(0));\r
+ if (entry.getProtein() != null)\r
+ {\r
+ name.append(" " + entry.getProtein().getName().elementAt(0));\r
+ }\r
\r
result.append(name + "\n" + entry.getUniprotSequence().getContent() +\r
"\n");\r
e = entry.getFeature().elements();\r
while (e.hasMoreElements())\r
{\r
- sequence[i].getDatasetSequence().addSequenceFeature( (\r
- SequenceFeature) e.nextElement());\r
+ SequenceFeature sf = (SequenceFeature) e.nextElement();\r
+ sf.setFeatureGroup("Uniprot");\r
+ sequence[i].getDatasetSequence().addSequenceFeature( sf );\r
}\r
}\r
}\r
map.loadMapping(url);\r
\r
// 2. Unmarshal the data\r
- Unmarshaller unmar = new Unmarshaller();\r
+ Unmarshaller unmar = new Unmarshaller(uni);\r
unmar.setIgnoreExtraElements(true);\r
unmar.setMapping(map);\r
- uni = (UniprotFile) unmar.unmarshal(new FileReader(file));\r
+ // unmar.setDebug(true);\r
\r
+ uni = (UniprotFile) unmar.unmarshal(new FileReader(file));\r
}\r
catch (Exception e)\r
{\r
System.out.println("Error getUniprotEntries() "+e);\r
}\r
+\r
+\r
return uni.getUniprotEntries();\r
}\r
\r