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_EXTLOG_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, validateModuleOrdergetInputFiles, getSeqFiles, isValidInputModulegetJobParams, getMainScript, getRuntimeParams, getScriptDir, getScriptErrors, getTimeout, hasScriptsaddGeneralProperty, 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, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetDescription, getDetails, getMenuPlacement, getPropType, listPropsgetAlias, getID, getInputFiles, getLogDir, getMetadata, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getPropDefault, getResourceDir, getTempDir, init, isValidInputModule, setAlias, versiongetSeqFilesgetJobParams, getMainScript, getScriptDir, getScriptErrors, getTimeoutprotected 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
ScriptModuleImplbuildScript in interface ScriptModulebuildScript in class ScriptModuleImplfiles - 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
ScriptModuleImplbuildScriptForPairedReads in interface ScriptModulebuildScriptForPairedReads in class ScriptModuleImplfiles - 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 BioModulecheckDependencies in class ClassifierModuleImplException - thrown if missing or invalid dependencies are foundpublic void cleanUp()
throws Exception
BioModuleImplcleanUp in interface BioModulecleanUp in class BioModuleImplException - thrown if any runtime error occurspublic void executeTask()
throws Exception
executeTask in interface BioModuleexecuteTask in class ScriptModuleImplException - thrown if the module is unable to complete is taskpublic String getClassifierExe() throws ConfigException
getClassifierExe in interface ClassifierModulegetClassifierExe in class ClassifierModuleImplConfigException - if Configuration errors are thrownpublic List<String> getClassifierParams() throws ConfigException
getClassifierParams in interface ClassifierModulegetClassifierParams in class ClassifierModuleImplConfigException - if Configuration errors are thrownpublic File getDB() throws ConfigNotFoundException, ConfigPathException, DockerVolCreationException
DatabaseModulegetDB in interface DatabaseModulegetDB in class ClassifierModuleImplConfigNotFoundException - if DB property is undefined and the default DB is not included in the module
runtime envConfigPathException - if path is defined but does not existsDockerVolCreationExceptionpublic String getSummary() throws Exception
SeqModuleImplgetSummary in interface BioModulegetSummary in class ClassifierModuleImplException - if any error occurspublic List<String> getWorkerScriptFunctions() throws Exception
ScriptModulegetWorkerScriptFunctions in interface ScriptModulegetWorkerScriptFunctions in class ScriptModuleImplException - if errors occurprotected String getRuntimeParams() throws Exception
Exception - if errors occurpublic String getDockerImageOwner()
BioModulegetDockerImageOwner in interface BioModulegetDockerImageOwner in class BioModuleImplpublic String getDockerImageName()
BioModulegetDockerImageName in interface BioModulepublic String getDockerImageTag()
BioModulegetDockerImageTag in interface BioModulegetDockerImageTag in class BioModuleImplpublic String getTitle()
ApiModulegetTitle in interface ApiModulegetTitle in class BioModuleImplpublic String getDescription()
ApiModulegetDetails.getDescription in interface ApiModulepublic String getCitationString()
ApiModulegetCitationString in interface ApiModulepublic Boolean isValidProp(String property) throws Exception
ApiModuleBioModule.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 ApiModuleisValidProp in class ScriptModuleImplException