public class RarefyOtuCounts extends OtuCountModule implements ApiModule
Modifier and Type | Field and Description |
---|---|
protected static String |
LOW_ABUNDANT_CUTOFF
Config Posivite Double property to define minimum percentage of samples that must contain an
OTU. |
protected static String |
NUM_ITERATIONS
Config Positive Integer property "rarefyOtuCounts.iterations" defines the number of iterations to
randomly select the "rarefyOtuCounts.quantile"% of OTUs. |
protected static String |
QUANTILE
Config Positive Double property "rarefyOtuCounts.quantile" defines quantile for rarefication. |
protected static String |
REMOVE_LOW_ABUNDANT_SAMPLES
Config Boolean property "rarefyOtuCounts.rmLowSamples" if TRUE, all samples below the
quantile sample are removed. |
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 |
---|
RarefyOtuCounts() |
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()
Update
ParserModuleImpl OTU_COUNT field name. |
protected static void |
generateOtuput(File file,
TreeMap<String,Long> otuCounts)
Print the output file wit rarefied counts.
|
String |
getCitationString()
At a minimum, this should return the name and/or url for the wrapped tool.
|
protected static List<String> |
getData(String sampleId,
TreeMap<String,Long> otuCounts)
Get OTU count data for the given sampleId.
|
String |
getDescription()
Briefly describe what this module does.
|
protected List<String> |
getLowAbundantSamples()
Return a list of low abundant samples, as defined by "rarefyOtuCounts.lowAbundantCutoff"
|
protected Long |
getNumOtusForQuantile(TreeMap<String,TreeMap<String,Long>> sampleOtuCounts)
Get the quantile number of OTUs.
|
protected static List<String> |
getRandomQuantileOtus(List<String> data,
Long quantileNum)
Select random OTUs based on the quantileNum from the list of OTUs in data.
|
String |
getSummary()
Produce summary message with min, max, mean, and median number of reads.
|
protected TreeMap<String,Long> |
rarefy(String sampleId,
TreeMap<String,Long> otuCounts,
long quantileNum)
Rarefy the data by taking the average value of "rarefyOtuCounts.iterations"
|
void |
runModule()
Apply the quantile Config to the number of OTUs per sample to calculate the maximum OTU count per sample.
|
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
getDescription, getDetails, getMenuPlacement, getPropType, getTitle, isValidProp, listProps
executeTask, getAlias, getDockerImageName, getDockerImageOwner, getDockerImageTag, 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 LOW_ABUNDANT_CUTOFF
Config
Posivite Double property to define minimum percentage of samples that must contain an
OTU. Low abundance OTUs will be removed: "rarefyOtuCounts.lowAbundantCutoff"protected static final String NUM_ITERATIONS
Config
Positive Integer property "rarefyOtuCounts.iterations" defines the number of iterations to
randomly select the "rarefyOtuCounts.quantile"% of OTUs.protected static final String QUANTILE
Config
Positive Double property "rarefyOtuCounts.quantile" defines quantile for rarefication. The number
of OTUs/sample are ordered, all samples with more OTUs than the quantile sample are subselected without
replacement until they have the same number of OTUs as the quantile sample value. A quantile of 0.50 returns the
median value.protected static final String REMOVE_LOW_ABUNDANT_SAMPLES
Config
Boolean property "rarefyOtuCounts.rmLowSamples" if TRUE, all samples below the
quantile sample are removed.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
ParserModuleImpl
OTU_COUNT field name.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
runModule
in interface JavaModule
runModule
in class JavaModuleImpl
Exception
- thrown if any runtime error occursprotected List<String> getLowAbundantSamples() throws Exception
Exception
- if errors occurprotected Long getNumOtusForQuantile(TreeMap<String,TreeMap<String,Long>> sampleOtuCounts) throws Exception
sampleOtuCounts
- TreeMap(SampleId, TreeMap(OTU, count)) OTU counts for every sampleException
- if errors occurprotected TreeMap<String,Long> rarefy(String sampleId, TreeMap<String,Long> otuCounts, long quantileNum) throws Exception
sampleId
- Sample IDotuCounts
- OTU countsquantileNum
- Maximum numberException
- if errors occurprotected static void generateOtuput(File file, TreeMap<String,Long> otuCounts) throws Exception
file
- Output fileotuCounts
- TreeMap(OTU, count)Exception
- if errors occurprotected static List<String> getData(String sampleId, TreeMap<String,Long> otuCounts) throws Exception
sampleId
- Sample IDotuCounts
- All OTU countsException
- if errors occurprotected static List<String> getRandomQuantileOtus(List<String> data, Long quantileNum)
data
- List( OTUs )quantileNum
- Qunatile (range: 0.0 - 1.0)public String getDescription()
ApiModule
getDetails
.getDescription
in interface ApiModule
public String getCitationString()
ApiModule
getCitationString
in interface ApiModule