Skip to content

Commit

Permalink
Added mode info for veryfying availability of submodules binaries.
Browse files Browse the repository at this point in the history
Co-authored-by: aziele <[email protected]>
  • Loading branch information
agudys and aziele authored Oct 16, 2024
1 parent 93a364b commit ffd55f8
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ jobs:
steps:
- name: help
run: python3 vclust.py
- name: print info
run: python3 vclust.py info

########################################################################################
upload:
Expand Down
28 changes: 26 additions & 2 deletions .github/workflows/self-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,35 @@ jobs:
steps:
- name: make
run: make -j32 CXX=g++-${{matrix.compiler}} CC=gcc-${{matrix.compiler}} PLATFORM=${{ matrix.platform }} LEIDEN=true
- name: print info
run: python3 vclust.py info

########################################################################################
print-info:
name: Print info
needs: make
strategy:
fail-fast: false
matrix:
machine: [x64_linux]
platform: [avx2]
compiler: [14]
include:
- {machine: arm64_linux, platform: arm8, compiler: 12}
- {machine: x64_mac, platform: avx2, compiler: 12}
- {machine: arm64_mac, platform: m1, compiler: 12}

runs-on: [self-hosted, vclust, '${{ matrix.machine }}']

steps:
- name: print info
run: python3 vclust.py info


########################################################################################
pipeline-linux:
name: Pipeline (linux)
needs: make
needs: print-info
strategy:
fail-fast: false
matrix:
Expand All @@ -70,7 +94,7 @@ jobs:
########################################################################################
pipeline-macos:
name: Pipeline (macOS)
needs: make
needs: print-info
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# <img src="./images/logo.svg" alt="Vclust logo" /> Vclust

![version](https://img.shields.io/badge/version-1.2.6-blue.svg)
![version](https://img.shields.io/badge/version-1.2.7-blue.svg)
[![GitHub downloads](https://img.shields.io/github/downloads/refresh-bio/vclust/total.svg?style=flag&label=GitHub%20downloads)](https://github.com/refresh-bio/vclust/releases)
[![Build and tests](../../workflows/Build%20and%20tests/badge.svg)](../../actions/workflows/main.yml)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
Expand Down
2 changes: 1 addition & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_dir():


@pytest.mark.parametrize('subcommand',[
'prefilter', 'align', 'cluster',
'prefilter', 'align', 'cluster', 'info',
])
def test_subcommands(subcommand):
cmd = [
Expand Down
28 changes: 24 additions & 4 deletions vclust.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import typing
import uuid

__version__ = '1.2.6'
__version__ = '1.2.7'

DEFAULT_THREAD_COUNT = min(multiprocessing.cpu_count(), 64)

Expand All @@ -33,7 +33,7 @@
'qidx', 'ridx', 'query', 'reference', 'tani', 'gani', 'ani', 'qcov',
'rcov', 'num_alns', 'len_ratio', 'qlen', 'rlen', 'nt_match', 'nt_mismatch',
]
# vclust align output formats
# Vclust align output formats
ALIGN_OUTFMT = {
'lite': ALIGN_FIELDS[:2] + ALIGN_FIELDS[4:11],
'standard': ALIGN_FIELDS[:11],
Expand Down Expand Up @@ -546,6 +546,14 @@ def ranged_float_type(value):
help='Show this help message and exit'
)

# Info parser
info_parser = subparsers.add_parser(
'info',
help='Show information about the tool and its dependencies',
formatter_class=fmt,
add_help=False,
)

# Show help message if the script is run without any arguments.
if len(sys.argv[1:]) == 0:
parser.print_help()
Expand Down Expand Up @@ -1137,6 +1145,13 @@ def cmd_clusty(
return cmd


def vclust_info():
print(f'Vclust {__version__}')
for bin_path in [BIN_KMERDB, BIN_FASTASPLIT, BIN_LZANI, BIN_CLUSTY]:
validate_binary(bin_path)
print(f'{bin_path.name:<20} ok')


class CustomHelpFormatter(argparse.HelpFormatter):
"""Custom help message formatter for argparse."""

Expand Down Expand Up @@ -1166,11 +1181,16 @@ def main():
# Initialize logger
logger = create_logger(
name='vclust',
log_level=logging.INFO if args.verbose else logging.ERROR,
log_level=(logging.INFO
if (hasattr(args, 'verbose') and args.verbose)
else logging.ERROR),
)

# Info
if args.command == 'info':
vclust_info()
# Prefilter
if args.command == 'prefilter':
elif args.command == 'prefilter':
args.bin_kmerdb = validate_binary(args.bin_kmerdb)
args = validate_args_prefilter(args, parser)
args = validate_args_fasta_input(args, parser)
Expand Down

0 comments on commit ffd55f8

Please sign in to comment.