From 798d2c9277b62e472dfe49dfc0f2d3ebe1c4be65 Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Tue, 25 Nov 2025 13:10:03 +0000 Subject: [PATCH 01/28] Edit homepage and description --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 64dc786..920698d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ maintainers = [ {name = "Sam Ebdon", email = "se13@sanger.ac.uk"}, ] -description = "Smudgeplot description" +description = "Inference of ploidy and heterozygosity structure using whole genome sequencing data." readme = "README.md" license = "Apache-2.0" license-files = ["LICENSE.md"] @@ -35,7 +35,7 @@ classifiers = [ ] [project.urls] -Homepage = "https://github.com/KamilSJaron/smudgeplot/tree/sploidyplot_obj" +Homepage = "https://github.com/KamilSJaron/smudgeplot" Issues = "https://github.com/KamilSJaron/smudgeplot/issues" [project.scripts] From 9089335f603814b3c2fa3339b155d8c5c3018e08 Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Mon, 1 Dec 2025 14:48:28 +0000 Subject: [PATCH 02/28] Update README.md --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 10bd1d0..2a42c9d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Smudgeplot -**_Version: 0.5.1 Skylight_** +**_Version: 0.5.2b Skylight_** **_Authors: Sam Ebdon, [Gene W Myers](https://github.com/thegenemyers) and [Kamil S. Jaron](https://github.com/KamilSJaron), Tianyi Ma._** @@ -19,7 +19,10 @@ We recommend installing smudgeplot within a [conda](https://conda-forge.org/down conda create -n smudgeplot && conda activate smudgeplot conda install pip -#download and install +# install via pypi +pip install smudgeplot + +# or download and install directly. See below if you need to compile the C dependencies. git clone https://github.com/KamilSJaron/smudgeplot.git cd smudgeplot && pip install . smudgeplot -h # check installation succeeded @@ -31,10 +34,10 @@ Note the smudgeplot version downloadable from conda itself is not currently up t ### Compiling the C code -The process above install everything including compilation of the C backend. If you would like to know how to compile the code yourself you can simply run +The process above should install everything including compilation of the C backend. If you need or would like to know how to compile the code yourself you can simply run ``` -make +mkdir exec && make ``` This will not, however, install the smudgeplot python package. From 5e5b4b953a3924dc61c972e3ffe252d295524e83 Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Mon, 1 Dec 2025 14:49:42 +0000 Subject: [PATCH 03/28] Update pyproject.toml --- pyproject.toml | 92 +++++++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 920698d..3907332 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,41 +1,53 @@ [build-system] -requires = ["setuptools>=61.0"] +requires = ["setuptools>=61.0", "wheel"] build-backend = "setuptools.build_meta" [project] name = "smudgeplot" -version = "0.5.1" -dependencies = [ - "numpy >= 2.2.3", - "matplotlib >= 3.10.0", - "pandas >= 2.2.3" -] +version = "0.5.2b" +description = "Inference of ploidy and heterozygosity structure using whole genome sequencing data" +readme = "README.md" +license = "Apache-2.0" +license-files = ["LICENSE.md"] +keywords = ["smudgeplot", "kmer", "ploidy", "genomics", "bioinformatics"] + +# Relaxed Python version - works with 3.9+ +requires-python = ">=3.9" -requires-python = ">=3.11.11" authors = [ {name = "Kamil S. Jaron", email = "kj11@sanger.ac.uk"}, {name = "Sam Ebdon", email = "se13@sanger.ac.uk"}, ] -# add authors maintainers = [ {name = "Kamil Jaron", email = "kj11@sanger.ac.uk"}, {name = "Sam Ebdon", email = "se13@sanger.ac.uk"}, ] -description = "Inference of ploidy and heterozygosity structure using whole genome sequencing data." -readme = "README.md" -license = "Apache-2.0" -license-files = ["LICENSE.md"] -keywords = ["smudgeplot","kmer","ploidy"] +# Relaxed dependency versions for broader compatibility +dependencies = [ + "numpy>=1.20.0", + "matplotlib>=3.4.0", + "pandas>=1.3.0", +] classifiers = [ - "Development Status :: 3 - Alpha", - "Programming Language :: Python :: 3" + "Development Status :: 4 - Beta", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Operating System :: POSIX :: Linux", + "Operating System :: MacOS", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering :: Bio-Informatics", ] [project.urls] Homepage = "https://github.com/KamilSJaron/smudgeplot" +Documentation = "https://github.com/KamilSJaron/smudgeplot#readme" +Repository = "https://github.com/KamilSJaron/smudgeplot" Issues = "https://github.com/KamilSJaron/smudgeplot/issues" [project.scripts] @@ -43,38 +55,26 @@ smudgeplot = "smudgeplot.cli:main" [tool.setuptools] package-dir = {"" = "src"} +include-package-data = true [tool.setuptools.packages.find] where = ["src"] -[tool.ruff] -line-length = 120 +[tool.setuptools.package-data] +smudgeplot = ["bin/*"] -[tool.ruff.lint] -select = [ - "A", - "ARG", - "B", - "BLE", - "C4", - "COM", - "DTZ", - "E", - "EM", - "F", - "I", - "ISC", - "LOG", - "N", - "PYI", - "S", - "SIM", - "U", -] -ignore = [ - "COM812", - "C901", - "LOG015", - "N803", - "N806", -] +[tool.cibuildwheel] +# Skip 32-bit, PyPy, musllinux, and Windows (no Windows support for now) +skip = ["*-win32", "*-win_amd64", "*-manylinux_i686", "pp*", "*-musllinux*"] +build = ["cp39-*", "cp310-*", "cp311-*", "cp312-*"] + +# Test that the CLI works after building +test-command = "smudgeplot --version" + +[tool.cibuildwheel.linux] +# manylinux has gcc available +before-all = "yum install -y gcc || apt-get update && apt-get install -y gcc || true" + +[tool.cibuildwheel.macos] +# macOS runners have clang available by default +# Nothing special needed From f27220335ea06dc66ef1df4f39d12508820c2cfa Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Tue, 2 Dec 2025 15:44:55 +0000 Subject: [PATCH 04/28] Create build_pip.yml --- .github/workflows/build_pip.yml | 57 +++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/build_pip.yml diff --git a/.github/workflows/build_pip.yml b/.github/workflows/build_pip.yml new file mode 100644 index 0000000..43f1f73 --- /dev/null +++ b/.github/workflows/build_pip.yml @@ -0,0 +1,57 @@ +name: Build wheels + +on: + push: + tags: + - "*" + workflow_dispatch: + +jobs: + build-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - name: Install build tools + run: | + sudo apt-get update + sudo apt-get install -y build-essential gcc make + + - name: Install build backend + run: pip install --upgrade build setuptools wheel + + - name: Build wheel + run: python -m build --wheel --outdir dist/linux + + - name: Upload wheel artifact + uses: actions/upload-artifact@v3 + with: + name: linux-wheel + path: dist/linux/*.whl + + build-macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - name: Install build backend + run: pip install --upgrade build setuptools wheel + + - name: Build wheel + run: python -m build --wheel --outdir dist/macos + + - name: Upload wheel artifact + uses: actions/upload-artifact@v3 + with: + name: macos-wheel + path: dist/macos/*.whl From d16518594c18fea7efbf10bb2fc24d14e4d9e6b0 Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Tue, 2 Dec 2025 15:51:54 +0000 Subject: [PATCH 05/28] Delete .github/workflows/build_pip.yml --- .github/workflows/build_pip.yml | 57 --------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 .github/workflows/build_pip.yml diff --git a/.github/workflows/build_pip.yml b/.github/workflows/build_pip.yml deleted file mode 100644 index 43f1f73..0000000 --- a/.github/workflows/build_pip.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Build wheels - -on: - push: - tags: - - "*" - workflow_dispatch: - -jobs: - build-linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - - name: Install build tools - run: | - sudo apt-get update - sudo apt-get install -y build-essential gcc make - - - name: Install build backend - run: pip install --upgrade build setuptools wheel - - - name: Build wheel - run: python -m build --wheel --outdir dist/linux - - - name: Upload wheel artifact - uses: actions/upload-artifact@v3 - with: - name: linux-wheel - path: dist/linux/*.whl - - build-macos: - runs-on: macos-latest - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - - name: Install build backend - run: pip install --upgrade build setuptools wheel - - - name: Build wheel - run: python -m build --wheel --outdir dist/macos - - - name: Upload wheel artifact - uses: actions/upload-artifact@v3 - with: - name: macos-wheel - path: dist/macos/*.whl From 4309bde59c95ea2c0b318ffa3067ade00dca7433 Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Tue, 2 Dec 2025 15:53:06 +0000 Subject: [PATCH 06/28] Update build.yml --- .github/workflows/build.yml | 148 +++++++++++++----------------------- 1 file changed, 51 insertions(+), 97 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a30dc58..878c523 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,118 +1,72 @@ -name: Build and Test +name: Build and Publish Wheels on: push: - branches: [main, master, develop] - pull_request: - branches: [main, master] + tags: + - "*" # Trigger on any git tag + workflow_dispatch: jobs: - test: - name: Test on ${{ matrix.os }} / Python ${{ matrix.python-version }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest] - python-version: ["3.9", "3.10", "3.11", "3.12"] - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install build dependencies - run: | - python -m pip install --upgrade pip - pip install build pytest - - - name: Build and install package - run: | - pip install . - - - name: Verify binaries are bundled - run: | - python -c "from smudgeplot.cli import get_binary_path; print(get_binary_path('hetmers'))" - python -c "from smudgeplot.cli import get_binary_path; print(get_binary_path('extract_kmer_pairs'))" - - - name: Test CLI - run: | - smudgeplot --version - smudgeplot -h - smudgeplot hetmers --help - smudgeplot extract --help - - build-wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-13, macos-14] # macos-13=x86, macos-14=arm64 - - steps: - - uses: actions/checkout@v4 - - - name: Build wheels - uses: pypa/cibuildwheel@v2.21.3 - # Config is read from pyproject.toml [tool.cibuildwheel] - - - uses: actions/upload-artifact@v4 - with: - name: wheels-${{ matrix.os }} - path: ./wheelhouse/*.whl - - build-sdist: - name: Build source distribution + build-manylinux: + name: Build Manylinux Wheels runs-on: ubuntu-latest + container: + image: quay.io/pypa/manylinux2014_x86_64 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - - name: Build sdist + - name: Build Manylinux Wheels run: | - pip install build - python -m build --sdist - - - name: Verify sdist doesn't contain binaries - run: | - tar -tzf dist/*.tar.gz | grep -E 'bin/(hetmers|extract_kmer_pairs)$' && exit 1 || echo "Good: no binaries in sdist" - - - uses: actions/upload-artifact@v4 + OUT_DIR=/io/dist + mkdir -p $OUT_DIR + PYTHONS=("cp39-cp39" "cp310-cp310" "cp311-cp311" "cp312-cp312") + for PY_TAG in "${PYTHONS[@]}"; do + PY_BIN=/opt/python/${PY_TAG}/bin/python + $PY_BIN -m pip install --upgrade pip setuptools wheel build auditwheel + $PY_BIN -m build --wheel --outdir /io/dist + for whl in /io/dist/*.whl; do + auditwheel repair "$whl" -w /io/dist + done + done + + - name: Upload Manylinux Wheels Artifact + uses: actions/upload-artifact@v3 with: - name: sdist - path: dist/*.tar.gz + name: manylinux-wheels + path: dist/* - test-sdist: - name: Test sdist on ${{ matrix.os }} - needs: build-sdist - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest] + - name: Upload Manylinux Wheels to PyPI + uses: pypa/gh-action-pypi-publish@v1.6.3 + with: + password: ${{ secrets.PYPI_API_TOKEN }} + packages_dir: dist + build-macos: + name: Build macOS Wheels + runs-on: macos-latest steps: - - uses: actions/download-artifact@v4 - with: - name: sdist - path: dist + - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v4 with: python-version: "3.11" - - name: Install from sdist + - name: Install build tools run: | - pip install dist/*.tar.gz + python3 -m pip install --upgrade pip setuptools wheel build - - name: Verify binaries are compiled - run: | - python -c "from smudgeplot.cli import get_binary_path; print(get_binary_path('hetmers'))" - python -c "from smudgeplot.cli import get_binary_path; print(get_binary_path('extract_kmer_pairs'))" + - name: Build macOS Wheel + run: python3 -m build --wheel --outdir dist/macos - - name: Test compiled binaries execute - run: | - smudgeplot hetmers --help - smudgeplot extract --help + - name: Upload macOS Wheels Artifact + uses: actions/upload-artifact@v3 + with: + name: macos-wheels + path: dist/macos/* + + - name: Upload macOS Wheels to PyPI + uses: pypa/gh-action-pypi-publish@v1.6.3 + with: + password: ${{ secrets.PYPI_API_TOKEN }} + packages_dir: dist/macos From 98ec225f535d66b4738b4c6c16db08723627a0f7 Mon Sep 17 00:00:00 2001 From: KamilSJaron Date: Wed, 3 Dec 2025 09:27:30 +0100 Subject: [PATCH 07/28] adding a rule on creating the directory if does not exist yet --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bb4da2b..4834060 100644 --- a/Makefile +++ b/Makefile @@ -8,11 +8,14 @@ endif HET_KMERS_INST = $(INSTALL_PREFIX)/bin/hetmers $(INSTALL_PREFIX)/bin/extract_kmer_pairs .PHONY : default -default: exec/hetmers exec/extract_kmer_pairs +default: exec/ exec/hetmers exec/extract_kmer_pairs .PHONY : install install : $(HET_KMERS_INST) +exec/: + mkdir -p exec + $(INSTALL_PREFIX)/bin/% : exec/% install -C $< $(INSTALL_PREFIX)/bin From bf80e7f9b1de604e21ec794d2b48a19f4af32c54 Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Wed, 3 Dec 2025 15:47:01 +0000 Subject: [PATCH 08/28] develop->dev in build.yml --- .github/workflows/build.yml | 148 +++++++++++++++++++++++------------- 1 file changed, 97 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 878c523..f8b2d0c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,72 +1,118 @@ -name: Build and Publish Wheels +name: Build and Test on: push: - tags: - - "*" # Trigger on any git tag - workflow_dispatch: + branches: [main, master, dev] + pull_request: + branches: [main, master] jobs: - build-manylinux: - name: Build Manylinux Wheels - runs-on: ubuntu-latest - container: - image: quay.io/pypa/manylinux2014_x86_64 + test: + name: Test on ${{ matrix.os }} / Python ${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + python-version: ["3.9", "3.10", "3.11", "3.12"] + steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + pip install build pytest + + - name: Build and install package + run: | + pip install . - - name: Build Manylinux Wheels + - name: Verify binaries are bundled run: | - OUT_DIR=/io/dist - mkdir -p $OUT_DIR - PYTHONS=("cp39-cp39" "cp310-cp310" "cp311-cp311" "cp312-cp312") - for PY_TAG in "${PYTHONS[@]}"; do - PY_BIN=/opt/python/${PY_TAG}/bin/python - $PY_BIN -m pip install --upgrade pip setuptools wheel build auditwheel - $PY_BIN -m build --wheel --outdir /io/dist - for whl in /io/dist/*.whl; do - auditwheel repair "$whl" -w /io/dist - done - done - - - name: Upload Manylinux Wheels Artifact - uses: actions/upload-artifact@v3 + python -c "from smudgeplot.cli import get_binary_path; print(get_binary_path('hetmers'))" + python -c "from smudgeplot.cli import get_binary_path; print(get_binary_path('extract_kmer_pairs'))" + + - name: Test CLI + run: | + smudgeplot --version + smudgeplot -h + smudgeplot hetmers --help + smudgeplot extract --help + + build-wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-13, macos-14] # macos-13=x86, macos-14=arm64 + + steps: + - uses: actions/checkout@v4 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.21.3 + # Config is read from pyproject.toml [tool.cibuildwheel] + + - uses: actions/upload-artifact@v4 with: - name: manylinux-wheels - path: dist/* + name: wheels-${{ matrix.os }} + path: ./wheelhouse/*.whl - - name: Upload Manylinux Wheels to PyPI - uses: pypa/gh-action-pypi-publish@v1.6.3 + build-sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + run: | + pip install build + python -m build --sdist + + - name: Verify sdist doesn't contain binaries + run: | + tar -tzf dist/*.tar.gz | grep -E 'bin/(hetmers|extract_kmer_pairs)$' && exit 1 || echo "Good: no binaries in sdist" + + - uses: actions/upload-artifact@v4 with: - password: ${{ secrets.PYPI_API_TOKEN }} - packages_dir: dist + name: sdist + path: dist/*.tar.gz + + test-sdist: + name: Test sdist on ${{ matrix.os }} + needs: build-sdist + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] - build-macos: - name: Build macOS Wheels - runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/download-artifact@v4 + with: + name: sdist + path: dist - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" - - name: Install build tools + - name: Install from sdist run: | - python3 -m pip install --upgrade pip setuptools wheel build + pip install dist/*.tar.gz - - name: Build macOS Wheel - run: python3 -m build --wheel --outdir dist/macos - - - name: Upload macOS Wheels Artifact - uses: actions/upload-artifact@v3 - with: - name: macos-wheels - path: dist/macos/* + - name: Verify binaries are compiled + run: | + python -c "from smudgeplot.cli import get_binary_path; print(get_binary_path('hetmers'))" + python -c "from smudgeplot.cli import get_binary_path; print(get_binary_path('extract_kmer_pairs'))" - - name: Upload macOS Wheels to PyPI - uses: pypa/gh-action-pypi-publish@v1.6.3 - with: - password: ${{ secrets.PYPI_API_TOKEN }} - packages_dir: dist/macos + - name: Test compiled binaries execute + run: | + smudgeplot hetmers --help + smudgeplot extract --help From f5a86171c6ada88441c73a2f8aaaaef2f9c3804b Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Wed, 3 Dec 2025 15:47:47 +0000 Subject: [PATCH 09/28] amend setup.py to force BinaryDistribution --- setup.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index add6518..de1df16 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ from setuptools import setup from setuptools.command.build_py import build_py from setuptools.command.develop import develop - +from setuptools.dist import Distribution class CompilationError(Exception): """Raised when C binary compilation fails.""" @@ -132,10 +132,14 @@ def run(self): print("Continuing with editable install, but binaries will not work.", file=sys.stderr) super().run() +class BinaryDistribution(Distribution): + def has_ext_modules(self): + return True setup( cmdclass={ "build_py": BuildPyWithBinaries, "develop": DevelopWithBinaries, - } + }, + distclass=BinaryDistribution ) From 990ae299ea0d59c146ddb6e2ece203baeeaec01d Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Wed, 3 Dec 2025 15:58:30 +0000 Subject: [PATCH 10/28] Min macosx deployment target for c libraries in pyproject.toml --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 3907332..886b0a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,6 +67,7 @@ smudgeplot = ["bin/*"] # Skip 32-bit, PyPy, musllinux, and Windows (no Windows support for now) skip = ["*-win32", "*-win_amd64", "*-manylinux_i686", "pp*", "*-musllinux*"] build = ["cp39-*", "cp310-*", "cp311-*", "cp312-*"] +environment = { MACOSX_DEPLOYMENT_TARGET = "10.14" } # Test that the CLI works after building test-command = "smudgeplot --version" From 85568d59bc423f62799f277f8916a0a8895ae0da Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Thu, 4 Dec 2025 09:27:47 +0000 Subject: [PATCH 11/28] Update README.md --- README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2a42c9d..11011dd 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,9 @@ # Smudgeplot -**_Version: 0.5.2b Skylight_** +**_Version: 0.5.3 Skylight_** **_Authors: Sam Ebdon, [Gene W Myers](https://github.com/thegenemyers) and [Kamil S. Jaron](https://github.com/KamilSJaron), Tianyi Ma._** -We keep the same pythonic interface; the interface of this and previous versions are very similar and largely compatible. - -Current state: RUNNING; beta-testing; - ## Installation This version of smudgeplot operates on FastK k-mer databases. The smudgeplot installation consists of a python package and C-backend to search for all the k-mer pairs (hetmers) and extract sequences of k-mer pairs (extract_kmer_pairs). @@ -37,11 +33,19 @@ Note the smudgeplot version downloadable from conda itself is not currently up t The process above should install everything including compilation of the C backend. If you need or would like to know how to compile the code yourself you can simply run ``` -mkdir exec && make +make ``` This will not, however, install the smudgeplot python package. +### Pypi installation [EXPERIMENTAL] + +We are working on packaging smudgeplot for pypi. You are welcome to try installing from pypi if you are interested and please open an issue if you have problems. If it fails please follow the main instructions above to install for now. + +``` +pip install smudgeplot +``` + ## Example run on Saccharomyces data Requires ~2.1GB of space and `FastK` and `smudgeplot` installed. From 286e5d88d0e72b576b9e51663615796eb08b480b Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Thu, 4 Dec 2025 09:30:35 +0000 Subject: [PATCH 12/28] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 11011dd..c82d04a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ## Installation -This version of smudgeplot operates on FastK k-mer databases. The smudgeplot installation consists of a python package and C-backend to search for all the k-mer pairs (hetmers) and extract sequences of k-mer pairs (extract_kmer_pairs). +This version of smudgeplot operates on FastK k-mer databases. The smudgeplot installation consists of a python package and C-backend to search for all the k-mer pairs (smudgeplot hetmers) and extract sequences of k-mer pairs (smudgeplot extract). We recommend installing smudgeplot within a [conda](https://conda-forge.org/download/) environment. From 569e7b0cd61d7f352d91a916cc24962a8516a119 Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Thu, 4 Dec 2025 09:51:15 +0000 Subject: [PATCH 13/28] Update publish.yml with pypi pwd from secrets --- .github/workflows/publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8ad5979..f3c74c0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -66,3 +66,4 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: packages-dir: dist/ + password: ${{ secrets.PYPI_API_TOKEN }} From 8711c80447754f4aa58342bc7fc13aede192adfc Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Thu, 4 Dec 2025 09:55:28 +0000 Subject: [PATCH 14/28] minimum required macos dev target --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 886b0a9..26c5b4d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,7 +67,7 @@ smudgeplot = ["bin/*"] # Skip 32-bit, PyPy, musllinux, and Windows (no Windows support for now) skip = ["*-win32", "*-win_amd64", "*-manylinux_i686", "pp*", "*-musllinux*"] build = ["cp39-*", "cp310-*", "cp311-*", "cp312-*"] -environment = { MACOSX_DEPLOYMENT_TARGET = "10.14" } +environment = { MACOSX_DEPLOYMENT_TARGET = "11.0" } # Test that the CLI works after building test-command = "smudgeplot --version" From 5548007db67445771bc04d22ad8c04b1a1e8967e Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Thu, 4 Dec 2025 10:09:16 +0000 Subject: [PATCH 15/28] beta testing 0.5.3b for pypi --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c82d04a..6bd2009 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Smudgeplot -**_Version: 0.5.3 Skylight_** +**_Version: 0.5.3b Skylight_** **_Authors: Sam Ebdon, [Gene W Myers](https://github.com/thegenemyers) and [Kamil S. Jaron](https://github.com/KamilSJaron), Tianyi Ma._** From 7655bb448fe37d10ff687a97fa98371c13896a59 Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Thu, 4 Dec 2025 10:41:24 +0000 Subject: [PATCH 16/28] args.format -> plot task --- src/smudgeplot/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/smudgeplot/cli.py b/src/smudgeplot/cli.py index 086e851..e08a063 100755 --- a/src/smudgeplot/cli.py +++ b/src/smudgeplot/cli.py @@ -301,7 +301,7 @@ def add_plotting_arguments(self, argparser): "--format", default="png", help="Output format for the plots (default png)", - choices=["pdf", "png"], + choices=["pdf", "png", "svg"], ) argparser.add_argument( "--json_report", @@ -372,7 +372,7 @@ def main(): smudge_tab = smg.read_csv(args.smudgefile, sep="\t", names=["structure", "size", "rel_size"]) cov_tab = smg.load_hetmers(args.infile) smudgeplot_data = smg.SmudgeplotData(cov_tab, smudge_tab, args.n) - smg.prepare_smudgeplot_data_for_plotting(smudgeplot_data, args.o, title, upper_ylim=args.ylim) + smg.prepare_smudgeplot_data_for_plotting(smudgeplot_data, args.o, title, upper_ylim=args.ylim, fmt=args.format) smg.smudgeplot(smudgeplot_data, log=False, palette=args.col_ramp, invert_cols=args.invert_cols) smg.smudgeplot(smudgeplot_data, log=True, palette=args.col_ramp, invert_cols=args.invert_cols) From 0b3bd5ff49c87fcd6c1e3f3e6b1dd734d28debfa Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Thu, 4 Dec 2025 10:42:55 +0000 Subject: [PATCH 17/28] version -> 3b --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 26c5b4d..edfc9b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "smudgeplot" -version = "0.5.2b" +version = "0.5.3b" description = "Inference of ploidy and heterozygosity structure using whole genome sequencing data" readme = "README.md" license = "Apache-2.0" From 67e6c5b65717f8d9b6f33a359385d1c0ebcfa370 Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Thu, 4 Dec 2025 10:49:49 +0000 Subject: [PATCH 18/28] svg support for people who really want it From 56d4dc695182b9b61f93c346c558ae3b89c168a8 Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Thu, 4 Dec 2025 11:51:54 +0000 Subject: [PATCH 19/28] updating macos-13 to macos-15-intel due to depreciation --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8b2d0c..ad7d192 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-13, macos-14] # macos-13=x86, macos-14=arm64 + os: [ubuntu-latest, macos-15-intel, macos-14] # macos-15-intel=x86, macos-14=arm64 steps: - uses: actions/checkout@v4 From 7b9b007fb91a1aeb0567432414bce434150f4e07 Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Thu, 4 Dec 2025 11:52:36 +0000 Subject: [PATCH 20/28] macos-13 depreciation --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f3c74c0..f730394 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,7 +10,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-13, macos-14] + os: [ubuntu-latest, macos-15-intel, macos-14] steps: - uses: actions/checkout@v4 From 76378b432c0edefbf83e5b879b8f50cabb5736b7 Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Thu, 4 Dec 2025 13:34:44 +0000 Subject: [PATCH 21/28] python 3.13 and 3.14 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad7d192..c5fcab3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13","3.14"] steps: - uses: actions/checkout@v4 From ab41041684687cfa955c3b547d5bc6f6e091a51d Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Thu, 4 Dec 2025 13:36:07 +0000 Subject: [PATCH 22/28] python 3.13 and 3.14 --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index edfc9b7..30109e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,6 +38,8 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Operating System :: POSIX :: Linux", "Operating System :: MacOS", "Intended Audience :: Science/Research", From 13ee31e3fde9ddf961bb2239b48a89a717704c7a Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Thu, 4 Dec 2025 13:36:52 +0000 Subject: [PATCH 23/28] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6bd2009..c82d04a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Smudgeplot -**_Version: 0.5.3b Skylight_** +**_Version: 0.5.3 Skylight_** **_Authors: Sam Ebdon, [Gene W Myers](https://github.com/thegenemyers) and [Kamil S. Jaron](https://github.com/KamilSJaron), Tianyi Ma._** From f45d5b8ca96be9ccf00fb6520316f8a04f240bd6 Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Thu, 4 Dec 2025 13:37:05 +0000 Subject: [PATCH 24/28] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 30109e1..ade4459 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "smudgeplot" -version = "0.5.3b" +version = "0.5.3" description = "Inference of ploidy and heterozygosity structure using whole genome sequencing data" readme = "README.md" license = "Apache-2.0" From 1356735acda98f7ae9606735a0cc76099a274266 Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Thu, 4 Dec 2025 13:40:18 +0000 Subject: [PATCH 25/28] Typo cli.py --- src/smudgeplot/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/smudgeplot/cli.py b/src/smudgeplot/cli.py index e08a063..8eebf1b 100755 --- a/src/smudgeplot/cli.py +++ b/src/smudgeplot/cli.py @@ -78,7 +78,7 @@ def __init__(self): tasks: cutoff Calculate meaningful values for lower kmer histogram cutoff. hetmers Calculate unique kmer pairs from a FastK k-mer database. peak_aggregation Agregates smudges using local aggregation algorithm; prints assignments to stdout. - plot Generate 2d histogram; infere ploidy and plot a smudgeplot. + plot Generate 2d histogram; infer ploidy and plot a smudgeplot. all Runs all the steps (with default options) extract Extract kmer pair sequences from a FastK k-mer database. """ From 95f9621c22786a839dc32308e2205d975f2bee8b Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Thu, 4 Dec 2025 14:03:28 +0000 Subject: [PATCH 26/28] remove dev branch build and testing --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c5fcab3..49e3b78 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: Build and Test on: push: - branches: [main, master, dev] + branches: [main, master] pull_request: branches: [main, master] From 8e1e44d27d36e2b5d62440d2bc85dcb8d91b44d0 Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Thu, 4 Dec 2025 14:06:21 +0000 Subject: [PATCH 27/28] API token obsolete with trusted publishing --- .github/workflows/publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f730394..a678a0d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -66,4 +66,3 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: packages-dir: dist/ - password: ${{ secrets.PYPI_API_TOKEN }} From 65e4b68f6b7c18571051bc80a74fff00a69f8360 Mon Sep 17 00:00:00 2001 From: samebdon <33068203+samebdon@users.noreply.github.com> Date: Thu, 4 Dec 2025 14:12:41 +0000 Subject: [PATCH 28/28] add smudgeplot pypi url to publish environment --- .github/workflows/publish.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a678a0d..1170dae 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -48,7 +48,9 @@ jobs: name: Publish to PyPI needs: [build-wheels, build-sdist] runs-on: ubuntu-latest - environment: pypi + environment: + name: pypi + url: https://pypi.org/project/smudgeplot permissions: id-token: write # Required for trusted publishing