Class AbstractRExecutor
- java.lang.Object
-
- fr.ens.biologie.genomique.eoulsan.util.r.AbstractRExecutor
-
- All Implemented Interfaces:
RExecutor
- Direct Known Subclasses:
ProcessRExecutor,RserveRExecutor
public abstract class AbstractRExecutor extends Object implements RExecutor
This class define an abstract RExecutor.- Since:
- 2.0
- Author:
- Laurent Jourdren
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRExecutor(File outputDirectory, File temporaryDirectory)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcloseConnection()Close the connection.protected abstract voidexecuteRScript(File rScriptFile, boolean sweave, String sweaveOuput, File workflowOutputDir, String... scriptArguments)Execute a R script.voidexecuteRScript(String rScript, boolean sweave, String sweaveOutput, boolean saveRscript, String description, DataFile workflowOutputDir, String... scriptArguments)Execute a R script.protected FilegetOutputDirectory()Get the output directory of the analysis.voidgetOutputFiles()Get the output files of the analysisprotected FilegetTemporaryDirectory()Get the temporary directory.voidopenConnection()Open the connection.protected abstract voidputFile(DataFile inputFile, String outputFilename)Put a file for the analysis.voidputInputFile(DataFile inputFile)Put a file for the analysis.voidputInputFile(DataFile inputFile, String outputFilename)Put a file.protected abstract voidremoveFile(String filename)Remove a file of the analysis.voidremoveInputFiles()Remove input files.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface fr.ens.biologie.genomique.eoulsan.util.r.RExecutor
getName, writerFile
-
-
-
-
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 fileoutputFilename- 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 filesweave- execute the R using SweavesweaveOuput- sweave output filescriptArguments- 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
-
openConnection
public void openConnection() throws IOExceptionDescription copied from interface:RExecutorOpen the connection.- Specified by:
openConnectionin interfaceRExecutor- Throws:
IOException- if an error occurs while opening the connection
-
closeConnection
public void closeConnection() throws IOExceptionDescription copied from interface:RExecutorClose the connection.- Specified by:
closeConnectionin interfaceRExecutor- Throws:
IOException- if an error occurs while closing the connection
-
getOutputFiles
public void getOutputFiles() throws IOExceptionDescription copied from interface:RExecutorGet the output files of the analysis- Specified by:
getOutputFilesin interfaceRExecutor- Throws:
IOException- if an error occurs while getting the output files
-
putInputFile
public void putInputFile(DataFile inputFile) throws IOException
Description copied from interface:RExecutorPut a file for the analysis.- Specified by:
putInputFilein interfaceRExecutor- 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:RExecutorPut a file.- Specified by:
putInputFilein interfaceRExecutor- Parameters:
inputFile- the file to putoutputFilename- the output filename- Throws:
IOException- if an exception occurs while putting a file
-
removeInputFiles
public void removeInputFiles() throws IOExceptionDescription copied from interface:RExecutorRemove input files.- Specified by:
removeInputFilesin interfaceRExecutor- Throws:
IOException- if an error occurs while removing the files
-
executeRScript
public void executeRScript(String rScript, boolean sweave, String sweaveOutput, boolean saveRscript, String description, DataFile workflowOutputDir, String... scriptArguments) throws IOException
Description copied from interface:RExecutorExecute a R script.- Specified by:
executeRScriptin interfaceRExecutor- Parameters:
rScript- the source of the script to executesweave- true if the script is a Sweave scriptsweaveOutput- Sweave output filesaveRscript- true to keep the R scriptdescription- description of the R scriptworkflowOutputDir- workflow output directoryscriptArguments- script arguments- Throws:
IOException- if an error occurs while executing the script
-
-