public class KneadData extends SeqModuleImpl implements DatabaseModule, ApiModule
| Modifier and Type | Field and Description |
|---|---|
protected static String |
EXE_KNEADDATA
KneadData executable: "exe.kneaddata"
|
protected static String |
EXE_KNEADDATA_PARAMS
Config property containing parameters for "exe.kneaddata":
"kneaddata.kneaddataParams" |
protected static String |
FUNCTION_SANATIZE
Name of the bash function used to decompress gzipped files: "sanatizeData"
|
protected static String |
KNEAD_DBS
Config required property to the contaminent databases "kneaddata.dbs": |
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 |
|---|
KneadData() |
| Modifier and Type | Method and Description |
|---|---|
List<List<String>> |
buildScript(List<File> files)
Return an inner list of lines to execute for each sample.
|
protected List<String> |
buildScriptLinesToMoveValidSeqsToOutputDir(String sampleId)
Move 1 file named /"Sample_ID.fastq/" if module input consists of forward reads only.
If module input contains paired reads, move 2 files named /"Sample_ID_paired_1.fastq/" and /"Sample_ID_paired_2.fastq/" to the module output directory (after renaming them to BioLockJ standards). |
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
|
String |
getCitationString()
At a minimum, this should return the name and/or url for the wrapped tool.
|
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 File |
getSanatizedFile(String sampleId,
Boolean isRvRead)
Return sanitized sequence data file.
|
String |
getSummary()
Add database info if module is a DatabaseModule
|
List<String> |
getWorkerScriptFunctions()
This method generates the worker script function: "sanatizeData".
|
Boolean |
isValidProp(String property)
Tests to see if the value val is valid for property prop; primarily tests format.
|
getInputFiles, getSeqFiles, isValidInputModulebuildScriptForPairedReads, executeTask, getJobParams, getMainScript, getRuntimeParams, getScriptDir, getScriptErrors, getTimeout, hasScriptsaddGeneralProperty, addGeneralProperty, addGeneralProperty, addNewProperty, addNewProperty, cacheInputFiles, cleanUp, compareTo, equals, findModuleInputFiles, getAlias, getDescription, getDetails, getFileCache, getID, getLogDir, getMenuPlacement, getMetadata, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getPropDefault, getPropDescMap, getPropType, getPropTypeMap, getResourceDir, getTempDir, getTitle, hashCode, init, listProps, setAlias, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetDescription, getDetails, getMenuPlacement, getPropType, getTitle, listPropscleanUp, executeTask, getAlias, getID, getInputFiles, getLogDir, getMetadata, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getPropDefault, getResourceDir, getTempDir, init, isValidInputModule, setAlias, versionbuildScriptForPairedReads, getJobParams, getMainScript, getScriptDir, getScriptErrors, getTimeoutprotected static final String EXE_KNEADDATA
protected static final String EXE_KNEADDATA_PARAMS
Config property containing parameters for "exe.kneaddata":
"kneaddata.kneaddataParams"protected static final String FUNCTION_SANATIZE
protected static final String KNEAD_DBS
Config required property to the contaminent databases "kneaddata.dbs":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 void checkDependencies()
throws Exception
ScriptModuleImplConfig. exists
Config. is positive integer
Config. is positive integer
Config. is positive integer if set
checkDependencies in interface BioModulecheckDependencies in class ScriptModuleImplException - thrown if missing or invalid dependencies are foundpublic File getDB() throws ConfigPathException, ConfigNotFoundException
DatabaseModulegetDB in interface DatabaseModuleConfigPathException - if path is defined but does not existsConfigNotFoundException - if DB property is undefined and the default DB is not included in the module
runtime envpublic String getSummary() throws Exception
SeqModuleImplgetSummary in interface BioModulegetSummary in class SeqModuleImplException - if any error occurspublic List<String> getWorkerScriptFunctions() throws Exception
getWorkerScriptFunctions in interface ScriptModulegetWorkerScriptFunctions in class ScriptModuleImplException - if errors occurprotected List<String> buildScriptLinesToMoveValidSeqsToOutputDir(String sampleId) throws Exception
sampleId - Sample IDException - if errors occur building linesprotected File getSanatizedFile(String sampleId, Boolean isRvRead)
sampleId - Sample IDisRvRead - Boolean TRUE to return the file containing reverse readspublic 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 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