Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix wfmash_sparse_map parameter #152

Merged
merged 9 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,29 @@ jobs:
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results ${{ matrix.parameters }}

wfmash_sparse_map:
name: Run pipeline with wfmash_sparse_map parameters
# Only run on push if this is the nf-core dev branch (merged PRs)
if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/pangenome') }}"
runs-on: ubuntu-latest
strategy:
matrix:
parameters:
- "--wfmash_sparse_map auto"
- "--wfmash_sparse_map 0.5"
steps:
- name: Check out pipeline code
uses: actions/checkout@v3

- name: Install Nextflow
uses: nf-core/setup-nextflow@v1
with:
version: "23.04.0"

- name: Run pipeline with test data and wfmash_only parameters
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results ${{ matrix.parameters }}

communities:
name: Run pipeline with community parameters
# Only run on push if this is the nf-core dev branch (merged PRs)
Expand Down
8 changes: 4 additions & 4 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ def generate_wfmash_sparse_map_cmd() {
def wfmash_sparse_map_cmd = ""
if (params.wfmash_sparse_map == "auto") {
def n = params.n_haplotypes
def x = Math.log(n)/n * 10
wfmash_sparse_map_frac = 1
if (x < 1) {
def wfmash_sparse_map_frac = x
def x = Math.log(n)/n * 10.0
wfmash_sparse_map_frac = 1.0
if (x < 1.0) {
wfmash_sparse_map_frac = x
}
wfmash_sparse_map_cmd = "-x ${wfmash_sparse_map_frac}"
} else {
Expand Down
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ params {

// Schema validation default options
validationFailUnrecognisedParams = false
validationLenientMode = false
validationLenientMode = true
validationSchemaIgnoreParams = 'genomes'
validationShowHiddenParams = false
validate_params = true
Expand Down
19 changes: 6 additions & 13 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"properties": {
"wfmash_map_pct_id": {
"type": "number",
"default": 90,
"default": 90.0,
"description": "Percent identity in the wfmash mashmap step.",
"help_text": "Use `mash dist` or `mash triangle` to explore the typical level of divergence between the sequences in your input (see https://pggb.readthedocs.io/en/latest/rst/tutorials/divergence_estimation.html#divergence-estimation for more information). Convert this to an approximate percent identity and provide it as --wfmash_map_pct_id <PCT>. A list of examples can be found at https://github.com/pangenome/pggb#example-builds-for-diverse-species."
},
Expand All @@ -81,9 +81,10 @@
"description": "Ignore the top % most-frequent kmers."
},
"wfmash_sparse_map": {
"type": "number",
"default": "1.0",
"description": "Keep this fraction of mappings (\"auto\" for giant component heuristic)."
"default": 1.0,
"description": "Keep this fraction of mappings (\"auto\" for giant component heuristic).",
"type": "string",
"pattern": "(auto|[01]\\.\\d+)"
},
"wfmash_merge_segments": {
"type": "boolean",
Expand Down Expand Up @@ -136,7 +137,7 @@
},
"seqwish_sparse_factor": {
"type": "number",
"default": 0,
"default": 0.0,
"description": "Keep this randomly selected fraction of input matches."
},
"seqwish_temp_dir": {
Expand Down Expand Up @@ -360,14 +361,12 @@
"type": "boolean",
"description": "Display help text.",
"fa_icon": "fas fa-question-circle",
"default": false,
"hidden": true
},
"version": {
"type": "boolean",
"description": "Display version and exit.",
"fa_icon": "fas fa-question-circle",
"default": false,
"hidden": true
},
"publish_dir_mode": {
Expand All @@ -391,7 +390,6 @@
"type": "boolean",
"description": "Send plain-text email instead of HTML.",
"fa_icon": "fas fa-remove-format",
"default": false,
"hidden": true
},
"max_multiqc_email_size": {
Expand All @@ -406,7 +404,6 @@
"type": "boolean",
"description": "Do not use coloured log outputs.",
"fa_icon": "fas fa-palette",
"default": false,
"hidden": true
},
"hook_url": {
Expand Down Expand Up @@ -445,31 +442,27 @@
"type": "boolean",
"fa_icon": "far fa-eye-slash",
"description": "Show all params when using `--help`",
"default": false,
"hidden": true,
"help_text": "By default, parameters set as _hidden_ in the schema are not shown on the command line when a user runs with `--help`. Specifying this option will tell the pipeline to show all parameters."
},
"validationFailUnrecognisedParams": {
"type": "boolean",
"fa_icon": "far fa-check-circle",
"description": "Validation of parameters fails when an unrecognised parameter is found.",
"default": false,
"hidden": true,
"help_text": "By default, when an unrecognised parameter is found, it returns a warinig."
},
"validationLenientMode": {
"type": "boolean",
"fa_icon": "far fa-check-circle",
"description": "Validation of parameters in lenient more.",
"default": false,
"hidden": true,
"help_text": "Allows string values that are parseable as numbers or booleans. For further information see [JSONSchema docs](https://github.com/everit-org/json-schema#lenient-mode)."
},
"show_hidden_params": {
"type": "boolean",
"fa_icon": "far fa-check-circle",
"description": "Do we want to display hidden parameters?",
"default": false,
"hidden": true,
"help_text": "Do we want to display hidden parameters?"
},
Expand Down