public class ModuleUtil extends Object
Modifier and Type | Method and Description |
---|---|
static BioModule |
createModuleInstance(String className)
Construct a BioModule based on its className to add it to the pipeline.
|
static String |
displayID(BioModule module)
Return the module ID as a 2 digit display number (add leading zero if needed).
|
static String |
displayName(BioModule module)
Return the name of the module (or an alias if it has one).
|
static String |
displaySignature(BioModule module) |
static ClassifierModule |
getClassifier(BioModule module,
boolean checkAhead)
Get a classifier module
Use checkAhead parameter to determine if we look forward or backwards starting from the given module. |
static Integer |
getMinSamplesPerWorker(BioModule module)
Return the min number of samples that can be processed per worker script.
|
static BioModule |
getModule(BioModule module,
String className,
boolean checkAhead)
Get a module with given className unless a classifier module is found 1st.
Use checkAhead parameter to determine if we look forward or backwards starting from the given module. |
static List<BioModule> |
getModules(BioModule module,
Boolean checkAhead)
Return pipeline modules after the given module if checkAhead = TRUE
Otherwise return pipeline modules before the given module. If returning the prior modules, return the pipeline modules in reverse order, so the 1st item in the list is the module immediately preceding the given module. |
static BioModule |
getNextModule(BioModule module)
BioModules are run in the order configured.
Return the module configured to run after the given module. |
static Integer |
getNumMaxWorkers(BioModule module)
For uneven batch sizes, some workers will process 1 extra script.
|
static Integer |
getNumWorkers(BioModule module)
Get the actual number of worker scripts generated for a given module, minimum value = 1.
|
static BioModule |
getPreviousModule(BioModule module)
BioModules are run in the order configured.
Return the module configured to run before the given module. |
static boolean |
hasExecuted(BioModule module)
Return TRUE if module has executed.
|
static boolean |
hasScripts(BioModule module)
Check a BioModule for scripts to execute.
|
static boolean |
isComplete(BioModule module)
Return TRUE if module completed successfully.
|
static boolean |
isFirstRModule(BioModule module)
Test if module is the first
R_Module configured in the pipeline. |
static boolean |
isIncomplete(BioModule module)
Return TRUE if module started execution but is not complete.
|
static boolean |
isMetadataModule(BioModule module)
Method determines if the given module is a metadata-module (which does not use/modify sequence data.
|
static void |
markComplete(BioModule module)
Method creates a file named "biolockjComplete" in module root directory to document module
has completed successfully.
|
static void |
markStarted(BioModule module)
Method creates a file named "biolockjStarted" in module root directory to document module
has completed successfully.
|
static boolean |
moduleExists(String className)
Check if a module was in the pipeline at least once.
|
static File |
requireSubDir(BioModule module,
String subDirName)
Get BioModule subdirectory File object with given name.
|
static boolean |
subDirExists(BioModule module,
String subDirName)
Return TRUE if BioModule sub-directory exists
|
public static String displayID(BioModule module)
module
- BioModulepublic static String displayName(BioModule module)
module
- BioModulepublic static ClassifierModule getClassifier(BioModule module, boolean checkAhead)
module
- Calling BioModulecheckAhead
- Boolean TRUE to check for NEXT, set FALSE to check BEHINDpublic static Integer getMinSamplesPerWorker(BioModule module) throws ConfigNotFoundException, ConfigFormatException, Exception
module
- BioModuleConfigFormatException
ConfigNotFoundException
Exception
public static BioModule getModule(BioModule module, String className, boolean checkAhead) throws Exception
module
- Calling BioModuleclassName
- Target BioModule class namecheckAhead
- Boolean TRUE to check for NEXT, set FALSE to check BEHINDException
- if errors occurpublic static BioModule createModuleInstance(String className) throws Exception
className
- BioModule class nameException
- if errors occurpublic static List<BioModule> getModules(BioModule module, Boolean checkAhead)
module
- Reference BioModulecheckAhead
- Set TRUE to return modules after the given reference modulepublic static BioModule getNextModule(BioModule module)
module
- BioModulepublic static Integer getNumMaxWorkers(BioModule module) throws Exception
module
- BioModuleException
public static Integer getNumWorkers(BioModule module) throws ConfigNotFoundException, ConfigFormatException
module
- BioModuleConfigFormatException
ConfigNotFoundException
Exception
public static BioModule getPreviousModule(BioModule module)
module
- BioModulepublic static boolean hasExecuted(BioModule module)
module
- BioModulepublic static boolean hasScripts(BioModule module)
module
- BioModulepublic static boolean isComplete(BioModule module)
module
- BioModulepublic static boolean isFirstRModule(BioModule module)
R_Module
configured in the pipeline.module
- BioModule to testR_Module
in this branchpublic static boolean isIncomplete(BioModule module)
module
- BioModulepublic static boolean isMetadataModule(BioModule module)
module
- BioModule in questionpublic static void markComplete(BioModule module) throws BioLockJStatusException, IOException
module
- BioModuleIOException
BioLockJStatusException
Exception
- if unable to create "biolockjComplete" filepublic static void markStarted(BioModule module) throws BioLockJStatusException, IOException
module
- moduleIOException
BioLockJStatusException
Exception
- if unable to create "biolockjStarted" filepublic static boolean moduleExists(String className)
className
- module simple namepublic static File requireSubDir(BioModule module, String subDirName)
module
- BioModulesubDirName
- BioModule sub-directory name