From 92563ebffab31db7e90943ac5edaafbca9f0f197 Mon Sep 17 00:00:00 2001 From: Luis Kress Date: Mon, 26 May 2025 09:28:55 +0000 Subject: [PATCH 01/18] fix: Remove reads spliced at the SNV position --- vafator/pileups.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vafator/pileups.py b/vafator/pileups.py index d285bf4..d8f138c 100755 --- a/vafator/pileups.py +++ b/vafator/pileups.py @@ -183,7 +183,7 @@ def get_snv_metrics(pileups: IteratorColumnRegion, include_ambiguous_bases=False if include_ambiguous_bases: dp = len(bases) else: - dp = len([b for b in bases if b not in AMBIGUOUS_BASES]) + dp = len([b for b in bases if b not in AMBIGUOUS_BASES and b != ""]) ac = Counter(bases) except StopIteration: # no reads From 26dcc95abe82b937c39ac36bf339e0f719c5c730 Mon Sep 17 00:00:00 2001 From: Luis Kress Date: Mon, 26 May 2025 09:33:54 +0000 Subject: [PATCH 02/18] chore: Bump version and update CI containers --- .github/workflows/integration_tests.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/unit_tests.yml | 2 +- vafator/__init__.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index bd8f232..7020e7a 100755 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -4,7 +4,7 @@ on: [push] jobs: test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: matrix: python-version: [ '3.7', '3.8', '3.9', '3.10' ] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 78998c9..c5eab6b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: jobs: deploy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 473fa02..d964753 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -4,7 +4,7 @@ on: [push] jobs: test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: matrix: python-version: [ '3.7', '3.8', '3.9', '3.10' ] diff --git a/vafator/__init__.py b/vafator/__init__.py index d7b3f80..ee3c590 100755 --- a/vafator/__init__.py +++ b/vafator/__init__.py @@ -1,4 +1,4 @@ -VERSION='2.2.0' +VERSION='2.2.1' AMBIGUOUS_BASES = ['N', 'M', 'R', 'W', 'S', 'Y', 'K', 'V', 'H', 'D', 'B'] From f03784eda61e5f17cefe32bb3dc10c77ec614545 Mon Sep 17 00:00:00 2001 From: Luis Kress Date: Mon, 26 May 2025 09:35:55 +0000 Subject: [PATCH 03/18] chore: Remove python v3.7 from CI tests --- .github/workflows/integration_tests.yml | 2 +- .github/workflows/unit_tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 7020e7a..d8dd680 100755 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-24.04 strategy: matrix: - python-version: [ '3.7', '3.8', '3.9', '3.10' ] + python-version: [ '3.8', '3.9', '3.10' ] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index d964753..aea9aea 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-24.04 strategy: matrix: - python-version: [ '3.7', '3.8', '3.9', '3.10' ] + python-version: [ '3.8', '3.9', '3.10' ] steps: - uses: actions/checkout@v2 From dd00cb0348ef046dbaf1b63ce7fae96f4c49830c Mon Sep 17 00:00:00 2001 From: Luis Kress Date: Mon, 26 May 2025 09:44:05 +0000 Subject: [PATCH 04/18] chore: Clear pip cache for CI --- .github/workflows/integration_tests.yml | 1 + .github/workflows/release.yml | 1 + .github/workflows/unit_tests.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index d8dd680..336d479 100755 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -20,6 +20,7 @@ jobs: sudo apt-get update sudo apt-get --assume-yes install build-essential libcurl4-openssl-dev libz-dev liblzma-dev python -m pip install --upgrade pip + pip cache purge pip install setuptools wheel # this is needed by pybedtools sudo apt-get --assume-yes install bedtools diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c5eab6b..cd75b40 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip + pip cache purge pip install setuptools wheel twine - name: Build and publish env: diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index aea9aea..310f7c4 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -18,6 +18,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip + pip cache purge pip install setuptools wheel coverage pip install virtualenv tox==3.26.0 tox-wheel==1.0.0 tox-gh-actions - name: Build, install and run unit tests From e62bf386dd9e6f70928dbacdcc0c34598fc53b52 Mon Sep 17 00:00:00 2001 From: Luis Kress Date: Mon, 26 May 2025 09:47:55 +0000 Subject: [PATCH 05/18] chore: Clean pip cache in CI --- .github/workflows/integration_tests.yml | 1 + .github/workflows/unit_tests.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 336d479..70d5b0e 100755 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -28,6 +28,7 @@ jobs: pip install -r requirements.txt - name: Install vafator run: | + pip cache purge python setup.py bdist_wheel pip install dist/vafator-*.whl - name: Run integration tests diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 310f7c4..b220dcc 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -23,6 +23,7 @@ jobs: pip install virtualenv tox==3.26.0 tox-wheel==1.0.0 tox-gh-actions - name: Build, install and run unit tests run: | + pip cache purge pip install -r requirements.txt coverage run -m unittest discover vafator.tests - name: Upload Coverage to Codecov From 30612ded9c1a784569c1d828ad9800c6d570eba6 Mon Sep 17 00:00:00 2001 From: Luis Kress Date: Mon, 26 May 2025 09:58:27 +0000 Subject: [PATCH 06/18] chore: Update python setup version in CI --- .github/workflows/integration_tests.yml | 5 ++--- .github/workflows/unit_tests.yml | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 70d5b0e..6480ca7 100755 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -12,15 +12,15 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: pip - name: Install dependencies run: | sudo apt-get update sudo apt-get --assume-yes install build-essential libcurl4-openssl-dev libz-dev liblzma-dev python -m pip install --upgrade pip - pip cache purge pip install setuptools wheel # this is needed by pybedtools sudo apt-get --assume-yes install bedtools @@ -28,7 +28,6 @@ jobs: pip install -r requirements.txt - name: Install vafator run: | - pip cache purge python setup.py bdist_wheel pip install dist/vafator-*.whl - name: Run integration tests diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index b220dcc..a33db37 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -12,18 +12,17 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: pip - name: Install dependencies run: | python -m pip install --upgrade pip - pip cache purge pip install setuptools wheel coverage pip install virtualenv tox==3.26.0 tox-wheel==1.0.0 tox-gh-actions - name: Build, install and run unit tests run: | - pip cache purge pip install -r requirements.txt coverage run -m unittest discover vafator.tests - name: Upload Coverage to Codecov From 53430343fa861b401e515ab32d7a4e066cc8b55b Mon Sep 17 00:00:00 2001 From: Luis Kress Date: Mon, 26 May 2025 11:42:07 +0000 Subject: [PATCH 07/18] chore: Install numpy and cyvcf2 not from binary --- .github/workflows/integration_tests.yml | 2 +- .github/workflows/unit_tests.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 6480ca7..b2423b8 100755 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -25,7 +25,7 @@ jobs: # this is needed by pybedtools sudo apt-get --assume-yes install bedtools # install python requirements - pip install -r requirements.txt + #pip install -r requirements.txt - name: Install vafator run: | python setup.py bdist_wheel diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index a33db37..deb6d97 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -24,6 +24,8 @@ jobs: - name: Build, install and run unit tests run: | pip install -r requirements.txt + pip install --no-binary=:all: numpy + pip install --no-binary=:all: cyvcf2 coverage run -m unittest discover vafator.tests - name: Upload Coverage to Codecov uses: codecov/codecov-action@v3 \ No newline at end of file From 745b5fe752bc9dea01747dc26b57461660a3fbaf Mon Sep 17 00:00:00 2001 From: Luis Kress Date: Mon, 26 May 2025 11:45:15 +0000 Subject: [PATCH 08/18] chore: First install numpy and cyvcf2 --- .github/workflows/unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index deb6d97..e487f5a 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -23,9 +23,9 @@ jobs: pip install virtualenv tox==3.26.0 tox-wheel==1.0.0 tox-gh-actions - name: Build, install and run unit tests run: | - pip install -r requirements.txt pip install --no-binary=:all: numpy pip install --no-binary=:all: cyvcf2 + pip install -r requirements.txt coverage run -m unittest discover vafator.tests - name: Upload Coverage to Codecov uses: codecov/codecov-action@v3 \ No newline at end of file From 6d155e2a4f4bdf5813acf2012e0cf1e3ff821549 Mon Sep 17 00:00:00 2001 From: Luis Kress Date: Mon, 26 May 2025 14:56:12 +0000 Subject: [PATCH 09/18] chore: test python container --- .github/workflows/unit_tests.yml | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index e487f5a..0005de7 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -4,28 +4,25 @@ on: [push] jobs: test: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest strategy: matrix: python-version: [ '3.8', '3.9', '3.10' ] + container: + image: python:${{ matrix.python-version }} + steps: - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: pip - - name: Install dependencies + + - name: Install Python dependencies run: | - python -m pip install --upgrade pip pip install setuptools wheel coverage - pip install virtualenv tox==3.26.0 tox-wheel==1.0.0 tox-gh-actions - - name: Build, install and run unit tests - run: | - pip install --no-binary=:all: numpy - pip install --no-binary=:all: cyvcf2 pip install -r requirements.txt + + - name: Run unit tests with coverage + run: | coverage run -m unittest discover vafator.tests + - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v3 \ No newline at end of file + uses: codecov/codecov-action@v3 From c406efc15bce85bdb466b055d3527090d0996001 Mon Sep 17 00:00:00 2001 From: Luis Kress Date: Mon, 26 May 2025 15:24:39 +0000 Subject: [PATCH 10/18] chore: test ci --- .github/workflows/unit_tests.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 0005de7..75bb417 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -14,15 +14,16 @@ jobs: steps: - uses: actions/checkout@v2 - - - name: Install Python dependencies + - name: Install dependencies run: | + python -m pip install --upgrade pip pip install setuptools wheel coverage - pip install -r requirements.txt - - - name: Run unit tests with coverage + pip install virtualenv tox==3.26.0 tox-wheel==1.0.0 tox-gh-actions + - name: Build, install and run unit tests run: | + pip install -r requirements.txt + pip install --force-reinstall "numpy==1.24.4" + pip install --no-cache-dir --force-reinstall --no-binary :all: cyvcf2 coverage run -m unittest discover vafator.tests - - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v3 \ No newline at end of file From 3eb8f47fc0f6dfc57d16fe05f7354e67be8c8058 Mon Sep 17 00:00:00 2001 From: Luis Kress Date: Mon, 26 May 2025 15:34:54 +0000 Subject: [PATCH 11/18] chore: Upate unit tests --- .github/workflows/unit_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 75bb417..37c9eb6 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -22,8 +22,8 @@ jobs: - name: Build, install and run unit tests run: | pip install -r requirements.txt - pip install --force-reinstall "numpy==1.24.4" - pip install --no-cache-dir --force-reinstall --no-binary :all: cyvcf2 + pip install --force-reinstall numpy + pip install --no-cache-dir --force-reinstall --no-binary :all: cyvcf2==0.30.14 coverage run -m unittest discover vafator.tests - name: Upload Coverage to Codecov uses: codecov/codecov-action@v3 \ No newline at end of file From 3bfa11921533a1f139ed99c4f53113edf72f7193 Mon Sep 17 00:00:00 2001 From: Luis Kress Date: Tue, 27 May 2025 13:45:04 +0000 Subject: [PATCH 12/18] chore: unittest --- .github/workflows/unit_tests.yml | 44 ++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 37c9eb6..7805be4 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -1,29 +1,35 @@ name: Unit tests -on: [push] +on: + push: + pull_request: jobs: test: runs-on: ubuntu-latest + strategy: matrix: - python-version: [ '3.8', '3.9', '3.10' ] - - container: - image: python:${{ matrix.python-version }} + python-version: [3.8, 3.9, 3.10] steps: - - uses: actions/checkout@v2 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel coverage - pip install virtualenv tox==3.26.0 tox-wheel==1.0.0 tox-gh-actions - - name: Build, install and run unit tests - run: | - pip install -r requirements.txt - pip install --force-reinstall numpy - pip install --no-cache-dir --force-reinstall --no-binary :all: cyvcf2==0.30.14 - coverage run -m unittest discover vafator.tests - - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v3 \ No newline at end of file + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install . + pip install coverage codecov + + - name: Run tests with coverage + run: | + coverage run -m unittest discover + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 From 54e785f7d7960a0eca4b965b4b7578eace95b537 Mon Sep 17 00:00:00 2001 From: Luis Kress Date: Tue, 27 May 2025 13:46:21 +0000 Subject: [PATCH 13/18] chore: fix versions --- .github/workflows/unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 7805be4..129e0b9 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - python-version: [3.8, 3.9, 3.10] + python-version: ['3.8', '3.9', '3.10'] steps: - name: Checkout code From cbdf112181c6a6aad4f107b42ace7b0570f938a4 Mon Sep 17 00:00:00 2001 From: Luis Kress Date: Tue, 27 May 2025 14:43:20 +0000 Subject: [PATCH 14/18] chore: Update requirements to downgrade numpy below v2 --- .github/workflows/integration_tests.yml | 30 ++++++++++--------------- .github/workflows/release.yml | 13 +++++++---- .github/workflows/unit_tests.yml | 6 ++--- requirements.txt | 1 + 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index b2423b8..c94ef65 100755 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -4,32 +4,26 @@ on: [push] jobs: test: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest strategy: matrix: python-version: [ '3.8', '3.9', '3.10' ] steps: - - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 - with: + with: python-version: ${{ matrix.python-version }} - cache: pip - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get --assume-yes install build-essential libcurl4-openssl-dev libz-dev liblzma-dev - python -m pip install --upgrade pip - pip install setuptools wheel - # this is needed by pybedtools - sudo apt-get --assume-yes install bedtools - # install python requirements - #pip install -r requirements.txt - - name: Install vafator - run: | - python setup.py bdist_wheel - pip install dist/vafator-*.whl + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install . + - name: Run integration tests run: | make clean integration_tests \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cd75b40..f79961c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,20 +6,25 @@ on: jobs: deploy: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: 3.10 + - name: Install dependencies run: | python -m pip install --upgrade pip pip cache purge pip install setuptools wheel twine + - name: Build and publish env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | python setup.py sdist bdist_wheel - twine upload dist/* \ No newline at end of file + twine upload dist/* diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 129e0b9..0ad5eb4 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -1,8 +1,6 @@ name: Unit tests -on: - push: - pull_request: +on: [push] jobs: test: @@ -24,8 +22,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip + pip install -r requirements.txt pip install . - pip install coverage codecov - name: Run tests with coverage run: | diff --git a/requirements.txt b/requirements.txt index aa18723..723e9da 100755 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,5 @@ pysam~=0.19.1 cyvcf2~=0.30.14 logzero~=1.7.0 pybedtools~=0.9.0 +numpy==1.26.4 scipy>=1.0.0,<2.0.0 \ No newline at end of file From 6e17769b203dd7bd27d4f514be14d42849adc45a Mon Sep 17 00:00:00 2001 From: Luis Kress Date: Tue, 27 May 2025 14:48:55 +0000 Subject: [PATCH 15/18] chore: Specify numpy version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 723e9da..bdd5c16 100755 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,5 @@ pysam~=0.19.1 cyvcf2~=0.30.14 logzero~=1.7.0 pybedtools~=0.9.0 -numpy==1.26.4 +numpy>=1.20,<2.0 scipy>=1.0.0,<2.0.0 \ No newline at end of file From c5093e454e41aa66835e7e3c8c2990d209aba28f Mon Sep 17 00:00:00 2001 From: Luis Kress Date: Tue, 27 May 2025 14:54:58 +0000 Subject: [PATCH 16/18] chore: Install coverage --- .github/workflows/unit_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 0ad5eb4..46c9feb 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -24,6 +24,7 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt pip install . + pip install coverage codecov - name: Run tests with coverage run: | From 180a9b746b423135bce66b6577d0fbbcce579f01 Mon Sep 17 00:00:00 2001 From: Luis Kress Date: Tue, 27 May 2025 15:33:05 +0000 Subject: [PATCH 17/18] chore: incorporate CoPilot suggestions --- .github/workflows/release.yml | 1 - vafator/pileups.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f79961c..3bf3bab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,6 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip cache purge pip install setuptools wheel twine - name: Build and publish diff --git a/vafator/pileups.py b/vafator/pileups.py index d8f138c..68891fc 100755 --- a/vafator/pileups.py +++ b/vafator/pileups.py @@ -183,6 +183,7 @@ def get_snv_metrics(pileups: IteratorColumnRegion, include_ambiguous_bases=False if include_ambiguous_bases: dp = len(bases) else: + # remove ambiguous bases and reads where the position is spliced out dp = len([b for b in bases if b not in AMBIGUOUS_BASES and b != ""]) ac = Counter(bases) except StopIteration: From e30a5cb87a2fe4947fb2bbe22b3b321532389e2b Mon Sep 17 00:00:00 2001 From: Luis Kress Date: Thu, 29 May 2025 17:12:54 +0200 Subject: [PATCH 18/18] fix: Remove spliced positions also when ambiguous bases should be considered --- vafator/pileups.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vafator/pileups.py b/vafator/pileups.py index 68891fc..65160a4 100755 --- a/vafator/pileups.py +++ b/vafator/pileups.py @@ -181,7 +181,7 @@ def get_snv_metrics(pileups: IteratorColumnRegion, include_ambiguous_bases=False all_positions = aggregate_list_per_base(bases, pileup.get_query_positions()) if include_ambiguous_bases: - dp = len(bases) + dp = len([b for b in bases if b!= ""]) else: # remove ambiguous bases and reads where the position is spliced out dp = len([b for b in bases if b not in AMBIGUOUS_BASES and b != ""])