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 protected
AbstractRExecutor(File outputDirectory, File temporaryDirectory)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
closeConnection()
Close the connection.protected abstract void
executeRScript(File rScriptFile, boolean sweave, String sweaveOuput, File workflowOutputDir, String... scriptArguments)
Execute a R script.void
executeRScript(String rScript, boolean sweave, String sweaveOutput, boolean saveRscript, String description, DataFile workflowOutputDir, String... scriptArguments)
Execute a R script.protected File
getOutputDirectory()
Get the output directory of the analysis.void
getOutputFiles()
Get the output files of the analysisprotected File
getTemporaryDirectory()
Get the temporary directory.void
openConnection()
Open the connection.protected abstract void
putFile(DataFile inputFile, String outputFilename)
Put a file for the analysis.void
putInputFile(DataFile inputFile)
Put a file for the analysis.void
putInputFile(DataFile inputFile, String outputFilename)
Put a file.protected abstract void
removeFile(String filename)
Remove a file of the analysis.void
removeInputFiles()
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 IOException
Description copied from interface:RExecutor
Open the connection.- Specified by:
openConnection
in interfaceRExecutor
- Throws:
IOException
- if an error occurs while opening the connection
-
closeConnection
public void closeConnection() throws IOException
Description copied from interface:RExecutor
Close the connection.- Specified by:
closeConnection
in interfaceRExecutor
- Throws:
IOException
- if an error occurs while closing the connection
-
getOutputFiles
public void getOutputFiles() throws IOException
Description copied from interface:RExecutor
Get the output files of the analysis- Specified by:
getOutputFiles
in interfaceRExecutor
- 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 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:RExecutor
Put a file.- Specified by:
putInputFile
in 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 IOException
Description copied from interface:RExecutor
Remove input files.- Specified by:
removeInputFiles
in 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:RExecutor
Execute a R script.- Specified by:
executeRScript
in 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
-
-