Skip to content

Commit

Permalink
allow params in the yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
rpetit3 committed Aug 25, 2024
1 parent adf12ee commit ee9c7f8
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 8 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@

# Changelog

## v1.0.2 rpetit3/camlhmp "Wild Bactrian" 2024/08/25

### `Added`

- allow `min-coverage` and `min-coverage` params to be set in the yaml
- Priority:
- user provided command line arguments (`--min-pident` and `--min-coverage`)
- schema provided values
- default values specified in the command script

## v1.0.1 rpetit3/camlhmp "Bactrian" 2024/08/25

### `Added`
Expand Down
11 changes: 10 additions & 1 deletion camlhmp/cli/blast/alleles.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,19 @@ def camlhmp_blast_alleles(
file_exists_error(blast_tsv, force)
file_exists_error(details_tsv, force)

# Check if params are set in the YAML (only change if not set on the command line)
if "--min-pident" not in sys.argv:
if "min_pident" in framework["engine"]["params"]:
min_pident = framework["engine"]["params"]["min_pident"]
if "--min-coverage" not in sys.argv:
if "min_coverage" in framework["engine"]["params"]:
min_coverage = framework["engine"]["params"]["min_coverage"]


# Describe the command line arguments
console = rich.console.Console(stderr=True)
print(
"[italic]Running [deep_sky_blue1]camlhmp[/deep_sky_blue1] with following parameters:[/italic]",
"[italic]Running [deep_sky_blue1]camlhmp-blast-alleless[/deep_sky_blue1] with following parameters:[/italic]",
file=sys.stderr,
)
print(f"[italic] --input {input}[/italic]", file=sys.stderr)
Expand Down
8 changes: 8 additions & 0 deletions camlhmp/cli/blast/regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ def camlhmp_blast_regions(
file_exists_error(blast_tsv, force)
file_exists_error(details_tsv, force)

# Check if params are set in the YAML (only change if not set on the command line)
if "--min-pident" not in sys.argv:
if "min_pident" in framework["engine"]["params"]:
min_pident = framework["engine"]["params"]["min_pident"]
if "--min-coverage" not in sys.argv:
if "min_coverage" in framework["engine"]["params"]:
min_coverage = framework["engine"]["params"]["min_coverage"]

# Describe the command line arguments
console = rich.console.Console(stderr=True)
print(
Expand Down
9 changes: 9 additions & 0 deletions camlhmp/cli/blast/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ def camlhmp_blast_targets(
file_exists_error(blast_tsv, force)
file_exists_error(details_tsv, force)

# Check if params are set in the YAML (only change if not set on the command line)
if "--min-pident" not in sys.argv:
if "min_pident" in framework["engine"]["params"]:
min_pident = framework["engine"]["params"]["min_pident"]
if "--min-coverage" not in sys.argv:
if "min_coverage" in framework["engine"]["params"]:
min_coverage = framework["engine"]["params"]["min_coverage"]


# Describe the command line arguments
console = rich.console.Console(stderr=True)
print(
Expand Down
16 changes: 10 additions & 6 deletions docs/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ metadata:
# engine: specifies the computational tools and additional parameters used for sequence
# analysis.
engine:
type: "" # The type of tool used to generate the data
tool: "" # The tool used to generate the data
type: "" # The type of tool used to generate the data
tool: "" # The tool used to generate the data
params: {} # Additional parameters for the tool
min_pident: int # Minimum percent identity for the tool
min_coverage: int # Minimum percent coverage for the tool

# targets: Lists the specific sequence targets such as genes, proteins, or markers that the
# schema will analyze. These should be included in the associated sequence query data
Expand Down Expand Up @@ -66,10 +69,11 @@ The `metadata` section provides general information about the schema. This inclu

The `engine` section specifies the computational tools used for sequence analysis.

| Field | Type | Description |
|-------|--------|--------------------------------------------------|
| type | string | The type of engine used for analysis |
| tool | string | The specific tool to be used for the engine |
| Field | Type | Description |
|--------|--------|------------------------------------------------------|
| type | string | The type of engine used for analysis |
| tool | string | The specific tool to be used for the engine |
| params | dict | Additional parameters for the tool to use as default |

## targets

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "camlhmp"
version = "1.0.1"
version = "1.0.2"
description = "Classification through yAML Heuristic Mapping Protocol"
authors = [
"Robert A. Petit III <[email protected]>",
Expand Down

0 comments on commit ee9c7f8

Please sign in to comment.