public class Multiplexer extends JavaModuleImpl implements SeqModule
Modifier and Type | Field and Description |
---|---|
protected static String |
DO_GZIP
Config boolean property that if enabled will gzip the multiplexed output: "multiplexer.gzip": |
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 |
---|
Multiplexer() |
Modifier and Type | Method and Description |
---|---|
void |
checkDependencies()
Validate module dependencies:
Validate this is the last module to run (excluding
Email )
If this module was completed on a previous run, update the property:
Config ."internal.multiplexed" = "Y" |
protected String |
getHeader(File file,
List<String> seqLines)
Get the header for the sequence.
|
List<File> |
getSeqFiles(Collection<File> files)
Return only sequence files for sample IDs found in the metadata file.
If Config ."metadata.required" = "Y", an
error is thrown to list the files that cannot be matched to a metadata row. |
String |
getSummary()
Produce a summary message with counts on total number of reads and number reads multiplexed.
|
protected void |
multiplex(File sample)
Add file sequences to the multiplexed file.
|
void |
runModule()
Execute
multiplex(File) on each input file |
protected void |
validateModuleOrder()
This method ensures that the multiplexed data is not passed to other modules.
This must be the last module, or last module before the Email. |
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
buildScript, buildScriptForPairedReads, getJobParams, getMainScript, getScriptDir, getScriptErrors, getTimeout, getWorkerScriptFunctions
cleanUp, executeTask, getID, getInputFiles, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getTempDir, init, isValidInputModule
protected static final String DO_GZIP
Config
boolean property that if enabled will gzip the multiplexed output: "multiplexer.gzip":public void checkDependencies() throws Exception
Email
)
Config
."internal.multiplexed" = "Y"checkDependencies
in interface BioModule
checkDependencies
in class ScriptModuleImpl
Exception
- thrown if missing or invalid dependencies are foundpublic List<File> getSeqFiles(Collection<File> files) throws Exception
SeqModule
Config
."metadata.required" = "Y", an
error is thrown to list the files that cannot be matched to a metadata row.getSeqFiles
in interface SeqModule
files
- Module input filesException
- if no input files are foundpublic String getSummary() throws Exception
getSummary
in interface BioModule
getSummary
in class ScriptModuleImpl
Exception
- if any error occurspublic void runModule() throws Exception
multiplex(File)
on each input filerunModule
in interface JavaModule
runModule
in class JavaModuleImpl
Exception
- thrown if any runtime error occursprotected String getHeader(File file, List<String> seqLines) throws Exception
file
- Sequence file in fasta or fastq formatseqLines
- Sequence lines for 1 readException
- if errors occur while obtaining headerprotected void multiplex(File sample) throws Exception
sample
- Sequence file in Fasta or Fastq formatException
- if I/O errors occur creating multiplexed file