Skip to content

Commit

Permalink
constrain {chart} wildcard in format_altair (#94)
Browse files Browse the repository at this point in the history
* constrain `{chart}` wildcard in `format_altair`

This fixes a Periodic WildCard Error that could sometimes arise from wildcards
that recursively contained _nolegend, see #171

* fix linting of notebooks in test

* format w latest version of `snakefmt`
  • Loading branch information
jbloom authored Jan 10, 2024
1 parent 09ae51b commit 8b7ad8e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,12 @@ jobs:
auto-update-conda: true
channel-priority: strict

- name: lint code with ruff
- name: lint with ruff
# NOTE: must specify the shell so that conda init updates bashrc see:
# https://github.com/conda-incubator/setup-miniconda#IMPORTANT
shell: bash -el {0}
run: ruff check .

- name: lint Jupyter notebooks with ruff
shell: bash -el {0}
run: nbqa ruff .

- name: check code format with black
shell: bash -el {0}
run: black --check .
Expand Down Expand Up @@ -65,7 +61,6 @@ jobs:

- name: run pipeline with prebuilt variants
shell: bash -el {0}
# run: rm -rf docs && cd test_example && rm -rf results && snakemake --use-conda -j 2 --config prebuilt_variants=https://raw.githubusercontent.com/dms-vep/dms-vep-pipeline/main/test_example/results/variants/codon_variants.csv prebuilt_geneseq=https://raw.githubusercontent.com/dms-vep/dms-vep-pipeline/main/test_example/results/gene_sequence/codon.fasta prebuilt_muteffects=https://raw.githubusercontent.com/dms-vep/dms-vep-pipeline/main/test_example/results/muteffects_functional/muteffects_observed.csv && cd ..
run: >
rm -rf docs
&& cd test_example
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

#### version 3.5.5
- Fix `PeriodicWildCardError` that was raised by `snakemake` for the `_nolegend` output HTML plots for certain wildcards.
- Fix how notebook linting done with `ruff` in tests.

#### version 3.5.4
- Fix bug in reporting pre-selection counts cutoff in `func_scores`. See [this issue](https://github.com/dms-vep/dms-vep-pipeline-3/issues/87). The cutoff was applied correctly before and that has not changed, this just fixes reporting of it in plots in `analyze_func_scores`.

Expand Down
2 changes: 2 additions & 0 deletions common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ include: "common_funcs.smk"

rule format_altair_html:
"""Format ``altair`` charts by adding title, legend, etc."""
wildcard_constraints:
chart="((?!nolegend).)*", # do not match, https://stackoverflow.com/a/6259570
input:
html="results/{chart}_nolegend.html",
pyscript=os.path.join(config["pipeline_path"], "scripts/format_altair_html.py"),
Expand Down
1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ dependencies:
- matplotlib=3.8
- minimap2=2.26
- nbstripout
- nbqa
- openpyxl
- pandas=2.0
- papermill=2.4
Expand Down
2 changes: 1 addition & 1 deletion func_effects.smk
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ rule func_effects_global_epistasis:
global_epistasis_params_yaml=lambda wc: yaml.round_trip_dump(
{
"global_epistasis_params": func_scores[wc.selection][
"global_epistasis_params"
"global_epistasis_params"
],
}
),
Expand Down

0 comments on commit 8b7ad8e

Please sign in to comment.