public class Humann2Classifier extends ClassifierModuleImpl implements ApiModule
Modifier and Type | Field and Description |
---|---|
protected static String |
EXE_HUMANN2
Config "executable" property for humnan2 executable: "exe.humann2" |
protected static String |
EXE_HUMANN2_JOIN_PARAMS
|
protected static String |
EXE_HUMANN2_PARAMS
|
protected static String |
EXE_HUMANN2_RENORM_PARAMS
|
protected static String |
HN2_NUCL_DB
Config "file path" property: "humann2.nuclDB"
|
protected static String |
HN2_PROT_DB
Config "file path" property: "humann2.protDB"
|
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 |
---|
Humann2Classifier() |
Modifier and Type | Method and Description |
---|---|
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()
Verify that none of the derived command line parameters are included in
Config ."exe.humann2". |
void |
cleanUp()
If metadata exists in module output directory, refresh MetaUtil.
|
void |
executeTask()
Calling super to build scripts, then wait until any database downloads are complete before allowing the Pipeline
to move forward and use these DB.
|
String |
getCitationString()
At a minimum, this should return the name and/or url for the wrapped tool.
|
String |
getClassifierExe()
Get HumanN2 executable command: "exe.humann2"
|
List<String> |
getClassifierParams()
Obtain the humann2 runtime params
|
File |
getDB()
Return database directory, if multiple databases are configured, they must share a common parent directory and
the common parent directory is returned by this method.
|
String |
getDescription()
Briefly describe what this module does.
|
String |
getDockerImageName()
Get the docker image to use for this module.
|
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 String |
getRuntimeParams()
Get formatted runtime parameters and
|
String |
getSummary()
Add database info if module is a DatabaseModule
|
String |
getTitle()
Get a human readable name for this module.
|
List<String> |
getWorkerScriptFunctions()
Method returns bash script lines used to build the functions called by the worker scripts.
|
Boolean |
isValidProp(String property)
Tests to see if the value val is valid for property prop; primarily tests format.
|
getClassifierType, getDbCache, getPostRequisiteModules, setDbCache, validateModuleOrder
getInputFiles, getSeqFiles, isValidInputModule
getJobParams, getMainScript, getRuntimeParams, getScriptDir, getScriptErrors, getTimeout, hasScripts
addGeneralProperty, addGeneralProperty, addGeneralProperty, addNewProperty, addNewProperty, cacheInputFiles, compareTo, equals, findModuleInputFiles, getAlias, getDescription, getDetails, getFileCache, getID, getLogDir, getMenuPlacement, getMetadata, getModuleDir, getOutputDir, getPreRequisiteModules, getPropDefault, getPropDescMap, getPropType, getPropTypeMap, getResourceDir, getTempDir, hashCode, init, listProps, setAlias, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getDescription, getDetails, getMenuPlacement, getPropType, listProps
getAlias, getID, getInputFiles, getLogDir, getMetadata, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getPropDefault, getResourceDir, getTempDir, init, isValidInputModule, setAlias, version
getSeqFiles
getJobParams, getMainScript, getScriptDir, getScriptErrors, getTimeout
protected static final String EXE_HUMANN2
Config
"executable" property for humnan2 executable: "exe.humann2"protected static final String EXE_HUMANN2_JOIN_PARAMS
protected static final String EXE_HUMANN2_PARAMS
protected static final String EXE_HUMANN2_RENORM_PARAMS
protected static final String HN2_NUCL_DB
Config
"file path" property: "humann2.nuclDB"
protected static final String HN2_PROT_DB
Config
"file path" property: "humann2.protDB"
public List<List<String>> buildScript(List<File> files) throws Exception
ScriptModuleImpl
buildScript
in interface ScriptModule
buildScript
in class ScriptModuleImpl
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
ScriptModuleImpl
buildScriptForPairedReads
in interface ScriptModule
buildScriptForPairedReads
in class ScriptModuleImpl
files
- Files in the input directory that contain only paired readsException
- if unable to generate the script linespublic void checkDependencies() throws Exception
Config
."exe.humann2". Also verify:
Config
."humann2.nuclDB" is a valid directory
Config
."humann2.protDB" is a valid directory
checkDependencies
in interface BioModule
checkDependencies
in class ClassifierModuleImpl
Exception
- thrown if missing or invalid dependencies are foundpublic void cleanUp() throws Exception
BioModuleImpl
cleanUp
in interface BioModule
cleanUp
in class BioModuleImpl
Exception
- thrown if any runtime error occurspublic void executeTask() throws Exception
executeTask
in interface BioModule
executeTask
in class ScriptModuleImpl
Exception
- thrown if the module is unable to complete is taskpublic String getClassifierExe() throws ConfigException
getClassifierExe
in interface ClassifierModule
getClassifierExe
in class ClassifierModuleImpl
ConfigException
- if Configuration errors are thrownpublic List<String> getClassifierParams() throws ConfigException
getClassifierParams
in interface ClassifierModule
getClassifierParams
in class ClassifierModuleImpl
ConfigException
- if Configuration errors are thrownpublic File getDB() throws ConfigNotFoundException, ConfigPathException, DockerVolCreationException
DatabaseModule
getDB
in interface DatabaseModule
getDB
in class ClassifierModuleImpl
ConfigNotFoundException
- if DB property is undefined and the default DB is not included in the module
runtime envConfigPathException
- if path is defined but does not existsDockerVolCreationException
public String getSummary() throws Exception
SeqModuleImpl
getSummary
in interface BioModule
getSummary
in class ClassifierModuleImpl
Exception
- if any error occurspublic List<String> getWorkerScriptFunctions() throws Exception
ScriptModule
getWorkerScriptFunctions
in interface ScriptModule
getWorkerScriptFunctions
in class ScriptModuleImpl
Exception
- if errors occurprotected String getRuntimeParams() throws Exception
Exception
- if errors occurpublic String getDockerImageOwner()
BioModule
getDockerImageOwner
in interface BioModule
getDockerImageOwner
in class BioModuleImpl
public String getDockerImageName()
BioModule
getDockerImageName
in interface BioModule
public String getDockerImageTag()
BioModule
getDockerImageTag
in interface BioModule
getDockerImageTag
in class BioModuleImpl
public String getTitle()
ApiModule
getTitle
in interface ApiModule
getTitle
in class BioModuleImpl
public String getDescription()
ApiModule
getDetails
.getDescription
in interface ApiModule
public String getCitationString()
ApiModule
getCitationString
in interface ApiModule
public Boolean isValidProp(String property) throws Exception
ApiModule
BioModule.checkDependencies()
. Using switch/case or a stack of if/else is recommended.
Within each case, call any/all method that is used by this module to access the value from the config file,
leveraging the checks in the Config.get* methods.
This method should never actually return false. If the value is not valid, it should throw an exception that
includes a helpful message about whats not valid. As part of a throwable, that message is passed along to
wherever the call started. Any time that "false" is actually the desired form, this method should be wrapped in
a try/catch.isValidProp
in interface ApiModule
isValidProp
in class ScriptModuleImpl
Exception