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_EXT
LOG_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, isValidInputModule
buildScriptForPairedReads, executeTask, getJobParams, getMainScript, getRuntimeParams, getScriptDir, getScriptErrors, getTimeout, hasScripts
addGeneralProperty, 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, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getDescription, getDetails, getMenuPlacement, getPropType, getTitle, listProps
cleanUp, executeTask, getAlias, getID, getInputFiles, getLogDir, getMetadata, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getPropDefault, getResourceDir, getTempDir, init, isValidInputModule, setAlias, version
buildScriptForPairedReads, getJobParams, getMainScript, getScriptDir, getScriptErrors, getTimeout
protected 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
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 void checkDependencies() throws Exception
ScriptModuleImpl
Config
. exists
Config
. is positive integer
Config
. is positive integer
Config
. is positive integer if set
checkDependencies
in interface BioModule
checkDependencies
in class ScriptModuleImpl
Exception
- thrown if missing or invalid dependencies are foundpublic File getDB() throws ConfigPathException, ConfigNotFoundException
DatabaseModule
getDB
in interface DatabaseModule
ConfigPathException
- 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
SeqModuleImpl
getSummary
in interface BioModule
getSummary
in class SeqModuleImpl
Exception
- if any error occurspublic List<String> getWorkerScriptFunctions() throws Exception
getWorkerScriptFunctions
in interface ScriptModule
getWorkerScriptFunctions
in class ScriptModuleImpl
Exception
- 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()
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 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