public abstract class ParserModuleImpl extends JavaModuleImpl implements ParserModule
BioModule
s read ClassifierModule
output to build
standardized OTU count tables. This class provides the default abstract implementation.Modifier and Type | Field and Description |
---|---|
protected static String |
NUM_OTUS
Metadata column name for column that holds number of OTU hits after any
biolockj.module.implicit.parser
module executes: "OTU_COUNT" |
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 |
---|
ParserModuleImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addOtuNode(OtuNode node)
Each sample with taxonomic assignments from a
ClassifierModule is parsed by
ParserModule.parseSamples() to produce a ParsedSample . |
void |
buildOtuCountFiles()
After
ParserModule.parseSamples() completes, this method builds the OTU count files. |
void |
checkDependencies()
Execute
validateModuleOrder() to validate module configuration order. |
static Set<String> |
getDepricatedOtuCountFields()
Getter for depricatedOtuCountFields
|
static String |
getOtuCountField()
Getter for otuCountField
|
ParsedSample |
getParsedSample(String sampleId)
After
ParserModule.parseSamples() completes, this method can be called to get a ParsedSample by
its sample ID. |
String |
getSummary()
Produce summary message with min, max, mean, and median number of reads.
|
protected boolean |
isValid(OtuNode node)
Some
ClassifierModule s can include taxonomy level identifiers without an OTU
name in the sample report files. |
abstract void |
parseSamples()
Parse
ClassifierModule output to build ParsedSample s. |
void |
runModule()
Parsers execute a task with 3 core functions:
parseSamples() - generates ParsedSample s
buildOtuCountFiles() - builds OTU tree tables from the ParsedSample s
|
static void |
setNumHitsFieldName(String name)
When a module modifies the number of hits, the new counts must replace the old count fields.
|
protected void |
validateModuleOrder()
Validate that no
biolockj.module.seq modules run after this parser unless a new classifier branch is
started. |
buildScript, executeTask, getSource, getWorkerScriptFunctions, isValidInputModule, markStatus, moduleComplete, moduleFailed
buildScriptForPairedReads, getJobParams, getMainScript, getRuntimeParams, getScriptDir, getScriptErrors, getTimeout, hasScripts
cacheInputFiles, cleanUp, compareTo, equals, findModuleInputFiles, getFileCache, getID, getInputFiles, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getTempDir, init, toString, validateFileNameUnique
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
moduleComplete, moduleFailed
buildScript, buildScriptForPairedReads, getJobParams, getMainScript, getScriptDir, getScriptErrors, getTimeout, getWorkerScriptFunctions
cleanUp, executeTask, getID, getInputFiles, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getTempDir, init, isValidInputModule
protected static final String NUM_OTUS
biolockj.module.implicit.parser
module executes: "OTU_COUNT"public void addOtuNode(OtuNode node) throws Exception
ParserModule
ClassifierModule
is parsed by
ParserModule.parseSamples()
to produce a ParsedSample
. As each file is processed, this method
is called to add the OtuNode
to the ParsedSample
with the same sample
ID (if valid).addOtuNode
in interface ParserModule
node
- OtuNodeException
- if unable to add the OTU nodepublic void buildOtuCountFiles() throws Exception
ParserModule
ParserModule.parseSamples()
completes, this method builds the OTU count files.buildOtuCountFiles
in interface ParserModule
Exception
- if error occurs while building OTU tablespublic void checkDependencies() throws Exception
validateModuleOrder()
to validate module configuration order.checkDependencies
in interface BioModule
checkDependencies
in class ScriptModuleImpl
Exception
- thrown if missing or invalid dependencies are foundpublic ParsedSample getParsedSample(String sampleId)
ParserModule
ParserModule.parseSamples()
completes, this method can be called to get a ParsedSample
by
its sample ID.getParsedSample
in interface ParserModule
sampleId
- Sample IDpublic String getSummary() throws Exception
getSummary
in interface BioModule
getSummary
in class ScriptModuleImpl
Exception
- if any error occurspublic abstract void parseSamples() throws Exception
ParserModule
ClassifierModule
output to build ParsedSample
s.parseSamples
in interface ParserModule
Exception
- if error occurs while parsing classifier reportspublic void runModule() throws Exception
parseSamples()
- generates ParsedSample
s
buildOtuCountFiles()
- builds OTU tree tables from the ParsedSample
s
runModule
in interface JavaModule
runModule
in class JavaModuleImpl
Exception
- thrown if any runtime error occursprotected boolean isValid(OtuNode node) throws Exception
ClassifierModule
s can include taxonomy level identifiers without an OTU
name in the sample report files. This method verifies the node exists, has a valid sample ID, and that no empty
String OTU names are reported.node
- OtuNode build from 1 line of a ClassifierModule
output fileOtuNode
is validException
- if errors occur checking if node is validprotected void validateModuleOrder() throws Exception
biolockj.module.seq
modules run after this parser unless a new classifier branch is
started.Exception
- if modules are out of orderpublic static Set<String> getDepricatedOtuCountFields()
public static String getOtuCountField()