diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0a23fee..5f28433 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -179,7 +179,8 @@ jobs: env: OUTPUT_TARBALL: mykrobe.command_line.windows.${{env.RELEASE_VERSION}}.tar.gz run: | - export PYTHONPATH="/mingw64/lib/python3.10/:/mingw64/lib/python3.10/site-packages:${PYTHONPATH}" + export PYTHONPATH="/mingw64/lib/python3.11/:/mingw64/lib/python3.11/site-packages:${PYTHONPATH}" + C:\\msys64\\mingw64\\bin\\python3.exe -m ensurepip --upgrade C:\\msys64\\mingw64\\bin\\python3.exe -m pip install pyinstaller requests pytest echo "clone mccortex" diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d93af7..03b5d19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] +### Added + +- When using `--debug` flag, log species probe coverage/depth info and also each + time a probe is rejected due to low coverage and/or depth. + ## [0.12.2] ### Fixed diff --git a/src/mykrobe/metagenomics/phylo.py b/src/mykrobe/metagenomics/phylo.py index af96018..707900b 100644 --- a/src/mykrobe/metagenomics/phylo.py +++ b/src/mykrobe/metagenomics/phylo.py @@ -1,5 +1,6 @@ from __future__ import print_function import json +import logging import os import operator from mykrobe.utils import median @@ -8,6 +9,7 @@ from mykrobe.metagenomics.models import MykrobePredictorPhylogeneticsResult from mykrobe.stats import percent_coverage_from_expected_coverage +logger = logging.getLogger(__name__) DEFAULT_THRESHOLD = 30 @@ -141,8 +143,10 @@ def _aggregate(self, covgs, threshold=5): _median = covg_dict.get("median", [0]) minimum_percentage_coverage_required = percent_coverage_from_expected_coverage( self.expected_depth) * self.threshold.get(phylo_group, DEFAULT_THRESHOLD) + logger.debug(f"Probe coverage. probe={phylo_group} percent_covered={total_percent_covered} median_cov={median(_median)}") if total_percent_covered < minimum_percentage_coverage_required or median( _median) < 0.1 * self.expected_depth: + logger.debug(f"Probe rejected. probe={phylo_group}, total percent covered={total_percent_covered} < {minimum_percentage_coverage_required}=min required, or median depth={median(_median)} < {round(0.1 * self.expected_depth, 1)} = 10% of expected depth of {self.expected_depth}") # Remove low coverage nodes _index = [ i for i,