Class AbstractRExecutor

    • Constructor Detail

      • AbstractRExecutor

        protected AbstractRExecutor​(File outputDirectory,
                                    File temporaryDirectory)
                             throws IOException
        Constructor.
        Parameters:
        outputDirectory - output directory
        Throws:
        IOException - if the output directory does not exists
    • Method Detail

      • putFile

        protected abstract void putFile​(DataFile inputFile,
                                        String outputFilename)
                                 throws IOException
        Put a file for the analysis.
        Parameters:
        inputFile - the input file
        outputFilename - the output filename
        Throws:
        IOException - if an error occurs while putting the file
      • removeFile

        protected abstract void removeFile​(String filename)
                                    throws IOException
        Remove a file of the analysis.
        Parameters:
        filename - the filename of the file to remove
        Throws:
        IOException - if the removing of the file fails
      • executeRScript

        protected abstract void executeRScript​(File rScriptFile,
                                               boolean sweave,
                                               String sweaveOuput,
                                               File workflowOutputDir,
                                               String... scriptArguments)
                                        throws IOException
        Execute a R script.
        Parameters:
        rScriptFile - The R script file
        sweave - execute the R using Sweave
        sweaveOuput - sweave output file
        scriptArguments - script arguments
        Throws:
        IOException - if an error occurs while executing the script
      • getOutputDirectory

        protected File getOutputDirectory()
        Get the output directory of the analysis.
        Returns:
        the output directory of the analysis
      • getTemporaryDirectory

        protected File getTemporaryDirectory()
        Get the temporary directory.
        Returns:
        the temporary directory
      • getOutputFiles

        public void getOutputFiles()
                            throws IOException
        Description copied from interface: RExecutor
        Get the output files of the analysis
        Specified by:
        getOutputFiles in interface RExecutor
        Throws:
        IOException - if an error occurs while getting the output files
      • putInputFile

        public void putInputFile​(DataFile inputFile)
                          throws IOException
        Description copied from interface: RExecutor
        Put a file for the analysis.
        Specified by:
        putInputFile in interface RExecutor
        Parameters:
        inputFile - the input file
        Throws:
        IOException - if an error occurs while putting the file
      • putInputFile

        public void putInputFile​(DataFile inputFile,
                                 String outputFilename)
                          throws IOException
        Description copied from interface: RExecutor
        Put a file.
        Specified by:
        putInputFile in interface RExecutor
        Parameters:
        inputFile - the file to put
        outputFilename - the output filename
        Throws:
        IOException - if an exception occurs while putting a file
      • executeRScript

        public void executeRScript​(String rScript,
                                   boolean sweave,
                                   String sweaveOutput,
                                   boolean saveRscript,
                                   String description,
                                   DataFile workflowOutputDir,
                                   String... scriptArguments)
                            throws IOException
        Description copied from interface: RExecutor
        Execute a R script.
        Specified by:
        executeRScript in interface RExecutor
        Parameters:
        rScript - the source of the script to execute
        sweave - true if the script is a Sweave script
        sweaveOutput - Sweave output file
        saveRscript - true to keep the R script
        description - description of the R script
        workflowOutputDir - workflow output directory
        scriptArguments - script arguments
        Throws:
        IOException - if an error occurs while executing the script