From 7f0c9836ec0e25c8324ffd16540cb1ed5da6070a Mon Sep 17 00:00:00 2001 From: Rob Syme Date: Fri, 13 Dec 2024 17:29:27 -0500 Subject: [PATCH 1/4] Provide users the ability to not bump stack size. Not all environments have permissions to set an unlimited stack size. Particularly for smaller samples, this provides the ability to not set an unlimited stack size. --- modules/local/filter_clusters.nf | 3 ++- nextflow.config | 1 + nextflow_schema.json | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/local/filter_clusters.nf b/modules/local/filter_clusters.nf index 5c0dd20b..5f64a03b 100644 --- a/modules/local/filter_clusters.nf +++ b/modules/local/filter_clusters.nf @@ -23,8 +23,9 @@ process FILTER_CLUSTERS { script: def prefix = task.ext.prefix ?: "'$meta.id'" def clusters = "'$clusters'" + def ulimiter = params.raise_filter_stacksize ? "ulimit -s unlimited" : "" """ - ulimit -s unlimited + ${ulimiter} echo ${clusters} | filt_clusters.py -t ${asv} -p ${prefix} -c - cat <<-END_VERSIONS > versions.yml diff --git a/nextflow.config b/nextflow.config index 64af5e64..595b7ec0 100644 --- a/nextflow.config +++ b/nextflow.config @@ -82,6 +82,7 @@ params { ancombc_significance = 0.05 ancombc_formula = null ancombc_formula_reflvl = null + raise_filter_stacksize = true // Report options report_template = "${projectDir}/assets/report_template.Rmd" diff --git a/nextflow_schema.json b/nextflow_schema.json index 10788090..07426d52 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -591,6 +591,13 @@ "default": 1, "description": "Prevalence filtering", "help_text": "Filtering low prevalent features from the feature table, e.g. keeping only features that are present in at least two samples can be achived by choosing a value of 2 (default: 1, meaning filter is disabled). Typically only used when having replicates for all samples.\n\nFor example to retain features that are present in at least two sample:\n\n```bash\n--min_samples 2\n```\n\nPlease note this is independent of abundance." + }, + "raise_filter_stacksize": { + "type": "boolean", + "default": true, + "fa_icon": "fas fa-angle-double-up", + "description": "Raise stack size when filtering VSEARCH clusters", + "help_text": "Setting to true adds 'ulimit -s unlimited' to the beginning of the filt_clusters.py command." } } }, From 537d949a078c2ebcac9b76e23e31b1f13a80c5fa Mon Sep 17 00:00:00 2001 From: Rob Syme Date: Tue, 17 Dec 2024 17:22:43 -0500 Subject: [PATCH 2/4] Move ulimit parameter in schema. --- nextflow_schema.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nextflow_schema.json b/nextflow_schema.json index 07426d52..fda16947 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -288,6 +288,13 @@ "description": "Pairwise Identity value used when post-clustering ASVs if `--vsearch_cluster` option is used (default: 0.97).", "help_text": "Lowering or increasing this value can change the number ASVs left over after clustering." }, + "raise_filter_stacksize": { + "type": "boolean", + "default": true, + "fa_icon": "fas fa-angle-double-up", + "description": "Raise stack size when filtering VSEARCH clusters", + "help_text": "Setting to true adds 'ulimit -s unlimited' to the beginning of the filt_clusters.py command." + }, "filter_ssu": { "type": "string", "description": "Enable SSU filtering. Comma separated list of kingdoms (domains) in Barrnap, a combination (or one) of \"bac\", \"arc\", \"mito\", and \"euk\". ASVs that have their lowest evalue in that kingdoms are kept.", @@ -591,13 +598,6 @@ "default": 1, "description": "Prevalence filtering", "help_text": "Filtering low prevalent features from the feature table, e.g. keeping only features that are present in at least two samples can be achived by choosing a value of 2 (default: 1, meaning filter is disabled). Typically only used when having replicates for all samples.\n\nFor example to retain features that are present in at least two sample:\n\n```bash\n--min_samples 2\n```\n\nPlease note this is independent of abundance." - }, - "raise_filter_stacksize": { - "type": "boolean", - "default": true, - "fa_icon": "fas fa-angle-double-up", - "description": "Raise stack size when filtering VSEARCH clusters", - "help_text": "Setting to true adds 'ulimit -s unlimited' to the beginning of the filt_clusters.py command." } } }, From 61811d65c0e73dac1f9d5e9e61d71315497a60db Mon Sep 17 00:00:00 2001 From: Rob Syme Date: Tue, 17 Dec 2024 17:23:44 -0500 Subject: [PATCH 3/4] Changelog summary --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3d0fb80..875812eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#804](https://github.com/nf-core/ampliseq/pull/804) - Added version 10 of Unite as parameter for `--dada_ref_taxonomy` (issue [#768](https://github.com/nf-core/ampliseq/issues/768)) ### `Changed` +- [#818](https://github.com/nf-core/ampliseq/pull/818) - Provide users the ability to not bump stack size in vsearch clustering. ### `Fixed` From 0c48fdebe5f956838d790600dc11386d6b5e0209 Mon Sep 17 00:00:00 2001 From: nf-core-bot Date: Wed, 18 Dec 2024 07:41:29 +0000 Subject: [PATCH 4/4] [automated] Fix code linting --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 875812eb..ba8a6a02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#804](https://github.com/nf-core/ampliseq/pull/804) - Added version 10 of Unite as parameter for `--dada_ref_taxonomy` (issue [#768](https://github.com/nf-core/ampliseq/issues/768)) ### `Changed` + - [#818](https://github.com/nf-core/ampliseq/pull/818) - Provide users the ability to not bump stack size in vsearch clustering. ### `Fixed`