diff --git a/README.md b/README.md index f5d0c0f..0daa6ad 100644 --- a/README.md +++ b/README.md @@ -38,11 +38,60 @@ hatch run +py=3.10 test:mikrokondo-tools The above command will display command groups with help messages, and each sub command has additional help options. -Console installation has not been tested. ```console pip install mikrokondo-tools ``` +## Usage + +Running `mikrokondo-tools` generates the following help message with available options for usage: + +``` +Usage: mikrokondo-tools [OPTIONS] COMMAND [ARGS]... + +Options: + --version Show the version and exit. + -h, --help Show this message and exit. + +Commands: + download Download a database for mikrokondo + samplesheet Generate a sample sheet for mikrokondo. +``` + +The `download` option generates the following output: + +``` +Usage: mikrokondo-tools download [OPTIONS] + + Download a external file for use in mikrokondo. This script only downloads + the file and will not untar or unzip them. + +Options: + -f, --file [gtdb-sketch|gtdb-shigella|dehost|kraken-std|bakta-light|bakta-full] + Pick an option from the list to download + [required] + -o, --output PATH An existing directory to download files to. + [default: your/current/directory] + -h, --help Show this message and exit. +``` + + +The `samplesheet` option produces the following output: + +``` +Usage: mikrokondo-tools samplesheet [OPTIONS] SAMPLE_DIRECTORY + +Options: + -o, --output-sheet PATH The file to write your created output sheet to, + this directory must already exist. [required] + -1, --read-1-suffix TEXT A suffix to identify read 1 [default: _R1_] + -2, --read-2-suffix TEXT A suffix to identify read 2 [default: _R2_] + -s, --schema-input PATH An optional schema_input.json file pre-downloaded + for mikrokondo. + -h, --help Show this message and exit. +``` + + ## License Copyright Government of Canada 2023 diff --git a/src/mikrokondo_tools/cli/download/__init__.py b/src/mikrokondo_tools/cli/download/__init__.py index 855ece2..b3b9268 100644 --- a/src/mikrokondo_tools/cli/download/__init__.py +++ b/src/mikrokondo_tools/cli/download/__init__.py @@ -5,15 +5,16 @@ from mikrokondo_tools.download import download as dwnld options = {"gtdb-sketch": dwnld.Constants.sketch_url, + "gtdb-shigella": dwnld.Constants.shigella_sketch, "dehost": dwnld.Constants.dehost_idx, "kraken-std": dwnld.Constants.kraken2_std, "bakta-light": dwnld.Constants.bakta_light, "bakta-full": dwnld.Constants.bakta_full} -@click.command(short_help="Download a database for mikrokondo", no_args_is_help=True) +@click.command(short_help="Download a database for mikrokondo", no_args_is_help=True, context_settings={'show_default': True}) @click.option("-f", "--file", "file", type=click.Choice(options.keys()), required = True, help="Pick an option from the list to download") -@click.option("-o", "--output", "output", default=os.getcwd(), type=click.Path(), help="An existing directory to download files too.") +@click.option("-o", "--output", "output", default=os.getcwd(), type=click.Path(), help="An existing directory to download files to.") def download(file, output): """Download a external file for use in mikrokondo. This script only downloads the file and will not untar or unzip them. """ diff --git a/src/mikrokondo_tools/cli/samplesheet/__init__.py b/src/mikrokondo_tools/cli/samplesheet/__init__.py index 61c07e1..f06c18f 100644 --- a/src/mikrokondo_tools/cli/samplesheet/__init__.py +++ b/src/mikrokondo_tools/cli/samplesheet/__init__.py @@ -6,7 +6,7 @@ from mikrokondo_tools.samplesheet import samplesheet as ss import mikrokondo_tools.utils as u -@click.command(short_help="Generate a sample sheet for mikrokondo.", no_args_is_help=True) +@click.command(short_help="Generate a sample sheet for mikrokondo.", no_args_is_help=True, context_settings={'show_default': True}) @click.option("-o", "--output-sheet", "output_sheet", required=True, type=click.Path(), help="The file to write your created output sheet to, this directory must already exist.") @click.option("-1", "--read-1-suffix", "read_1", type=click.STRING, help="A suffix to identify read 1", default="_R1_") @click.option("-2", "--read-2-suffix", "read_2", type=click.STRING, help="A suffix to identify read 2", default="_R2_") diff --git a/src/mikrokondo_tools/download/download.py b/src/mikrokondo_tools/download/download.py index 50a6f0b..b2c9a69 100644 --- a/src/mikrokondo_tools/download/download.py +++ b/src/mikrokondo_tools/download/download.py @@ -18,6 +18,7 @@ @dataclass(frozen=True) class Constants: sketch_url: str = "https://zenodo.org/records/8408361/files/GTDBSketch_20231003.msh" + shigella_sketch: str = "https://zenodo.org/records/13969103/files/EnteroRef_GTDBSketch_20231003_V2.msh" dehost_idx: str = "https://zenodo.org/records/8408557/files/PhiPacHum_m2.idx" kraken2_std: str = "https://genome-idx.s3.amazonaws.com/kraken/k2_standard_20240112.tar.gz" bakta_light: str = "https://zenodo.org/records/10522951/files/db-light.tar.gz" diff --git a/tests/download/test_download.py b/tests/download/test_download.py index 5ac9a67..02804ce 100644 --- a/tests/download/test_download.py +++ b/tests/download/test_download.py @@ -26,6 +26,8 @@ def test_constants_connection(uri): @pytest.mark.parametrize( "input_url,value", [("https://zenodo.org/records/8408361/files/GTDBSketch_20231003.msh", "GTDBSketch_20231003.msh"), + ("https://zenodo.org/records/13969103/files/EnteroRef_GTDBSketch_20231003_V2.msh", + "EnteroRef_GTDBSketch_20231003_V2.msh"), ("https://zenodo.org/records/8408557/files/PhiPacHum_m2.idx", "PhiPacHum_m2.idx"), ("https://genome-idx.s3.amazonaws.com/kraken/k2_standard_20240112.tar.gz",