import java.util.Map;
import org.ngbw.directclient.CiApplication;
+import org.ngbw.directclient.CiCipresException;
import org.ngbw.directclient.CiClient;
+import org.ngbw.restdatatypes.ErrorData;
+import org.ngbw.restdatatypes.ParamError;
public class TreeJob
{
inputParams.put("infile_", alignmentFilePath);
}
+
+
/**
* Specifies a parameter about the input data for a CIPRES job with its value,
* for example the "infile_" parameter for the MSA file to calculate a tree
- * from with file path as value.
+ * from with file path as value. Note that different tools support different
+ * input parameters.
*
* @param parameter
* @param value
metadata.clear();
}
+ /**
+ * Sends this job with all given parameters to the given Cipres tool but
+ * doesn't actually run the job. This is a lightweight way to validate that
+ * the given parameters are correct for a specified tool.
+ */
+ public void validateJobParams(String toolName)
+ {
+ try
+ {
+ cipresClient.validateJob(toolName, vParams, inputParams, metadata);
+ } catch (CiCipresException ce)
+ {
+ ErrorData ed = ce.getErrorData();
+ System.out.println(
+ "Cipres error while trying to validate parameters, code="
+ + ed.code + ", message="
+ + ed.displayMessage
+ );
+ if (ed.code == ErrorData.FORM_VALIDATION)
+ {
+ for (ParamError pe : ed.paramError)
+ {
+ System.out.println(pe.param + ": " + pe.error);
+ }
+ }
+ }
+
+ }
}