Skip to content

Commit

Permalink
Merge pull request #90 from rki-mf1/feat/skip-qc
Browse files Browse the repository at this point in the history
Add --skip_qc to allow skipping fastqc/nanoplot/multiqc
  • Loading branch information
matthuska authored May 17, 2024
2 parents cc8a847 + 3426550 commit 34a91a5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
11 changes: 7 additions & 4 deletions clean.nf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Author: [email protected]

// Parameters sanity checking

Set valid_params = ['max_cores', 'cores', 'max_memory', 'memory', 'profile', 'help', 'input', 'input_type', 'list', 'host', 'own', 'control', 'keep', 'rm_rrna', 'bbduk', 'bbduk_kmer', 'bbduk_qin', 'reads_rna', 'min_clip', 'dcs_strict', 'output', 'multiqc_dir', 'nf_runinfo_dir', 'databases', 'cleanup_work_dir','condaCacheDir', 'singularityCacheDir', 'singularityCacheDir', 'cloudProcess', 'conda-cache-dir', 'singularity-cache-dir', 'cloud-process', 'publish_dir_mode', 'no_intermediate'] // don't ask me why there is also 'conda-cache-dir', 'singularity-cache-dir', 'cloud-process'
Set valid_params = ['max_cores', 'cores', 'max_memory', 'memory', 'profile', 'help', 'input', 'input_type', 'list', 'host', 'own', 'control', 'keep', 'rm_rrna', 'bbduk', 'bbduk_kmer', 'bbduk_qin', 'reads_rna', 'min_clip', 'dcs_strict', 'output', 'multiqc_dir', 'nf_runinfo_dir', 'databases', 'cleanup_work_dir','condaCacheDir', 'singularityCacheDir', 'singularityCacheDir', 'cloudProcess', 'conda-cache-dir', 'singularity-cache-dir', 'cloud-process', 'publish_dir_mode', 'no_intermediate', 'skip_qc'] // don't ask me why there is also 'conda-cache-dir', 'singularity-cache-dir', 'cloud-process'
def parameter_diff = params.keySet() - valid_params
if (parameter_diff.size() != 0){
exit 1, "ERROR: Parameter(s) $parameter_diff is/are not valid in the pipeline!\n"
Expand Down Expand Up @@ -210,7 +210,9 @@ workflow {

}

qc(input_ch.map{ it -> tuple(it[0], 'input', it[1]) }.mix(clean.out.out_reads), params.input_type, clean.out.bbduk_summary, clean.out.idxstats, clean.out.flagstats, multiqc_config)
if (!params.skip_qc) {
qc(input_ch.map{ it -> tuple(it[0], 'input', it[1]) }.mix(clean.out.out_reads), params.input_type, clean.out.bbduk_summary, clean.out.idxstats, clean.out.flagstats, multiqc_config)
}
}

/**************************
Expand Down Expand Up @@ -265,8 +267,8 @@ def helpMSG() {
- eno [ONT RNA-Seq: a positive control (yeast ENO2 Enolase II of strain S288C, YHR174W)]${c_reset}
${c_green}--own ${c_reset} Use your own FASTA sequences (comma separated list of files) for decontamination, e.g. host.fasta.gz,spike.fasta [default: $params.own]
${c_green}--keep ${c_reset} Use your own FASTA sequences (comma separated list of files) to explicitly keep mapped reads, e.g. target.fasta.gz,important.fasta [default: $params.keep]
Reads are assigned to a combined index for decontamination and keeping. The use of this parameter can prevent
false positive hits and the accidental removal of reads due to (poor quality) mappings.
Reads are assigned to a combined index for decontamination and keeping. The use of this parameter can prevent
false positive hits and the accidental removal of reads due to (poor quality) mappings.
${c_green}--rm_rrna ${c_reset} Clean your data from rRNA [default: $params.rm_rrna]
${c_green}--bbduk${c_reset} Add this flag to use bbduk instead of minimap2 for decontamination of short reads [default: $params.bbduk]
${c_green}--bbduk_kmer${c_reset} Set kmer for bbduk [default: $params.bbduk_kmer]
Expand All @@ -275,6 +277,7 @@ def helpMSG() {
${c_green}--min_clip${c_reset} Filter mapped reads by soft-clipped length (left + right). If >= 1 total number; if < 1 relative to read length
${c_green}--dcs_strict${c_reset} Filter out alignments that cover artificial ends of the ONT DCS to discriminate between Lambda Phage and DCS
${c_green}--skip_qc${c_reset} Skip quality control steps (fastqc, nanoplot, multiqc, etc.) [default: $params.skip_qc]
${c_yellow}Compute options:${c_reset}
--cores Max cores per process for local use [default $params.cores]
Expand Down
25 changes: 13 additions & 12 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ params {
reads_rna = false
min_clip = ''
dcs_strict = false
skip_qc = false

// folder structure
output = 'results'
multiqc_dir = 'qc'
nf_runinfo_dir = 'logs'

// location for storing the conda or singularity environments
condaCacheDir = 'conda'
singularityCacheDir = 'singularity'
Expand Down Expand Up @@ -81,7 +82,7 @@ profiles {
executor {
name = "lsf"
queueSize = 200
}
}
params.cloudProcess = true
process.cache = "lenient"
includeConfig 'configs/node.config'
Expand All @@ -91,21 +92,21 @@ profiles {
executor {
name = "slurm"
queueSize = 200
}
}
params.cloudProcess = true
process.cache = "lenient"
includeConfig 'configs/node.config'
}


// engines
docker {
docker {
docker { enabled = true }
includeConfig 'configs/container.config'
}

singularity {
singularity {
singularity {
enabled = true
autoMounts = true
cacheDir = params.singularityCacheDir
Expand All @@ -114,7 +115,7 @@ profiles {
includeConfig 'configs/container.config'
}

mamba {
mamba {
conda {
enabled = true
cacheDir = params.condaCacheDir
Expand All @@ -123,7 +124,7 @@ profiles {
includeConfig 'configs/conda.config'
}

conda {
conda {
conda {
enabled = true
cacheDir = params.condaCacheDir
Expand All @@ -147,17 +148,17 @@ profiles {
}

// CONFIGURE YOUR PRIVATE CLOUD
gcloud {
gcloud {
params.databases = 'gs://databases-matrice/databases/'
bucketDir = 'gs://matrice/nextflow-tmp/clean'
//workDir = "/tmp/nextflow-work-$USER"

executor { name = 'google-lifesciences' }

google {
project = 'nextflow-auto-255816'
zone = 'europe-west1-b'
}
zone = 'europe-west1-b'
}

params.cloudProcess = true
includeConfig 'configs/node.config'
Expand All @@ -169,7 +170,7 @@ profiles {

// we need a docker also for basic functionalities in the cloud
process {
withLabel: noDocker { cpus = 1; memory = '4.0 GB'; container = 'nanozoo/template:3.8--ccd0653' }
withLabel: noDocker { cpus = 1; memory = '4.0 GB'; container = 'nanozoo/template:3.8--ccd0653' }
}
}
}

0 comments on commit 34a91a5

Please sign in to comment.