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_EXTLOG_DIR, MAIN_SCRIPT_PREFIX, NO_VERSION, OUTPUT_DIR, RES_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. |
protected void |
addParsedSample(ParsedSample parsedSample)
Add
ParsedSample to parser cache |
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
|
protected Map<String,String> |
getHitsPerSample()
Simple getter for hitsPerSample map
|
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. |
protected TreeSet<ParsedSample> |
getParsedSamples()
Simple getter for TreeSet of ParsedSamples
|
protected Set<String> |
getSampleIds()
Simple getter for Set of Sample IDs output by the module
|
String |
getSummary()
Produce summary message with min, max, mean, and median number of reads.
|
protected Set<String> |
getUniqueOtus()
Simple getter for Set of unique OTU names output by the module
|
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 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, getDockerImageName, getDockerImageOwner, getDockerImageTag, getWorkerScriptFunctions, isValidInputModule, markStatus, moduleComplete, moduleFailed, runBioLockJ_CMDbuildScriptForPairedReads, getJobParams, getMainScript, getRuntimeParams, getScriptDir, getScriptErrors, getTimeout, hasScripts, isValidPropaddGeneralProperty, addGeneralProperty, addGeneralProperty, addNewProperty, addNewProperty, cacheInputFiles, cleanUp, compareTo, equals, findModuleInputFiles, getAlias, getDescription, getDetails, getFileCache, getID, getInputFiles, getLogDir, getMenuPlacement, getMetadata, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getPropDefault, getPropDescMap, getPropType, getPropTypeMap, getResourceDir, getTempDir, getTitle, hashCode, init, listProps, setAlias, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitmoduleComplete, moduleFailedbuildScript, buildScriptForPairedReads, getJobParams, getMainScript, getScriptDir, getScriptErrors, getTimeout, getWorkerScriptFunctionscleanUp, executeTask, getAlias, getDockerImageName, getDockerImageOwner, getDockerImageTag, getID, getInputFiles, getLogDir, getMetadata, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getPropDefault, getResourceDir, getTempDir, init, isValidInputModule, setAlias, versionprotected 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 ParsedSamples
runModule in interface JavaModulerunModule in class JavaModuleImplException - thrown if any runtime error occursprotected void addParsedSample(ParsedSample parsedSample) throws Exception
ParsedSample to parser cacheparsedSample - ParsedSampleException - if method is used to add a duplicate sampleprotected Map<String,String> getHitsPerSample()
protected TreeSet<ParsedSample> getParsedSamples()
protected Set<String> getSampleIds()
protected Set<String> getUniqueOtus()
protected 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()