Skip to content

Commit

Permalink
consistenly use bactopia-path across subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
rpetit3 committed Apr 25, 2023
1 parent b2494a0 commit 90c83c4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## 1.0.2

Added `bactopia-datasets` to download optional datasets outside of Nextflow
- Added `bactopia-datasets` to download optional datasets outside of Nextflow
- consistently use `--bactopia-path` across sub-commands

## 1.0.1

Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ Below is the `--help` output for each subcommand.
Print out tools and citations used throughout Bactopia
╭─ Options ────────────────────────────────────────────────────────────────────────────╮
│ --version -V Show the version and exit. │
│ * --bactopia -b TEXT Directory where Bactopia repository is stored [required] │
│ --name -n TEXT Only print citation matching a given name │
│ --plain-text -p Disable rich formatting │
│ --help Show this message and exit. │
│ --version -V Show the version and exit. │
│ * --bactopia-path -b TEXT Directory where Bactopia repository is stored │
│ [required] │
│ --name -n TEXT Only print citation matching a given name │
│ --plain-text -p Disable rich formatting │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────╯
```

Expand Down Expand Up @@ -216,7 +217,7 @@ Below is the `--help` output for each subcommand.
Generate a summary table from the Bactopia results.
╭─ Required Options ───────────────────────────────────────────────────────────────────╮
│ * --bactopia -b TEXT Directory where Bactopia results are stored [required]
│ * --bactopia-path -b TEXT Directory where Bactopia results are stored [required] │
╰──────────────────────────────────────────────────────────────────────────────────────╯
╭─ Gold Cutoffs ───────────────────────────────────────────────────────────────────────╮
│ --gold-coverage -gcov INTEGER Minimum amount of coverage required for Gold │
Expand Down
6 changes: 3 additions & 3 deletions bactopia/cli/citations.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ def parse_citations(yml: str) -> list:
@click.command()
@click.version_option(bactopia.__version__, "--version", "-V")
@click.option(
"--bactopia",
"--bactopia-path",
"-b",
required=True,
help="Directory where Bactopia repository is stored",
)
@click.option("--name", "-n", help="Only print citation matching a given name")
@click.option("--plain-text", "-p", is_flag=True, help="Disable rich formatting")
def citations(bactopia: str, name: str, plain_text: bool) -> None:
def citations(bactopia_path: str, name: str, plain_text: bool) -> None:
"""Print out tools and citations used throughout Bactopia"""

citations_yml = validate_file(f"{bactopia}/citations.yml")
citations_yml = validate_file(f"{bactopia_path}/citations.yml")
citations, module_citations = parse_citations(citations_yml)

markdown = []
Expand Down
10 changes: 5 additions & 5 deletions bactopia/cli/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
click.rich_click.USE_RICH_MARKUP = True
click.rich_click.OPTION_GROUPS = {
"bactopia-summary": [
{"name": "Required Options", "options": ["--bactopia"]},
{"name": "Required Options", "options": ["--bactopia-path"]},
{
"name": "Gold Cutoffs",
"options": [
Expand Down Expand Up @@ -144,7 +144,7 @@ def process_sample(df: pd.DataFrame, rank_cutoff: dict) -> list:
@click.command()
@click.version_option(bactopia.__version__, "--version", "-V")
@click.option(
"--bactopia",
"--bactopia-path",
"-b",
required=True,
help="Directory where Bactopia results are stored",
Expand Down Expand Up @@ -274,7 +274,7 @@ def process_sample(df: pd.DataFrame, rank_cutoff: dict) -> list:
@click.option("--verbose", is_flag=True, help="Increase the verbosity of output")
@click.option("--silent", is_flag=True, help="Only critical errors will be printed")
def summary(
bactopia,
bactopia_path,
gold_coverage,
gold_quality,
gold_read_length,
Expand Down Expand Up @@ -347,8 +347,8 @@ def summary(
processed_samples = {}
versions = []
dfs = []
samples = parse_bactopia_directory(bactopia)
logging.info(f"Found {len(samples)} samples in {bactopia} to process")
samples = parse_bactopia_directory(bactopia_path)
logging.info(f"Found {len(samples)} samples in {bactopia_path} to process")
if samples:
for sample in samples:
if sample["is_bactopia"]:
Expand Down

0 comments on commit 90c83c4

Please sign in to comment.