Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ target/
# Jupyter Notebook
.ipynb_checkpoints

# Test file
wgscovplot.html

# pyenv
.python-version

Expand Down
7 changes: 7 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# History

## 1.0.3 (2026-04-30)

- Update package dependencies
- Fix issue: for KeyError DP when parsing VCF files with no DP INFO field (viral recon moves DP to FORMAT field)
- Fix parsing strand in genbank file with Biopython 1.80 or newer
- Fix issue: handles object or string dtypes across all Python versions and pandas versions in simplify_snpsift function

## 1.0.2 (2024-04-27)

This patch release fixes an issue with not capturing an EmptyDataError when reading VCF files and an issue where Clair3
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ Show help info with `$ wgscovplot --help`:
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

wgscovplot version 0.3.0; Python 3.11.6
wgscovplot version 1.0.3; Python 3.11.15
```

## Dependencies

- [Python](https://www.python.org/) (>=3.9)
- [Python](https://www.python.org/) (>=3.10)
- [BioPython](https://github.com/biopython/biopython/) for all things bioinformatics
- [rich](https://rich.readthedocs.io/) for pretty terminal output
- [typer](https://github.com/tiangolo/typer) for CLI
Expand Down
12 changes: 5 additions & 7 deletions hatch_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class CustomBuildHook(BuildHookInterface):
def initialize(self, version: str, build_data: dict[str, Any]) -> None: # noqa: ARG002
def initialize(self, _version, build_data: dict[str, Any]) -> None:
logger.warning("CustomBuildHook: running 'npm run build' to compile wgscovplot.js")
workdir = Path(self.root, "web")
has_npm = has_software("npm")
Expand All @@ -22,17 +22,15 @@ def initialize(self, version: str, build_data: dict[str, Any]) -> None: # noqa:
"Please install 'npm' or 'bun' and try again."
)
raise RuntimeError(msg)
run(
f"{js_installer} install",
run( # noqa: S603
[js_installer, "install"],
cwd=str(workdir),
check=True,
shell=True, # noqa: S602
)
run(
f"{js_installer} run build",
run( # noqa: S603
[js_installer, "run", "build"],
cwd=str(workdir),
check=True,
shell=True, # noqa: S602
)
build_data["artifacts"].append("web/build/wgscovplot.js")
logger.warning("Done! 'wgscovplot.js' built!")
Expand Down
19 changes: 11 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "wgscovplot"
dynamic = ["version"]
description = "Create interactive comparative sequencing coverage plots from virus sequencing data."
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.10"
license = "Apache-2.0"
keywords = []
authors = [
Expand All @@ -17,9 +17,10 @@ authors = [
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
]
dependencies = [
Expand Down Expand Up @@ -97,24 +98,24 @@ cov = [
]

[[tool.hatch.envs.all.matrix]]
python = ["3.9", "3.10", "3.11"]
python = ["3.10", "3.11", "3.12", "3.13"]

[tool.hatch.envs.lint]
detached = true
dependencies = [
"black>=23.1.0",
"mypy>=1.0.0",
"ruff>=0.0.243",
"ruff>=0.3.0",
]
[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --ignore-missing-imports --non-interactive {args:wgscovplot tests}"
style = [
"ruff {args:.}",
"ruff check {args:.}",
"black --check --diff {args:.}",
]
fmt = [
"black {args:.}",
"ruff --fix {args:.}",
"ruff check --fix {args:.}",
"style",
]
all = [
Expand All @@ -123,12 +124,12 @@ all = [
]

[tool.black]
target-version = ["py311"]
target-version = ["py310"]
line-length = 120
skip-string-normalization = true

[tool.ruff]
target-version = "py311"
target-version = "py310"
line-length = 120
[tool.ruff.lint]
select = [
Expand Down Expand Up @@ -180,6 +181,8 @@ ignore = [
"UP035",
# Ignore "B905 [*] `zip()` without an explicit `strict=` parameter"
"B905",
# Too many positional arguments
"PLR0917",
]
unfixable = [
# Don't touch unused imports
Expand Down
46 changes: 46 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{% set name = "wgscovplot" %}
# You can set the version manually or read it dynamically
{% set version = "1.0.3" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
path: .. # Tells conda-build to use the local repository source files

build:
number: 0
noarch: python # Pure python package (architecture independent)
script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
entry_points:
- wgscovplot = wgscovplot.cli:app

requirements:
host:
- python >=3.10
- pip
- hatchling # Since the project uses hatchling as the build backend
run:
- python >=3.10
- typer
- rich
- pandas
- biopython
- bcbio-gff
- pydantic >=2.0.0
- jinja2
- python-edlib
- pysam

test:
imports:
- wgscovplot
- wgscovplot.tools
commands:
- wgscovplot --help

about:
home: https://github.com/CFIA-NCFAD/wgscovplot
license: Apache-2.0
summary: wgscovplot generates interactive comparative sequencing coverage plots in self-contained, offline-friendly HTML files with optional annotation of variant calling results, PCR amplicon coverage and genetic features.
23 changes: 21 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env python
import contextlib
import os
import shutil
import tempfile
from os.path import exists
from pathlib import Path

Expand All @@ -13,6 +17,21 @@
segmented_virus_data_dir = dirpath / "data/iav"


@contextlib.contextmanager
def isolated_filesystem():
cwd = os.getcwd()
t = tempfile.mkdtemp()
os.chdir(t)
try:
yield t
finally:
os.chdir(cwd)
try:
shutil.rmtree(t)
except OSError:
pass


def test_basic_cli():
result = runner.invoke(app)
assert result.exit_code != 0
Expand All @@ -24,7 +43,7 @@ def test_basic_cli():


def test_cli_non_segment_virus():
with runner.isolated_filesystem():
with isolated_filesystem():
out_html = "wgscovplot_test1.html"
test_result = runner.invoke(
app,
Expand All @@ -39,7 +58,7 @@ def test_cli_non_segment_virus():


def test_cli_segment_virus():
with runner.isolated_filesystem():
with isolated_filesystem():
out_html = "wgscovplot_test_segment_virus.html"
test_result = runner.invoke(
app, [str(segmented_virus_data_dir.resolve().absolute()), "--output-html", out_html]
Expand Down
Loading
Loading