public abstract class ScriptModuleImpl extends BioModuleImpl implements ScriptModule
GZIP_EXT, LOG_EXT, PDF_EXT, RETURN, SH_EXT, TAB_DELIM, TSV_EXT, TXT_EXT
LOG_DIR, MAIN_SCRIPT_PREFIX, NO_VERSION, OUTPUT_DIR, RES_DIR, TEMP_DIR
Constructor and Description |
---|
ScriptModuleImpl() |
Modifier and Type | Method and Description |
---|---|
abstract List<List<String>> |
buildScript(List<File> files)
Return an inner list of lines to execute for each sample.
|
List<List<String>> |
buildScriptForPairedReads(List<File> files)
The default behavior is the same for paired or unpaired data.
|
void |
checkDependencies()
Validate module dependencies:
Require
Config . exists
Require Config . is positive integer
Require Config . is positive integer
Verify Config . is positive integer if set
Start the AWS DB sync to S3 if a novel DB has been configure and
"aws.copyDbToS3" is enabled
|
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
|
Boolean |
isValidProp(String property) |
addGeneralProperty, addGeneralProperty, addGeneralProperty, addNewProperty, addNewProperty, cacheInputFiles, cleanUp, compareTo, equals, findModuleInputFiles, getAlias, getDescription, getDetails, getDockerImageOwner, getDockerImageTag, getFileCache, getID, getInputFiles, getLogDir, getMenuPlacement, getMetadata, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getPropDefault, getPropDescMap, getPropType, getPropTypeMap, getResourceDir, getTempDir, getTitle, hashCode, init, isValidInputModule, listProps, setAlias, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
cleanUp, getAlias, getDockerImageName, getDockerImageOwner, getDockerImageTag, getID, getInputFiles, getLogDir, getMetadata, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getPropDefault, getResourceDir, getTempDir, init, isValidInputModule, setAlias, version
public abstract List<List<String>> buildScript(List<File> files) throws Exception
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
Config
. exists
Config
. is positive integer
Config
. is positive integer
Config
. is positive integer if set
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
public File getMainScript()
getMainScript
in interface ScriptModule
public 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 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 ConfigException
params
- Runtime parameternumThreadsParam
- Number of threads parameter nameConfigException
- if Configuration errors occurprotected boolean hasScripts()
public Boolean isValidProp(String property) throws Exception
isValidProp
in class BioModuleImpl
Exception