Updated CLI to follow APIs specified by the 0.12.0 engine
Some checks failed
automlst.cli/pipeline/head This commit looks good
automlst.cli/pipeline/tag There was a failure building this commit

This commit is contained in:
Harrison Deng 2025-02-18 16:33:08 +00:00
parent 1f6023b06b
commit e2f19acd5a
6 changed files with 8 additions and 5 deletions

View File

@ -12,7 +12,7 @@
// "forwardPorts": [], // "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created. // Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip3 install --user -r requirements.txt", "postCreateCommand": "pip3 install --user -r requirements.txt && pip install -e .",
"customizations": { "customizations": {
"vscode": { "vscode": {
"extensions": [ "extensions": [

1
.gitignore vendored
View File

@ -212,3 +212,4 @@ pyrightconfig.json
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option) # Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
out.csv

View File

@ -8,7 +8,7 @@ dynamic = ["version"]
readme = "README.md" readme = "README.md"
license = {file = "LICENSE"} license = {file = "LICENSE"}
dependencies = [ dependencies = [
"autoBIGS-engine==0.11.*" "autoBIGS-engine==0.12.*"
] ]
requires-python = ">=3.12" requires-python = ">=3.12"
description = "A CLI tool to rapidly fetch fetch MLST profiles given sequences for various diseases." description = "A CLI tool to rapidly fetch fetch MLST profiles given sequences for various diseases."

View File

@ -4,4 +4,4 @@ pytest-cov
build build
twine twine
setuptools_scm setuptools_scm
autoBIGS.engine==0.11.* autoBIGS.engine

View File

@ -31,15 +31,17 @@ async def run(args: Namespace):
async with BIGSdbIndex() as bigsdb_index: async with BIGSdbIndex() as bigsdb_index:
if args.list_dbs: if args.list_dbs:
known_seqdef_dbs = await bigsdb_index.get_known_seqdef_dbs(force=False) known_seqdef_dbs = await bigsdb_index.get_known_seqdef_dbs(force=False)
print("The following are all known BIGS database names (sorted alphabetically):")
print("\n".join(sorted(known_seqdef_dbs.keys()))) print("\n".join(sorted(known_seqdef_dbs.keys())))
for bigsdb_schema_name in args.list_bigsdb_schemas: for bigsdb_schema_name in args.list_bigsdb_schemas:
schemas = await bigsdb_index.get_schemas_for_seqdefdb(bigsdb_schema_name) schemas = await bigsdb_index.get_schemas_for_seqdefdb(bigsdb_schema_name)
print("The following are the known schemas for \"{0}\", and their associated IDs:".format(bigsdb_schema_name))
for schema_desc, schema_id in schemas.items(): for schema_desc, schema_id in schemas.items():
print(f"{schema_desc}: {schema_id}") print(f"{schema_desc}: {schema_id}")
if not (args.list_dbs or len(args.list_bigsdb_schemas) > 0): if not (args.list_dbs or len(args.list_bigsdb_schemas) > 0):
print("Nothing to do. Try specifying \"-l\".") print("Nothing to do. Try specifying \"-l\" for a list of known databases, or \"-h\" for more information.")
def run_asynchronously(args: Namespace): def run_asynchronously(args: Namespace):
asyncio.run(run(args)) asyncio.run(run(args))

View File

@ -53,7 +53,7 @@ async def run(args: Namespace):
mlst_profiles = mlst_profiler.profile_multiple_strings(gen_strings) mlst_profiles = mlst_profiler.profile_multiple_strings(gen_strings)
failed = await write_mlst_profiles_as_csv(mlst_profiles, args.out) failed = await write_mlst_profiles_as_csv(mlst_profiles, args.out)
if len(failed) > 0: if len(failed) > 0:
print(f"A total of {len(failed)} IDs failed:\n{"\n".join(failed)}") print(f"A total of {len(failed)} IDs failed (no profile found):\n{"\n".join(failed)}")
print(f"Completed fetching MLSTs for {len(args.fastas)} sequences.") print(f"Completed fetching MLSTs for {len(args.fastas)} sequences.")
def run_asynchronously(args): def run_asynchronously(args):