public class RemoveScarceOtuCounts extends OtuCountModule
BLJ_OPTIONS
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 |
---|
RemoveScarceOtuCounts() |
Modifier and Type | Method and Description |
---|---|
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
|
void |
cleanUp()
Set the number of hits field.
|
protected static TreeMap<String,TreeSet<String>> |
findScarceOtus(TreeSet<String> uniqueOtus,
TreeMap<String,TreeSet<String>> scarceTaxa)
Find the scarce OTUs that contain the key values in scarceTaxa.
|
protected TreeMap<String,TreeSet<String>> |
findScarceTaxa(TreeMap<String,TreeMap<String,Long>> sampleOtuCounts,
TreeSet<String> otus)
Find scarce taxa found in less samples than the cutoff percentage:
Config ."report.scarceCountCutoff". |
String |
getSummary()
Produce summary message with min, max, mean, and median number of reads.
|
protected TreeMap<String,TreeMap<String,Long>> |
getUpdatedOtuCounts(TreeMap<String,TreeMap<String,Long>> sampleOtuCounts,
TreeMap<String,TreeSet<String>> scarceOtus)
Remove scarce OTUs from the sampleOtuCounts and return it.
|
protected void |
logScarceOtus(Set<String> scarceOtus)
Save a list of scarce OTUs to the module temp directory.
|
protected void |
removeScarceOtuCounts(TreeMap<String,TreeMap<String,Long>> updatedOtuCounts)
Output OTU count files with the updatedOtuCounts
|
void |
runModule()
This method executes the modules primary Java routine.
|
getInputFiles, isOtuModule, isValidInputModule
buildScript, executeTask, getDockerImageName, getDockerImageOwner, getDockerImageTag, getWorkerScriptFunctions, markStatus, moduleComplete, moduleFailed, runBioLockJ_CMD
buildScriptForPairedReads, getJobParams, getMainScript, getRuntimeParams, getScriptDir, getScriptErrors, getTimeout, hasScripts, isValidProp
addGeneralProperty, addGeneralProperty, addGeneralProperty, addNewProperty, addNewProperty, cacheInputFiles, 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
buildScriptForPairedReads, getJobParams, getMainScript, getScriptDir, getScriptErrors, getTimeout
getAlias, getID, getLogDir, getMetadata, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getPropDefault, getResourceDir, getTempDir, init, setAlias, version
public 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 void cleanUp() throws Exception
cleanUp
in interface BioModule
cleanUp
in class BioModuleImpl
Exception
- thrown if any runtime error occurspublic String getSummary() throws Exception
getSummary
in interface BioModule
getSummary
in class ScriptModuleImpl
Exception
- if any error occurspublic void runModule() throws Exception
JavaModule
runModule
in interface JavaModule
runModule
in class JavaModuleImpl
Exception
- thrown if any runtime error occursprotected TreeMap<String,TreeSet<String>> findScarceTaxa(TreeMap<String,TreeMap<String,Long>> sampleOtuCounts, TreeSet<String> otus) throws Exception
Config
."report.scarceCountCutoff". Return a map of these scare taxa and a
set of samples that need to remove them.sampleOtuCounts
- TreeMap(SampleId, TreeMap(OTU, count)) OTU counts for every sampleotus
- TreeSet of unique OTUsException
- if errors occurprotected TreeMap<String,TreeMap<String,Long>> getUpdatedOtuCounts(TreeMap<String,TreeMap<String,Long>> sampleOtuCounts, TreeMap<String,TreeSet<String>> scarceOtus)
sampleOtuCounts
- TreeMap(SampleId, TreeMap(OTU, count)) OTU counts for every samplescarceOtus
- TreeMap(OTU, TreeSet(SampleId)) Scarce OTUs and the samples that list themprotected void logScarceOtus(Set<String> scarceOtus) throws Exception
scarceOtus
- OTUs found in too few samplesException
- if errors occurprotected void removeScarceOtuCounts(TreeMap<String,TreeMap<String,Long>> updatedOtuCounts) throws Exception
updatedOtuCounts
- TreeMap(SampleId, TreeMap(OTU, count)) OTU counts for every sampleException
- if errors occurprotected static TreeMap<String,TreeSet<String>> findScarceOtus(TreeSet<String> uniqueOtus, TreeMap<String,TreeSet<String>> scarceTaxa)
uniqueOtus
- TreeSet(OTU) contains all OTUs for all samplesscarceTaxa
- TreeMap(taxa, TreeSet(SampleId)) contains scarce taxa and their associated samples