public abstract class ScriptModuleImpl extends BioModuleImpl implements ScriptModule
GZIP_EXT, LOG_EXT, PDF_EXT, RETURN, SH_EXT, TAB_DELIM, TSV_EXT, TXT_EXT
SCRIPT_BATCH_SIZE, SCRIPT_DEFAULT_HEADER, SCRIPT_NUM_THREADS, SCRIPT_PERMISSIONS, SCRIPT_TIMEOUT
MAIN_SCRIPT_PREFIX, OUTPUT_DIR, TEMP_DIR
Constructor and Description |
---|
ScriptModuleImpl() |
Modifier and Type | Method and Description |
---|---|
abstract List<List<String>> |
buildScript(List<File> files)
Method returns a nested list of bash script lines to classify samples containing forward reads only.
|
List<List<String>> |
buildScriptForPairedReads(List<File> files)
The default behavior is the same for paired or unpaired data.
|
void |
checkDependencies()
|
void |
executeTask()
Build the nested list of bash script lines that will be used by
BashScriptBuilder to build
the worker scripts. |
String[] |
getJobParams()
|
File |
getMainScript()
Get the main script file in the bioModule script directory, with prefix:
"MAIN_".
|
protected String |
getRuntimeParams(List<String> params,
String numThreadsParam)
Return all collectionProperty values separated by a space.
|
File |
getScriptDir()
Returns moduleDir/script which contains all scripts generated by the module.
|
List<String> |
getScriptErrors()
This method returns all of the lines from any failure files found in the script directory.
|
String |
getSummary()
Returns summary message to be displayed by Email module so must not contain confidential info.
|
Integer |
getTimeout()
Default behavior is for scripts to run indefinitely (no timeout).
|
List<String> |
getWorkerScriptFunctions()
Method returns bash script lines used to build the functions called by the worker scripts.
|
protected boolean |
hasScripts()
Check if module produced any scripts
|
cacheInputFiles, cleanUp, compareTo, equals, findModuleInputFiles, getFileCache, getID, getInputFiles, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getTempDir, init, isValidInputModule, toString, validateFileNameUnique
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
cleanUp, getID, getInputFiles, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getTempDir, init, isValidInputModule
public abstract List<List<String>> buildScript(List<File> files) throws Exception
ScriptModule
buildScript
in interface ScriptModule
files
- Files in the input directory that contain only forward readsException
- if unable to generate script linespublic List<List<String>> buildScriptForPairedReads(List<File> files) throws Exception
buildScriptForPairedReads
in interface ScriptModule
files
- Files in the input directory that contain only paired readsException
- if unable to generate the script linespublic void checkDependencies() throws Exception
checkDependencies
in interface BioModule
checkDependencies
in class BioModuleImpl
Exception
- thrown if missing or invalid dependencies are foundpublic void executeTask() throws Exception
BashScriptBuilder
to build
the worker scripts. PassBioModuleImpl.getInputFiles()
to either buildScript(List)
or
buildScriptForPairedReads(List)
based on
Config
."internal.pairedReads".executeTask
in interface BioModule
executeTask
in class BioModuleImpl
Exception
- thrown if the module is unable to complete is taskpublic String[] getJobParams() throws Exception
ScriptModule
Processor
.Process
using the parameters supplied by this method and executed in
the Runtime
environment.getJobParams
in interface ScriptModule
Runtime.exec(String)
parametersException
- if unable to build the job parameterspublic File getMainScript() throws Exception
getMainScript
in interface ScriptModule
Exception
- if errors occurpublic File getScriptDir()
getScriptDir
in interface ScriptModule
public List<String> getScriptErrors() throws Exception
getScriptErrors
in interface ScriptModule
Exception
- if errors occur reading failure filespublic String getSummary() throws Exception
getSummary
in interface BioModule
getSummary
in class BioModuleImpl
Exception
- if any error occurspublic Integer getTimeout() throws ConfigFormatException
getTimeout
in interface ScriptModule
ConfigFormatException
- if the "script.timeout" value is invalidpublic List<String> getWorkerScriptFunctions() throws Exception
ScriptModule
getWorkerScriptFunctions
in interface ScriptModule
Exception
- if errors occurprotected String getRuntimeParams(List<String> params, String numThreadsParam) throws Exception
params
- Runtime parameternumThreadsParam
- Number of threads parameter nameException
- if errors occurprotected boolean hasScripts()