Class PythonExecutorBase

java.lang.Object
org.broadinstitute.hellbender.utils.runtime.ScriptExecutor
org.broadinstitute.hellbender.utils.python.PythonExecutorBase
Direct Known Subclasses:
PythonScriptExecutor, StreamingPythonScriptExecutor

public abstract class PythonExecutorBase extends ScriptExecutor
Base class for services for executing Python Scripts.
  • All tools that use PythonScriptExecutor must have a Java-based front-end, with standard GATK (Barclay-based) arguments.
  • Minimize the amount of code written in Python -- as much of each tool's work as possible should be done in Java. In particular, reading/writing final inputs and outputs should happen in Java. This is important to ensure the goal of universal GCS support, consistent Google authentication handling, etc.
  • The names of any files that are created by Python code should be passed in to the python code from Java.
  • All dependencies (Python and native) of Python libraries used should be clearly documented, and included in the default GATK docker image.
  • Field Details

  • Constructor Details

    • PythonExecutorBase

      public PythonExecutorBase(boolean ensureExecutableExists)
      Parameters:
      ensureExecutableExists - throw if the python executable cannot be located
    • PythonExecutorBase

      public PythonExecutorBase(PythonExecutorBase.PythonExecutableName pythonExecutableName, boolean ensureExecutableExists)
      Parameters:
      pythonExecutableName - name of the python executable to start
      ensureExecutableExists - throw if the python executable cannot be found
  • Method Details

    • getScriptException

      public ScriptExecutorException getScriptException(String message)
      Return an exception specific to this executor type, to be thrown on error conditions.
      Specified by:
      getScriptException in class ScriptExecutor
      Parameters:
      message -
      Returns:
      a {#ScriptExecutorException}-derived exception object
    • getApproximateCommandLine

      public abstract String getApproximateCommandLine()
      Return a (not necessarily executable) string representing the current command line for this executor for error reporting purposes.
      Specified by:
      getApproximateCommandLine in class ScriptExecutor
      Returns:
      Command line string.