public class Metaphlan2Classifier extends ClassifierModuleImpl
| Modifier and Type | Field and Description |
|---|---|
protected static String |
EXE_METAPHLAN
Config exe property used to obtain the metaphlan2 executable |
protected static String |
EXE_METAPHLAN_PARAMS
Config List property used to obtain the metaphlan2 executable params |
protected static String |
METAPHLAN2_DB
Config Directory property containing alternate database: "metaphlan2.db"Must always be paired with "metaphlan2.mpa_pkl" |
protected static String |
METAPHLAN2_MPA_PKL
Config File property containing path to the mpa_pkl file used to reference an alternate DB
"metaphlan2.mpa_pkl"Must always be paired with "metaphlan2.db" |
GZIP_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 |
|---|
Metaphlan2Classifier() |
| Modifier and Type | Method and Description |
|---|---|
List<List<String>> |
buildScript(List<File> files)
Build bash script lines to classify unpaired WGS reads with Metaphlan.
|
List<List<String>> |
buildScriptForPairedReads(List<File> files)
Build bash script lines to classify paired WGS reads with Metaphlan.
|
void |
checkDependencies()
|
String |
getClassifierExe()
Metaphlan runs python scripts, so no special command is required
|
List<String> |
getClassifierParams()
Obtain the metaphlan2 runtime params
|
File |
getDB()
Return database directory, if multiple databases are configured, they must share a common parent directory and
the common parent directory is returned by this method.
|
protected String |
getParams()
Metaphlan queries require standard parameters: --input_type, --nproc, -t
Verify no invalid runtime params are passed and add rankSwitch if needed. Set the rankSwitch based on the Config."report.taxonomyLevels" if
only one taxonomy level is to be reported, otherwise report all levels. |
List<String> |
getWorkerScriptFunctions()
Method returns bash script lines used to build the functions called by the worker scripts.
|
getClassifierType, getPostRequisiteModules, getSummary, validateModuleOrdergetInputFiles, getSeqFiles, isValidInputModuleexecuteTask, getJobParams, getMainScript, getRuntimeParams, getScriptDir, getScriptErrors, getTimeout, hasScriptscacheInputFiles, cleanUp, compareTo, equals, findModuleInputFiles, getFileCache, getID, getModuleDir, getOutputDir, getPreRequisiteModules, getTempDir, init, toString, validateFileNameUniqueclone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetSeqFilesgetJobParams, getMainScript, getScriptDir, getScriptErrors, getTimeoutcleanUp, executeTask, getID, getInputFiles, getModuleDir, getOutputDir, getPreRequisiteModules, getTempDir, init, isValidInputModuleprotected static final String EXE_METAPHLAN
Config exe property used to obtain the metaphlan2 executableprotected static final String EXE_METAPHLAN_PARAMS
Config List property used to obtain the metaphlan2 executable paramsprotected static final String METAPHLAN2_DB
Config Directory property containing alternate database: "metaphlan2.db"protected static final String METAPHLAN2_MPA_PKL
Config File property containing path to the mpa_pkl file used to reference an alternate DB
"metaphlan2.mpa_pkl"public List<List<String>> buildScript(List<File> files) throws Exception
Example line:
python /app/metaphlan2.py --nproc 8 -t rel_ab_w_read_stats --input_type fasta ./input/sample42.fasta --bowtie2out
./temp/sample42.bowtie2.bz2 > ./output/sample42_reported.tsv
buildScript in interface ScriptModulebuildScript in class ScriptModuleImplfiles - Files in the input directory that contain only forward readsException - if unable to generate script linespublic List<List<String>> buildScriptForPairedReads(List<File> files) throws Exception
Example line:
python /app/metaphlan2.py --nproc 8 -t rel_ab_w_read_stats --input_type fasta ./input/sample42_R1.fasta,
./input/sample42_R2.fasta --bowtie2out ./temp/sample42.bowtie2.bz2 > ./output/sample42_reported.tsv
buildScriptForPairedReads in interface ScriptModulebuildScriptForPairedReads in class ScriptModuleImplfiles - Files in the input directory that contain only paired readsException - if unable to generate the script linespublic void checkDependencies()
throws Exception
checkDependencies in interface BioModulecheckDependencies in class ClassifierModuleImplException - thrown if missing or invalid dependencies are foundpublic String getClassifierExe() throws Exception
getClassifierExe in interface ClassifierModulegetClassifierExe in class ClassifierModuleImplException - if the classifier program undefined or invalidpublic List<String> getClassifierParams() throws Exception
getClassifierParams in interface ClassifierModulegetClassifierParams in class ClassifierModuleImplException - thrown if parameters defined are invalidpublic File getDB() throws Exception
DatabaseModulegetDB in interface DatabaseModulegetDB in class ClassifierModuleImplException - thrown if any runtime error occurspublic List<String> getWorkerScriptFunctions() throws Exception
ScriptModulegetWorkerScriptFunctions in interface ScriptModulegetWorkerScriptFunctions in class ScriptModuleImplException - if errors occurprotected String getParams() throws Exception
Config."report.taxonomyLevels" if
only one taxonomy level is to be reported, otherwise report all levels.Exception - if errors occur