public class RarefySeqs extends JavaModuleImpl implements SeqModule, ApiModule
Modifier and Type | Field and Description |
---|---|
protected static String |
INPUT_RAREFYING_MAX
Config property "rarefySeqs.max" defines the maximum number of reads per file |
protected static String |
INPUT_RAREFYING_MIN
Config property "rarefySeqs.min" defines the minimum number of reads per file |
static String |
NUM_RAREFIED_READS
Metadata column name for column that holds number of rarefied reads per sample: "Num_Rarefied_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 |
---|
RarefySeqs() |
Modifier and Type | Method and Description |
---|---|
protected void |
buildRarefiedFile(File input,
List<Long> indexes)
Build the rarefied file for the input file, keeping only the given indexes
|
void |
checkDependencies()
Validate module dependencies
Validate
Config .INPUT_RAREFYING_MIN is a non-negative integer
Validate Config .INPUT_RAREFYING_MAX is a positive integer that is greater than or
equal to Config .INPUT_RAREFYING_MIN (if defined)
|
void |
cleanUp()
Set "Num_Rarefied_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.
|
String |
getDetails()
A extension of
getDescription . |
List<String> |
getPreRequisiteModules()
This method always requires a prerequisite module with a "number of reads" count such as:
RegisterNumReads . |
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 summary message with min, max, mean, and median number of reads.
|
protected void |
rarefy(File seqFile)
Builds the rarefied file if too many seqs found, or adds files with too few samples to the list of bad samples.
|
void |
runModule()
For each file with number reads outside of
Config .INPUT_RAREFYING_MIN and
Config .INPUT_RAREFYING_MAX values, generate a new sequence file from a shuffled list of
its sequences. |
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, getFileCache, getID, getInputFiles, getLogDir, getMenuPlacement, getMetadata, getModuleDir, getOutputDir, getPostRequisiteModules, 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, getPropDefault, getResourceDir, getTempDir, init, isValidInputModule, setAlias, version
getDescription, getMenuPlacement, getPropType, getTitle, isValidProp, listProps
public static final String NUM_RAREFIED_READS
protected static final String INPUT_RAREFYING_MAX
Config
property "rarefySeqs.max" defines the maximum number of reads per fileprotected static final String INPUT_RAREFYING_MIN
Config
property "rarefySeqs.min" defines the minimum number of reads per filepublic void checkDependencies() throws Exception
Config
.INPUT_RAREFYING_MIN
is a non-negative integer
Config
.INPUT_RAREFYING_MAX
is a positive integer that is greater than or
equal to Config
.INPUT_RAREFYING_MIN
(if defined)
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<String> getPreRequisiteModules() throws Exception
RegisterNumReads
. If paired reads found, also return a 2nd module:
PearMergeReads
.getPreRequisiteModules
in interface BioModule
getPreRequisiteModules
in class BioModuleImpl
Exception
- if invalid Class names are returned as prerequisitespublic 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
Config
.INPUT_RAREFYING_MIN
and
Config
.INPUT_RAREFYING_MAX
values, generate a new sequence file from a shuffled list of
its sequences.runModule
in interface JavaModule
runModule
in class JavaModuleImpl
Exception
- thrown if any runtime error occursprotected void buildRarefiedFile(File input, List<Long> indexes) throws Exception
input
- Sequence fileindexes
- List of indexes to keepException
- if unable to build rarefied fileprotected void rarefy(File seqFile) throws Exception
seqFile
- Sequence file to rarefyException
- if processing errors occurpublic String getDescription()
ApiModule
getDetails
.getDescription
in interface ApiModule
public String getDetails()
ApiModule
getDescription
. Beyond the brief description, give details such as
the interaction between properties.getDetails
in interface ApiModule
getDetails
in class BioModuleImpl
public String getCitationString()
ApiModule
getCitationString
in interface ApiModule