applied copyright 2008
[jalview.git] / src / jalview / ws / dbsources / EmblXmlSource.java
index 3179110..a98e7e2 100644 (file)
@@ -1,10 +1,28 @@
+/*\r
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)\r
+ * Copyright (C) 2008 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.ws.dbsources;\r
 \r
 import jalview.datamodel.Alignment;\r
 import jalview.datamodel.AlignmentI;\r
 import jalview.datamodel.SequenceI;\r
 import jalview.datamodel.xdb.embl.EmblEntry;\r
-import jalview.ws.EBIFetchClient;\r
+import jalview.ws.ebi.EBIFetchClient;\r
 \r
 import java.io.File;\r
 import java.util.Iterator;\r
@@ -32,9 +50,6 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy
   public AlignmentI getEmblSequenceRecords(String emprefx, String query) throws Exception\r
   {\r
     startQuery();\r
-    SequenceI seqs[] = null;\r
-    Vector alseq = new Vector(); // the sequences that will actually be presented in the alignment\r
-    StringBuffer result = new StringBuffer();\r
     EBIFetchClient dbFetch = new EBIFetchClient();\r
     File reply; \r
     try {\r
@@ -47,6 +62,20 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy
       stopQuery();\r
       throw new Exception("EBI EMBL XML retrieval failed on "+emprefx.toLowerCase()+":"+query.trim(),e);\r
     }\r
+    return getEmblSequenceRecords(emprefx, query, reply);\r
+  }\r
+  /**\r
+   * parse an emblxml file stored locally\r
+   * @param emprefx either EMBL or EMBLCDS strings are allowed - anything else will not retrieve emblxml\r
+   * @param query\r
+   * @param file the EMBL XML file containing the results of a query\r
+   * @return\r
+   * @throws Exception\r
+   */\r
+  public AlignmentI getEmblSequenceRecords(String emprefx, String query, File reply) throws Exception\r
+  {\r
+    SequenceI seqs[] = null;\r
+    StringBuffer result = new StringBuffer();\r
     if (reply != null && reply.exists())\r
       {\r
         efile=null;\r
@@ -96,4 +125,4 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy
     return al;\r
   }\r
 \r
-}
\ No newline at end of file
+}\r