JAL-994 fix when sequence is too short and no jobs run
authorjprocter <jprocter@compbio.dundee.ac.uk>
Wed, 5 Sep 2012 11:26:22 +0000 (12:26 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Wed, 5 Sep 2012 11:26:22 +0000 (12:26 +0100)
src/jalview/ws/AWSThread.java
src/jalview/ws/jws1/JPredThread.java

index 7d174bc..7300462 100644 (file)
@@ -208,6 +208,8 @@ public abstract class AWSThread extends Thread
     {
       Cache.log
               .debug("WebServiceJob poll loop finished with no jobs created.");
+      wsInfo.setStatus(wsInfo.STATE_STOPPED_ERROR);
+      wsInfo.appendProgressText("No jobs ran.");
       wsInfo.setFinishedNoResults();
     }
   }
index a478b87..88e6a71 100644 (file)
@@ -268,6 +268,8 @@ class JPredThread extends JWS1Thread implements WSClientI
         sequence = new vamsas.objects.simple.Sequence();
         sequence.setId(seq.getName());
         sequence.setSeq(sq);
+      } else {
+        errorMessage = "Sequence is too short to predict with JPred - need at least 20 amino acids.";
       }
     }
 
@@ -284,6 +286,11 @@ class JPredThread extends JWS1Thread implements WSClientI
         }
       }
     }
+    String errorMessage="";
+    public String getValidationMessages()
+    {
+      return errorMessage+"\n";
+    }
   }
 
   ext.vamsas.Jpred server;
@@ -312,6 +319,8 @@ class JPredThread extends JWS1Thread implements WSClientI
       jobs = new WSJob[]
       { job };
       job.setJobnum(0);
+    } else {
+      wsInfo.appendProgressText(job.getValidationMessages());
     }
   }
 
@@ -328,6 +337,8 @@ class JPredThread extends JWS1Thread implements WSClientI
       { job };
       OutputHeader = wsInfo.getProgressText();
       job.setJobnum(0);
+    } else {
+      wsInfo.appendProgressText(job.getValidationMessages());
     }
   }
 
@@ -451,6 +462,8 @@ class JPredThread extends JWS1Thread implements WSClientI
     }
     else
     {
+      wsInfo.setStatus(wsInfo.STATE_STOPPED_ERROR);
+      wsInfo.appendInfoText("No jobs ran.");
       wsInfo.setFinishedNoResults();
     }
   }