Continuation of refactoring package name

This commit is contained in:
Harrison Deng 2025-01-22 18:44:58 +00:00
parent 47c8951916
commit 706f127195
6 changed files with 25 additions and 25 deletions

View File

@ -1,12 +1,12 @@
# autoBIGSst.CLI
# autoBIGS.CLI
A command-line interface based program that allows quickly batched requests for obtaining MLST profiles on multiple FASTA sequences and exporting it as a convenient CSV.
This program is simply a command-line interface for [autoBIGSst.Engine](https://pypi.org/project/autoBIGSst.engine).
This program is simply a command-line interface for [autoBIGS.Engine](https://pypi.org/project/autoBIGS.engine).
## Features
This CLI is capable of exactly what [autoBIGSst.Engine](https://pypi.org/project/autoBIGSst.engine) is capable of:
This CLI is capable of exactly what [autoBIGS.Engine](https://pypi.org/project/autoBIGS.engine) is capable of:
- Import multiple FASTA files
- Fetch the available BIGSdb databases that is currently live and available
- Fetch the available BIGSdb database schemas for a given MLST database
@ -18,22 +18,22 @@ This CLI is capable of exactly what [autoBIGSst.Engine](https://pypi.org/project
This CLI can be installed with `pip`. Please ensure [pip is installed](https://pip.pypa.io/en/stable/installation/). Then:
1. Run `pip install autoBIGSst-cli` to install the latest version of the CLI for autoBIGSst.
1. Run `pip install autoBIGS-cli` to install the latest version of the CLI for autoBIGS.
2. Once installation is complete, run `autoBIGSst --version` to test that the installation succeeded (and that you are running the appropriate version).
2. Once installation is complete, run `autoBIGS --version` to test that the installation succeeded (and that you are running the appropriate version).
3. Run `autoBIGSst -h` to get information on how to get started.
3. Run `autoBIGS -h` to get information on how to get started.
### Example
Let's say you have a fasta called `seq.fasta` which contains several sequences. You know all sequences in `seq.fasta` are Bordetella pertussis sequences, and you know you have the sequences for the necessary targets of your schema in each of them. You want to retrieve MLST profiles for all of them. This can be done by:
1. Running `autoBIGSst info -l` to list all available `seqdef` databases and find the database associated with Bordetella (you should see one called `pubmlst_bordetella_seqdef`).
1. Running `autobigs info -l` to list all available `seqdef` databases and find the database associated with Bordetella (you should see one called `pubmlst_bordetella_seqdef`).
2. Then, run `autoBIGSst info -lschema pubmlst_bordetella_seqdef` to get the available typing schemas and their associated IDs. In this example, let's assume we want a normal MLST scheme. In this case, we would pay attention to the number next to `MLST` (it should be `3`).
2. Then, run `autobigs info -lschema pubmlst_bordetella_seqdef` to get the available typing schemas and their associated IDs. In this example, let's assume we want a normal MLST scheme. In this case, we would pay attention to the number next to `MLST` (it should be `3`).
3. Then, run `autoBIGSst st -h` and familiarize yourself with the parameters needed for sequence typing.
3. Then, run `autobigs st -h` and familiarize yourself with the parameters needed for sequence typing.
4. Namely, you should find that you will need to run `autoBIGSst st seq.fasta pubmlst_bordetella_seqdef 3 output.csv`. You can optionally include multiple `FASTA` files, and/or `--exact` to only retrieve exact sequence types, and/or `--stop-on-fail` to stop typing if one of your sequences fail to retrieve any type.
4. Namely, you should find that you will need to run `autobigs st seq.fasta pubmlst_bordetella_seqdef 3 output.csv`. You can optionally include multiple `FASTA` files, and/or `--exact` to only retrieve exact sequence types, and/or `--stop-on-fail` to stop typing if one of your sequences fail to retrieve any type.
5. Sit tight, and wait. The `output.csv` will contain your results once completed.

View File

@ -3,18 +3,18 @@ requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"
[project]
name = "autoBIGSst.cli"
name = "autoBIGS.cli"
dynamic = ["version"]
readme = "README.md"
dependencies = [
"autoBIGSst-engine"
"autoBIGS-engine"
]
requires-python = ">=3.11"
description = "A CLI tool to rapidly fetch fetch MLST profiles given sequences for various diseases."
[project.scripts]
autoBIGSst = "autoBIGSst.cli.program:run"
autoBIGS = "autoBIGS.cli.program:run"
[tool.setuptools_scm]

View File

@ -4,4 +4,4 @@ pytest-cov
build
twine
setuptools_scm
autoBIGSst-engine
autoBIGS-engine

View File

@ -1,6 +1,6 @@
from argparse import ArgumentParser, Namespace
import asyncio
from autoBIGSst.engine.data.remote.databases.bigsdb import BIGSdbIndex
from autoBIGS.engine.data.remote.databases.bigsdb import BIGSdbIndex
def setup_parser(parser: ArgumentParser):
parser.description = "Fetches the latest BIGSdb MLST database definitions."

View File

@ -3,8 +3,8 @@ from importlib import metadata
from os import path
import os
from autoBIGSst.cli import info, st
from autoBIGSst.cli.meta import get_module_base_name
from autoBIGS.cli import info, st
from autoBIGS.cli.meta import get_module_base_name
import importlib
root_parser = argparse.ArgumentParser(epilog='Use "%(prog)s info -h" to learn how to get available MLST databases, and their available schemas.'
@ -20,17 +20,17 @@ root_parser.add_argument(
action="store_true",
default=False,
required=False,
help="Displays the autoBIGSst.CLI version, and the autoBIGSst.Engine version."
help="Displays the autoBIGS.CLI version, and the autoBIGS.Engine version."
)
def run():
args = root_parser.parse_args()
if args.version:
print(f'autoBIGSst.CLI is running version {
metadata.version("autoBIGSst-cli")}.')
print(f'autoBIGSst.Engine is running version {
metadata.version("autoBIGSst-engine")}.')
print(f'autoBIGS.CLI is running version {
metadata.version("autoBIGS-cli")}.')
print(f'autoBIGS.Engine is running version {
metadata.version("autoBIGS-engine")}.')
if hasattr(args, "run"):
args.run(args)

View File

@ -2,9 +2,9 @@
from argparse import ArgumentParser, Namespace
import asyncio
import datetime
from autoBIGSst.engine.data.local.csv import write_mlst_profiles_as_csv
from autoBIGSst.engine.data.local.fasta import read_multiple_fastas
from autoBIGSst.engine.data.remote.databases.bigsdb import BIGSdbIndex
from autoBIGS.engine.data.local.csv import write_mlst_profiles_as_csv
from autoBIGS.engine.data.local.fasta import read_multiple_fastas
from autoBIGS.engine.data.remote.databases.bigsdb import BIGSdbIndex
def setup_parser(parser: ArgumentParser):