public class QiimeParser extends ParserModuleImpl
| Modifier and Type | Field and Description |
|---|---|
protected static List<String> |
orderedQiimeIDs
Qiime IDs are listed in the same order in each taxonomy level report.
|
protected static Map<String,String> |
qiimeIdToSampleIdMap
Convenience map, to convert Qiime ID to Sample ID
|
protected static Map<String,String> |
sampleIdToQiimeIdMap
Convenience map, to convert Sample ID to Qiime ID
|
NUM_OTUSBLJ_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 |
|---|
QiimeParser() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp()
If metadata exists in module output directory, refresh MetaUtil.
|
protected int |
getFileNameColumn(String line)
Examines the header line to find the column index for "BioLockJFileName" which holds the
demultiplexed sample file name.
|
List<File> |
getInputFiles()
Get only the lowest level report since it contains taxa info for all higher OTU reports.
|
protected static String |
getOtuTableRowId(String id)
This method is used to get an R-friendly Sample ID value by stripping out the quotes AND by replacing any Qiime
ID found with the original Sample ID.
|
protected static String |
getSampleId(String qiimeId)
Get the Sample ID from
qiimeIdToSampleIdMap. |
protected static String |
getSampleIdFromMappingFile(String qiimeId,
int demuxIndex)
The mapping file used the original sampleId when generating the demultipled files, as recorded in mapping file
column - "BioLockJFileName".
|
protected void |
initializeMaps()
Sample IDs in the original metadata file may contain restricted characters that will be replaced with a "." via
{link biolockj.module.implicit.qiime.BuildQiimeMapping}.
|
void |
parseSamples()
Parse lowest level
QiimeClassifier report in the input directory. |
void |
runModule()
To parse the taxonomy level reports output by
QiimeClassifier:
Call getInputFiles()
Call initializeMaps()
Call setOrderedQiimeIDs(File)
Create ParsedSample for the OtuNodeImpl.getSampleId() if not
yet created. |
protected void |
setOrderedQiimeIDs(File file)
Qiime IDs are read in from the header line, converted to the sampleId, and saved to
orderedQiimeIDs. |
addOtuNode, addParsedSample, buildOtuCountFiles, checkDependencies, getDepricatedOtuCountFields, getHitsPerSample, getOtuCountField, getParsedSample, getParsedSamples, getSampleIds, getSummary, getUniqueOtus, isValid, setNumHitsFieldName, validateModuleOrderbuildScript, executeTask, getDockerImageName, getDockerImageOwner, getDockerImageTag, getWorkerScriptFunctions, isValidInputModule, markStatus, moduleComplete, moduleFailed, runBioLockJ_CMDbuildScriptForPairedReads, getJobParams, getMainScript, getRuntimeParams, getScriptDir, getScriptErrors, getTimeout, hasScripts, isValidPropaddGeneralProperty, 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, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitmoduleComplete, moduleFailedbuildScript, buildScriptForPairedReads, getJobParams, getMainScript, getScriptDir, getScriptErrors, getTimeout, getWorkerScriptFunctionsexecuteTask, getAlias, getDockerImageName, getDockerImageOwner, getDockerImageTag, getID, getLogDir, getMetadata, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getPropDefault, getResourceDir, getTempDir, init, isValidInputModule, setAlias, versionprotected static final List<String> orderedQiimeIDs
protected static final Map<String,String> qiimeIdToSampleIdMap
public void cleanUp()
throws Exception
BioModuleImplcleanUp in interface BioModulecleanUp in class BioModuleImplException - thrown if any runtime error occurspublic List<File> getInputFiles()
getInputFiles in interface BioModulegetInputFiles in class BioModuleImplpublic void parseSamples()
throws Exception
QiimeClassifier report in the input directory. The
classifier report lists 1 OTU/line with 1 column/sample, each column holds the OTU count for the QIIME ID in the
column header. For each line, build a QiimeNode for each sample with a positive OTU
count.
QiimeNodes will be created using QiimeID (not SampleID) in order to match the metadata
file #SampleID
If ParserModuleImpl.isValid(OtuNode):
ParsedSample for the OtuNodeImpl.getSampleId() if not
yet created.
OtuNodeImpl.getCount() (1) to ParsedSample OTU count.
parseSamples in interface ParserModuleparseSamples in class ParserModuleImplException - if error occurs while parsing classifier reportspublic void runModule()
throws Exception
QiimeClassifier:
getInputFiles()
initializeMaps()
setOrderedQiimeIDs(File)
ParsedSample for the OtuNodeImpl.getSampleId() if not
yet created.
OtuNodeImpl.getCount() (1) to ParsedSample OTU count.
Sample QIIME report line: (head otu_table_L2.txt):
# Constructed from biom file #OTU ID 3A.1 6A.1 120A.1 7A.1 k__Bacteria;p__Actinobacteria 419.0 26.0 90.0 70.0
runModule in interface JavaModulerunModule in class ParserModuleImplException - thrown if any runtime error occursprotected int getFileNameColumn(String line) throws Exception
line - Header line containing column namesException - If "BioLockJFileName" not found.protected void initializeMaps()
throws Exception
Exception - if unable to initialize the mapsConvenience maps are initialized to simplify lookups:
protected void setOrderedQiimeIDs(File file) throws Exception
orderedQiimeIDs.file - Taxonomy level report fileException - If unable to read the file parameterprotected static String getOtuTableRowId(String id) throws Exception
id - Sample IDException - If any QIIME ID does not have a corresponding Sample IDprotected static String getSampleId(String qiimeId) throws Exception
qiimeIdToSampleIdMap. Qiime removes special characters by output of
BuildQiimeMapping, to create the qiimeId, which this method accepts as a
parameter to lookup the Sample ID.qiimeId - Qiime ID that was created from sample ID in a previous scriptException - if the qiimeId is not found in qiimeIdToSampleIdMapprotected static String getSampleIdFromMappingFile(String qiimeId, int demuxIndex) throws Exception
qiimeId - Qiime corrected IDdemuxIndex - Qiime mapping column index for"BioLockJFileName"Exception - if unable to get sample ID from metadata file column
"BioLockJFileName"