public class NormalizeTaxaTables extends TaxaCountModule
Constants.REPORT_LOG_BASE
property.
Modifier and Type | Field and Description |
---|---|
protected static String |
LOG_10
Log 10 display string as 1/2 supported values for: "report.logBase"
|
protected static String |
LOG_E
Log e display string as 1/2 supported values for: "report.logBase"
|
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 |
---|
NormalizeTaxaTables() |
Modifier and Type | Method and Description |
---|---|
void |
checkDependencies()
Verify
Config ."report.logBase" property is valid (if defined) with a
value = (e or 10). |
protected static List<String> |
filterZeroSampleIDs(List<String> sampleIDs,
Set<Integer> allZeroIndex)
Filter Sample IDs with all zero rows
|
protected static Set<Integer> |
findAllZeroIndex(List<List<Long>> data)
Return the table index for rows with all zer count values
|
protected String |
getLogBase()
Get the Log base (10 or e)
|
protected static List<String> |
getOtuNames(String header)
Parse Taxa names from the given header line.
|
String |
getSummary()
Returns summary message to be displayed by Email module so must not contain confidential info.
|
void |
runModule()
This method executes the modules primary Java routine.
|
protected void |
transform(File taxaTable)
Populate normalized OTU counts with the formula: (RC/n)*((SUM(x))/N)+1
|
protected static void |
writeDataToFile(File inputFile,
List<String> sampleNames,
List<String> taxaNames,
List<List<String>> taxaCounts)
Write transformed data to file
|
filterByProcessLevel, getInputFiles, getPreRequisiteModules, isTaxaModule, isValidInputModule
buildScript, executeTask, getSource, getWorkerScriptFunctions, markStatus, moduleComplete, moduleFailed
buildScriptForPairedReads, getJobParams, getMainScript, getRuntimeParams, getScriptDir, getScriptErrors, getTimeout, hasScripts
cacheInputFiles, cleanUp, compareTo, equals, findModuleInputFiles, getFileCache, getID, getModuleDir, getOutputDir, getPostRequisiteModules, getTempDir, init, toString, validateFileNameUnique
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
buildScriptForPairedReads, getJobParams, getMainScript, getScriptDir, getScriptErrors, getTimeout
cleanUp, getID, getModuleDir, getOutputDir, getPostRequisiteModules, getTempDir, init
protected static final String LOG_10
protected static final String LOG_E
public void checkDependencies() throws Exception
Config
."report.logBase" property is valid (if defined) with a
value = (e or 10).checkDependencies
in interface BioModule
checkDependencies
in class ScriptModuleImpl
ConfigFormatException
- if REPORT_LOG_BASE is not set to a valid option (e or 10)Exception
- thrown if missing or invalid dependencies are foundpublic String getSummary() throws Exception
ScriptModuleImpl
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 String getLogBase()
protected void transform(File taxaTable) throws Exception
taxaTable
- OTU raw count tableException
- if unable to construct NormalizeTaxaTablesprotected static List<String> filterZeroSampleIDs(List<String> sampleIDs, Set<Integer> allZeroIndex)
sampleIDs
- List of Sample IDsallZeroIndex
- Table row index for all-zero rowsprotected static Set<Integer> findAllZeroIndex(List<List<Long>> data)
data
- List of table rowsprotected static List<String> getOtuNames(String header)
header
- Head line of tableprotected static void writeDataToFile(File inputFile, List<String> sampleNames, List<String> taxaNames, List<List<String>> taxaCounts) throws Exception
inputFile
- Count tablesampleNames
- SampletaxaNames
- Taxa namestaxaCounts
- Taxa countsException
- if errors occur