From 79d7e0f470a397703f691b541532fabbac68ba5d Mon Sep 17 00:00:00 2001 From: Peter van Heusden Date: Tue, 21 Nov 2023 11:20:50 +0200 Subject: [PATCH] Add --version and fix flake8 errors --- src/tb_variant_filter/__init__.py | 4 ++++ src/tb_variant_filter/cli.py | 2 ++ src/tb_variant_filter/filters/alt_percentage_filter.py | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tb_variant_filter/__init__.py b/src/tb_variant_filter/__init__.py index 667fb9f..1ed320d 100644 --- a/src/tb_variant_filter/__init__.py +++ b/src/tb_variant_filter/__init__.py @@ -12,6 +12,10 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . + +__version_info__ = ('0', '4', '1') +__version__ = '.'.join(__version_info__) + from dataclasses import dataclass from functools import wraps diff --git a/src/tb_variant_filter/cli.py b/src/tb_variant_filter/cli.py index db53a9a..c4e37b1 100644 --- a/src/tb_variant_filter/cli.py +++ b/src/tb_variant_filter/cli.py @@ -17,6 +17,7 @@ import vcfpy +from . import __version__ from .filters import get_filters, UnionFilter @@ -51,6 +52,7 @@ def main(): parser = argparse.ArgumentParser( description="Filter variants from a VCF file (relative to M. tuberculosis H37Rv)" ) + parser.add_argument('--version', action='version', version=__version__, help="Print version and exit") parser.add_argument( "input_file", type=argparse.FileType(), diff --git a/src/tb_variant_filter/filters/alt_percentage_filter.py b/src/tb_variant_filter/filters/alt_percentage_filter.py index 7096d86..1be6653 100644 --- a/src/tb_variant_filter/filters/alt_percentage_filter.py +++ b/src/tb_variant_filter/filters/alt_percentage_filter.py @@ -63,7 +63,7 @@ def __repr__(self) -> str: def __call__(self, record: vcfpy.Record) -> Union[vcfpy.Record, None]: # VCF records have 1 (or 0?) or more ALT records supported by calls from 1 or more samples # and (sometimes) AO INFO fields with dimension matching the ALT dimensions. Or AF1 or DP4 - # or... there really is not standard way of representing ALT allele frequency in + # or... there really is not standard way of representing ALT allele frequency in # VCF - see this discussion: https://github.com/samtools/hts-specs/issues/78 # This Transform type Filter retains only those ALTs and corresponding INFO matching the # criteria of the filter