public class RemoveScarceOtuCounts extends OtuCountModule
BLJ_OPTIONS
GZIP_EXT, LOG_EXT, PDF_EXT, RETURN, SH_EXT, TAB_DELIM, TSV_EXT, TXT_EXT
SCRIPT_BATCH_SIZE, SCRIPT_DEFAULT_HEADER, SCRIPT_NUM_THREADS, SCRIPT_PERMISSIONS, SCRIPT_TIMEOUT
MAIN_SCRIPT_PREFIX, OUTPUT_DIR, TEMP_DIR
Constructor and Description |
---|
RemoveScarceOtuCounts() |
Modifier and Type | Method and Description |
---|---|
void |
checkDependencies()
|
void |
cleanUp()
Set the number of hits field.
|
protected static TreeMap<String,TreeSet<String>> |
findScarceOtus(TreeMap<String,TreeMap<String,Long>> sampleOtuCounts,
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, getSource, getWorkerScriptFunctions, markStatus, moduleComplete, moduleFailed
buildScriptForPairedReads, getJobParams, getMainScript, getRuntimeParams, getScriptDir, getScriptErrors, getTimeout, hasScripts
cacheInputFiles, compareTo, equals, findModuleInputFiles, getFileCache, getID, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getTempDir, init, toString, validateFileNameUnique
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
buildScriptForPairedReads, getJobParams, getMainScript, getScriptDir, getScriptErrors, getTimeout
getID, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getTempDir, init
public void checkDependencies() throws Exception
ScriptModuleImpl
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(TreeMap<String,TreeMap<String,Long>> sampleOtuCounts, TreeSet<String> uniqueOtus, TreeMap<String,TreeSet<String>> scarceTaxa)
sampleOtuCounts
- TreeMap(SampleId, TreeMap(OTU, count)) OTU counts for every sampleuniqueOtus
- TreeSet(OTU) contains all OTUs for all samplesscarceTaxa
- TreeMap(taxa, TreeSet(SampleId)) contains scarce taxa and their associated samples