public abstract class BioModuleImpl extends Object implements BioModule, Comparable<BioModule>
Modifier and Type | Field and Description |
---|---|
static String |
GZIP_EXT
BioLockJ gzip file extension constant: ".gz"
|
static String |
LOG_EXT
BioLockJ log file extension constant: ".log"
|
static String |
PDF_EXT
BioLockJ PDF file extension constant: ".pdf"
|
static String |
RETURN
Return character constant *backslash-n*
|
static String |
SH_EXT
BioLockJ shell script file extension constant: ".sh"
|
static String |
TAB_DELIM
BioLockJ tab character constant: "\t"
|
static String |
TSV_EXT
BioLockJ tab delimited text file extension constant: ".tsv"
|
static String |
TXT_EXT
BioLockJ tab delimited text file extension constant: ".txt"
|
LOG_DIR, MAIN_SCRIPT_PREFIX, NO_VERSION, OUTPUT_DIR, RES_DIR, TEMP_DIR
Constructor and Description |
---|
BioModuleImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
addGeneralProperty(String prop) |
protected void |
addGeneralProperty(String prop,
String additionalDescription) |
protected void |
addGeneralProperty(String prop,
String type,
String additionalDescription) |
protected void |
addNewProperty(String prop,
String type,
String desc) |
protected void |
addNewProperty(String prop,
String type,
String desc,
String defaultValue) |
protected void |
cacheInputFiles(Collection<File> files)
Cache the input files for quick access on subsequent calls to
getInputFiles() |
abstract void |
checkDependencies()
If restarting or running a direct pipeline execute the cleanup for completed modules.
|
void |
cleanUp()
If metadata exists in module output directory, refresh MetaUtil.
|
int |
compareTo(BioModule module) |
boolean |
equals(Object obj)
Compared based on ID
|
abstract void |
executeTask()
This is the main method called when it is time for the BioModule to complete its task.
|
protected List<File> |
findModuleInputFiles()
Called upon first access of input files to return sorted list of files from all
Config ."input.dirPaths"Hidden files (starting with ".") are ignored Call isValidInputModule(BioModule) on each previous module until acceptable input files are found |
String |
getAlias()
Some BioModules may be added to a pipeline multiple times.
The user may provide an alias for a module in the run order, thus allowing the user direct properties to an individual instance of a module. |
String |
getDescription(String prop) |
String |
getDetails() |
String |
getDockerImageOwner()
Get the name of the docker hub user that owns the image to use for this module.
|
String |
getDockerImageTag()
Get the version / tag to use for the docker image.
|
protected List<File> |
getFileCache()
Get cached input files
|
Integer |
getID()
Some BioModules may be added to a pipeline multiple times so must be identified by an ID.
This is the same value as the directory folder prefix when run. The 1st module ID is 0 (or 00 if there are more than 10 modules. |
List<File> |
getInputFiles()
BioModule
getInputFiles() is called to initialize upon first call and cached. |
File |
getLogDir()
Returns moduleDir/temp for intermediate files.
|
List<String> |
getMenuPlacement() |
File |
getMetadata()
Updated/new metadata files are saved to the module output directory (if created by the module).
|
File |
getModuleDir()
All BioModule work must be contained within the scope of its root directory.
|
File |
getOutputDir()
Returns moduleDir/output which will be used as the next module's input.
|
List<String> |
getPostRequisiteModules()
By default, no post-requisites are required.
|
List<String> |
getPreRequisiteModules()
By default, no prerequisites are required.
|
String |
getPropDefault(String prop)
If a property is null based on the config files (including all defaults and standard.properties) but
a module is passed to the Config class as the context for getting that module, the Config class
can query the module for a value for the property.
|
protected HashMap<String,String> |
getPropDescMap() |
String |
getPropType(String prop) |
protected HashMap<String,String> |
getPropTypeMap() |
File |
getResourceDir()
Returns moduleDir/temp for intermediate files.
|
String |
getSummary()
Returns summary message to be displayed by Email module so must not contain confidential info.
|
File |
getTempDir()
Returns moduleDir/temp for intermediate files.
|
String |
getTitle() |
int |
hashCode() |
void |
init()
This method must be called immediately upon instantiation.
|
boolean |
isValidInputModule(BioModule module)
In the early stages of the pipeline, starting with the very 1st module
ImportMetadata , most modules expect sequence files as input. |
Boolean |
isValidProp(String property) |
List<String> |
listProps() |
void |
setAlias(String alias) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getDockerImageName, version
public static final String GZIP_EXT
public static final String LOG_EXT
public static final String PDF_EXT
public static final String RETURN
public static final String SH_EXT
public static final String TAB_DELIM
public static final String TSV_EXT
public static final String TXT_EXT
protected final void addNewProperty(String prop, String type, String desc, String defaultValue)
protected final void addGeneralProperty(String prop)
protected final void addGeneralProperty(String prop, String additionalDescription)
protected final void addGeneralProperty(String prop, String type, String additionalDescription)
public final String getPropDefault(String prop)
BioModule
getPropDefault
in interface BioModule
public abstract void checkDependencies() throws Exception
checkDependencies
in interface BioModule
Exception
- thrown if missing or invalid dependencies are foundpublic void cleanUp() throws Exception
public int compareTo(BioModule module)
compareTo
in interface Comparable<BioModule>
public abstract void executeTask() throws Exception
BioModule
executeTask
in interface BioModule
Exception
- thrown if the module is unable to complete is taskpublic String getAlias()
BioModule
public void setAlias(String alias) throws PipelineFormationException
setAlias
in interface BioModule
PipelineFormationException
public Integer getID()
BioModule
public List<File> getInputFiles()
getInputFiles()
is called to initialize upon first call and cached.getInputFiles
in interface BioModule
public File getMetadata()
BioModule
getMetadata
in interface BioModule
public File getModuleDir()
getModuleDir
in interface BioModule
public File getOutputDir()
getOutputDir
in interface BioModule
public List<String> getPostRequisiteModules() throws Exception
getPostRequisiteModules
in interface BioModule
Exception
- if invalid Class names are returned as post-requisitespublic List<String> getPreRequisiteModules() throws Exception
getPreRequisiteModules
in interface BioModule
Exception
- if invalid Class names are returned as prerequisitespublic String getSummary() throws Exception
getSummary
in interface BioModule
Exception
- if any error occurspublic File getTempDir()
Constants.RM_TEMP_FILES
=
"Y", this directory is deleted after pipeline completes successfully.getTempDir
in interface BioModule
public File getLogDir()
Constants.RM_TEMP_FILES
=
"Y", this directory is deleted after pipeline completes successfully.public File getResourceDir()
Constants.RM_TEMP_FILES
=
"Y", this directory is deleted after pipeline completes successfully.getResourceDir
in interface BioModule
public void init() throws Exception
public boolean isValidInputModule(BioModule module)
ImportMetadata
, most modules expect sequence files as input. This method returns
false if the previousModule only produced a new metadata file, such as
ImportMetadata
or RegisterNumReads
.
When getInputFiles()
is called, this method determines if the previousModule output is valid input for
the current BioModule. The default implementation of this method returns FALSE if the previousModule only
generates a new metadata file.isValidInputModule
in interface BioModule
module
- BioModule that ran before the current BioModuleprotected void cacheInputFiles(Collection<File> files)
getInputFiles()
files
- Input filesprotected List<File> findModuleInputFiles()
Config
."input.dirPaths"isValidInputModule(BioModule)
on each previous module until acceptable input files are foundprotected List<File> getFileCache()
public String getTitle()
public final String getDescription(String prop) throws API_Exception
API_Exception
public final String getPropType(String prop) throws API_Exception
API_Exception
public String getDetails() throws API_Exception
API_Exception
public String getDockerImageOwner()
BioModule
getDockerImageOwner
in interface BioModule
public String getDockerImageTag()
BioModule
getDockerImageTag
in interface BioModule