remove null pointer exception when embl file is not retrieved and comment about selec...
authorjprocter <Jim Procter>
Fri, 24 Aug 2007 15:37:12 +0000 (15:37 +0000)
committerjprocter <Jim Procter>
Fri, 24 Aug 2007 15:37:12 +0000 (15:37 +0000)
src/jalview/ws/dbsources/EmblXmlSource.java

index 1300c65..3179110 100644 (file)
@@ -23,10 +23,6 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy
     super();\r
   }\r
   /**\r
-   * set this to false to *not* add protein products to alignment dataset.\r
-   */\r
-  public boolean getProteinProducts=false;\r
-  /**\r
    * retrieve and parse an emblxml file\r
    * @param emprefx either EMBL or EMBLCDS strings are allowed - anything else will not retrieve emblxml\r
    * @param query\r
@@ -53,13 +49,19 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy
     }\r
     if (reply != null && reply.exists())\r
       {\r
+        efile=null;\r
         file = reply.getAbsolutePath();\r
-        efile = jalview.datamodel.xdb.embl.EmblFile.getEmblFile(reply);\r
+        if (reply.length()>25)\r
+        {\r
+            efile = jalview.datamodel.xdb.embl.EmblFile.getEmblFile(reply);\r
+        } else {\r
+          result.append("# No EMBL record retrieved for "+emprefx.toLowerCase()+":"+query.trim());\r
+        }\r
       }\r
       if (efile!=null) {\r
         for (Iterator i=efile.getEntries().iterator(); i.hasNext(); ) {\r
           EmblEntry entry = (EmblEntry) i.next();\r
-          SequenceI[] seqparts = entry.getSequences(false,!getProteinProducts, emprefx);\r
+          SequenceI[] seqparts = entry.getSequences(false, true, emprefx); // TODO: use !fetchNa,!fetchPeptide here instead - see todo in emblEntry\r
           if (seqparts!=null) {\r
             SequenceI[] newseqs = null;\r
             int si=0;\r