public class TrimPrimers extends JavaModuleImpl implements SeqModule, ApiModule, ReadCounter
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 |
INPUT_TRIM_SEQ_FILE
Config property "trimPrimers.filePath" defines the file path to the file that defines the
primers as regular expressions. |
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
LOG_DIR, MAIN_SCRIPT_PREFIX, NO_VERSION, OUTPUT_DIR, RES_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.
|
String |
getCitationString()
At a minimum, this should return the name and/or url for the wrapped tool.
|
String |
getDescription()
Briefly describe what this module does.
|
protected Set<String> |
getPrimers()
Get the primers listed in the .
|
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()
Output the summary messages generated by the module.
|
void |
runModule()
Trims primers from fasta or fastq files.
|
buildScript, executeTask, getDockerImageName, getDockerImageOwner, getDockerImageTag, getWorkerScriptFunctions, isValidInputModule, markStatus, moduleComplete, moduleFailed, runBioLockJ_CMD
buildScriptForPairedReads, getJobParams, getMainScript, getRuntimeParams, getScriptDir, getScriptErrors, getTimeout, hasScripts, isValidProp
addGeneralProperty, addGeneralProperty, addGeneralProperty, addNewProperty, addNewProperty, cacheInputFiles, 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, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
buildScript, buildScriptForPairedReads, getJobParams, getMainScript, getScriptDir, getScriptErrors, getTimeout, getWorkerScriptFunctions
executeTask, getAlias, getDockerImageName, getDockerImageOwner, getDockerImageTag, getID, getInputFiles, getLogDir, getMetadata, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getPropDefault, getResourceDir, getTempDir, init, isValidInputModule, setAlias, version
getDescription, getDetails, getMenuPlacement, getPropType, getTitle, isValidProp, listProps
public static final String NUM_TRIMMED_READS
public static final String INPUT_TRIM_SEQ_FILE
Config
property "trimPrimers.filePath" defines the file path to the file that defines the
primers as regular expressions.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 SequnceFormatException
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 filesSequnceFormatException
- If Config
."metadata.required" =
"Y" but sequence files found that do not have a corresponding record in the metadata
file or if invalid metadata prevents parsing SEQ files.public 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 filepublic String getDescription()
ApiModule
getDetails
.getDescription
in interface ApiModule
public String getCitationString()
ApiModule
getCitationString
in interface ApiModule