Skip to content

Commit

Permalink
Update paramsValidator for FASTQ split
Browse files Browse the repository at this point in the history
  • Loading branch information
lina-kim committed May 24, 2024
1 parent a36e7b1 commit 9aa412e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/readme_docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Required if running Cutadapt:
## Optional user-input parameters

Used for initial FASTQ processing in scope `params.fastq_split`:
* `enabled`: default `null`, determines whether samples will be processed as a batch or individually; either `"True"` or `"False"`
* `enabled`: default `true`, determines whether samples will be processed as a batch or individually; either `true` or `false`
* `method`: default `"sample"`, represents method by which to split input FASTQ file manifest; either `"sample"` or an integer representing the number of split artifacts for processing
* `suffix`: default `"_split.tsv"`, suffix for split FASTQ manifest files used as intermediates

Expand Down
7 changes: 7 additions & 0 deletions lib/paramsValidator.nf
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@ def validateParams(params) {
assertParam(params.fastqc_release, [String], null, "fastqc_release must be a String")
assertParam(params.multiqc_container, [String], null, "multiqc_container must be a String")

/////////////////////////////////////////////////
// Validation for pre-denoise split parameters //
/////////////////////////////////////////////////
def fastq_split = params.fastq_split
assertParam(fastq_split.enabled, [Boolean], [true, false], "fastq_split.enabled must be true or false")
assertParam(fastq_split.suffix, [String], null, "fastq_split.suffix must be a String")
assertParam(fastq_split.method, [Integer, String], [{ it instanceof Integer && it > 0 }, "sample"], "fastq_split.method must be 1) an integer greater than 0, representing the number of split artifacts to create; or 2) the string 'sample', representing individual artifacts per sample pre-denoising.")
}

def validateTsvFile(filePath) {
Expand Down
2 changes: 1 addition & 1 deletion workflows/download.nf
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ workflow DOWNLOAD {
if (params.generate_input) {
ch_inp_ids = Channel.fromPath ( "${params.inp_id_file}", checkIfExists: true )
.map { [0, it] }
if (params.fastq_split.enabled == "True") {
if (params.fastq_split.enabled) {
SPLIT_FASTQ_MANIFEST ( ch_inp_ids )
manifest_suffix = ~/${params.fastq_split.suffix}/
ch_acc_ids = SPLIT_FASTQ_MANIFEST.out
Expand Down
2 changes: 1 addition & 1 deletion workflows/import.nf
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ workflow IMPORT {
.map { [0, it] }

// Use local FASTQ files
if (params.fastq_split.enabled == "True") {
if (params.fastq_split.enabled) {
SPLIT_FASTQ_MANIFEST ( ch_fastq_manifest )
manifest_suffix = ~/${params.fastq_split.suffix}/
ch_acc_ids = SPLIT_FASTQ_MANIFEST.out
Expand Down

0 comments on commit 9aa412e

Please sign in to comment.