public abstract class ParserModuleImpl extends JavaModuleImpl implements ParserModule
BioModules 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_OPTIONSGZIP_EXT, LOG_EXT, PDF_EXT, RETURN, SH_EXT, TAB_DELIM, TSV_EXT, TXT_EXTSCRIPT_BATCH_SIZE, SCRIPT_DEFAULT_HEADER, SCRIPT_NUM_THREADS, SCRIPT_PERMISSIONS, SCRIPT_TIMEOUTMAIN_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
ClassifierModules can include taxonomy level identifiers without an OTU
name in the sample report files. |
abstract void |
parseSamples()
Parse
ClassifierModule output to build ParsedSamples. |
void |
runModule()
Parsers execute a task with 3 core functions:
parseSamples() - generates ParsedSamples
buildOtuCountFiles() - builds OTU tree tables from the ParsedSamples
|
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, moduleFailedbuildScriptForPairedReads, getJobParams, getMainScript, getRuntimeParams, getScriptDir, getScriptErrors, getTimeout, hasScriptscacheInputFiles, cleanUp, compareTo, equals, findModuleInputFiles, getFileCache, getID, getInputFiles, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getTempDir, init, toString, validateFileNameUniqueclone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitmoduleComplete, moduleFailedbuildScript, buildScriptForPairedReads, getJobParams, getMainScript, getScriptDir, getScriptErrors, getTimeout, getWorkerScriptFunctionscleanUp, executeTask, getID, getInputFiles, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getTempDir, init, isValidInputModuleprotected static final String NUM_OTUS
biolockj.module.implicit.parser
module executes: "OTU_COUNT"public void addOtuNode(OtuNode node) throws Exception
ParserModuleClassifierModule 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 ParserModulenode - OtuNodeException - if unable to add the OTU nodepublic void buildOtuCountFiles()
throws Exception
ParserModuleParserModule.parseSamples() completes, this method builds the OTU count files.buildOtuCountFiles in interface ParserModuleException - if error occurs while building OTU tablespublic void checkDependencies()
throws Exception
validateModuleOrder() to validate module configuration order.checkDependencies in interface BioModulecheckDependencies in class ScriptModuleImplException - thrown if missing or invalid dependencies are foundpublic ParsedSample getParsedSample(String sampleId)
ParserModuleParserModule.parseSamples() completes, this method can be called to get a ParsedSample by
its sample ID.getParsedSample in interface ParserModulesampleId - Sample IDpublic String getSummary() throws Exception
getSummary in interface BioModulegetSummary in class ScriptModuleImplException - if any error occurspublic abstract void parseSamples()
throws Exception
ParserModuleClassifierModule output to build ParsedSamples.parseSamples in interface ParserModuleException - if error occurs while parsing classifier reportspublic void runModule()
throws Exception
parseSamples() - generates ParsedSamples
buildOtuCountFiles() - builds OTU tree tables from the ParsedSamples
runModule in interface JavaModulerunModule in class JavaModuleImplException - thrown if any runtime error occursprotected boolean isValid(OtuNode node) throws Exception
ClassifierModules 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()