Skip to content

Commit

Permalink
move params to the YAML files
Browse files Browse the repository at this point in the history
  • Loading branch information
rpetit3 committed Aug 25, 2024
1 parent c99add1 commit 5d063ff
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 8 deletions.
35 changes: 35 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,9 +1,44 @@
# Changelog

## v1.2.0 rpetit3/sccmec "" 2024/08/25

- Utilize both targets and full cassettes for classification
- update default thresholds based on `camlhmp-blast-thresholds`
- `--min-targets-pident` 90
- `--min-targets-coverage` 80
- `--min-regions-pident` 85
- `--min-regions-coverage` 83
- default values are set in YAMLs

## v1.1.0 rpetit3/sccmec "USA300" 2024/08/15

- Update for latest camlhmp changes

## v1.0.0 rpetit3/sccmec "MRSA" 2024/04/30

- Initial release

@click.option(
"--min-targets-pident",
default=90,
show_default=True,
help="Minimum percent identity of targets to count a hit",
)
@click.option(
"--min-targets-coverage",
default=80,
show_default=True,
help="Minimum percent coverage of targets to count a hit",
)
@click.option(
"--min-regions-pident",
default=85,
show_default=True,
help="Minimum percent identity of regions to count a hit",
)
@click.option(
"--min-regions-coverage",
default=83,
show_default=True,
help="Minimum percent coverage of regions to count a hit",
)
31 changes: 23 additions & 8 deletions bin/sccmec
Original file line number Diff line number Diff line change
Expand Up @@ -72,31 +72,31 @@ click.rich_click.OPTION_GROUPS = {
"--yaml-targets",
"-yt",
required=True,
default=os.environ.get("CAML_YAML", None),
default=os.environ.get("SCCMEC_TARGETS_YAML", None),
show_default=True,
help="YAML file documenting the targets and types",
)
@click.option(
"--yaml-regions",
"-yr",
required=True,
default=os.environ.get("CAML_YAML", None),
default=os.environ.get("SCCMEC_REGIONS_YAML", None),
show_default=True,
help="YAML file documenting the regions and types",
)
@click.option(
"--targets",
"-t",
required=False if "--version" in sys.argv else True,
default=os.environ.get("CAML_TARGETS", None),
default=os.environ.get("SCCMEC_TARGETS_FASTA", None),
show_default=True,
help="Query targets in FASTA format",
)
@click.option(
"--regions",
"-r",
required=False if "--version" in sys.argv else True,
default=os.environ.get("CAML_TARGETS", None),
default=os.environ.get("SCCMEC_REGIONS_FASTA", None),
show_default=True,
help="Query regions in FASTA format",
)
Expand All @@ -118,25 +118,25 @@ click.rich_click.OPTION_GROUPS = {
)
@click.option(
"--min-targets-pident",
default=95,
default=90,
show_default=True,
help="Minimum percent identity of targets to count a hit",
)
@click.option(
"--min-targets-coverage",
default=95,
default=80,
show_default=True,
help="Minimum percent coverage of targets to count a hit",
)
@click.option(
"--min-regions-pident",
default=95,
default=85,
show_default=True,
help="Minimum percent identity of regions to count a hit",
)
@click.option(
"--min-regions-coverage",
default=95,
default=83,
show_default=True,
help="Minimum percent coverage of regions to count a hit",
)
Expand Down Expand Up @@ -219,6 +219,21 @@ def sccmec(
file_exists_error(regions_blast_tsv, force)
file_exists_error(regions_details_tsv, force)

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

if "--min-regions-pident" not in sys.argv:
if "min_pident" in regions_framework["engine"]["params"]:
min_pident = regions_framework["engine"]["params"]["min_pident"]
if "--min-regions-coverage" not in sys.argv:
if "min_coverage" in regions_framework["engine"]["params"]:
min_coverage = regions_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 bin/sccmec-bioconda
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
sccmec_dir=$(dirname $0)

SCCMEC_TARGETS_YAML="${sccmec_dir}/../share/sccmec/sccmec-targets.yaml" \
SCCMEC_TARGETS_FASTA="${sccmec_dir}/../share/sccmec/sccmec-targets.fasta" \
SCCMEC_REGIONS_YAML="${sccmec_dir}/../share/sccmec/sccmec-regions.yaml" \
SCCMEC_REGIONS_FASTA="${sccmec_dir}/../share/sccmec/sccmec-regions.fasta" \
sccmec-main \
"${@:1}"
3 changes: 3 additions & 0 deletions data/sccmec-regions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ metadata:
engine:
type: "blast" # The type of engine to use
tool: blastn # The tool used to generate the data
params:
min_pident: 85 # The minimum percent identity for a hit
min_coverage: 83 # The minimum coverage for a hit

# targets provides a list of sequence targets (primers, genes, proteins, etc...)
targets:
Expand Down
3 changes: 3 additions & 0 deletions data/sccmec-targets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ metadata:
engine:
type: "blast" # The type of engine to use
tool: blastn # The tool used to generate the data
params:
min_pident: 90 # The minimum percent identity for a hit
min_coverage: 80 # The minimum coverage for a hit

# targets provides a list of sequence targets (primers, genes, proteins, etc...)
targets:
Expand Down

0 comments on commit 5d063ff

Please sign in to comment.