public class TrimPrimers extends JavaModuleImpl implements SeqModule
Modifier and Type | Field and Description |
---|---|
protected static String |
INPUT_REQUIRE_PRIMER
Config property "trimPrimers.requirePrimer" is a boolean used to determine if sequences
without a primer should be kept or discarded |
static String |
NUM_TRIMMED_READS
Metadata column name for column that holds number of trimmed reads per sample: "Num_Trimmed_Reads"
|
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 |
---|
TrimPrimers() |
Modifier and Type | Method and Description |
---|---|
protected void |
addBadFilesToSummary()
Update summaryMsgs with list of seq files that contained no reads with a valid primer.
|
void |
checkDependencies()
Validates the file that defines the REGEX primers.
|
void |
cleanUp()
Set "Num_Trimmed_Reads" as the number of reads field.
|
protected Set<String> |
getPrimers()
Get the primers listed in the "trimPrimers.filePath".
|
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. |
static File |
getSeqPrimerFile()
Return the primer file.
|
String |
getSummary()
Output the summary messages generated by the module.
|
void |
runModule()
Trims primers from fasta or fastq files.
|
buildScript, executeTask, getSource, getWorkerScriptFunctions, isValidInputModule, markStatus, moduleComplete, moduleFailed
buildScriptForPairedReads, getJobParams, getMainScript, getRuntimeParams, getScriptDir, getScriptErrors, getTimeout, hasScripts
cacheInputFiles, 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
executeTask, getID, getInputFiles, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getTempDir, init, isValidInputModule
public static final String NUM_TRIMMED_READS
protected static final String INPUT_REQUIRE_PRIMER
Config
property "trimPrimers.requirePrimer" is a boolean used to determine if sequences
without a primer should be kept or discardedpublic void checkDependencies() throws Exception
Demultiplexer
must run as a prerequisite module
PearMergeReads
is configured before this
module, "trimPrimers.filePath" must contain the reverse compliment of the reverse primer
with a REGEX line anchor "$" at the end.
checkDependencies
in interface BioModule
checkDependencies
in class ScriptModuleImpl
Exception
- thrown if missing or invalid dependencies are foundpublic void cleanUp() throws Exception
cleanUp
in interface BioModule
cleanUp
in class BioModuleImpl
Exception
- thrown if any runtime error occurspublic 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
runModule
in interface JavaModule
runModule
in class JavaModuleImpl
Exception
- thrown if any runtime error occursprotected void addBadFilesToSummary()
protected Set<String> getPrimers() throws Exception
Exception
- if unable to read the file