Skip to content

Commit

Permalink
added cureated_indet as parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
VinzentRisch committed Jul 16, 2024
1 parent a1abc26 commit 06e809a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions q2_amr/amrfinderplus/sample_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def annotate_sample_data_amrfinderplus(
plus: bool = False,
report_all_equal: bool = False,
ident_min: float = None,
curated_ident: bool = False,
coverage_min: float = 0.5,
translation_table: str = "11",
threads: int = None,
Expand Down
4 changes: 4 additions & 0 deletions q2_amr/amrfinderplus/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def test_run_amrfinderplus_n(self, mock_run_command):
plus=True,
report_all_equal=True,
ident_min=1,
curated_ident=False,
coverage_min=1,
translation_table="11",
threads=4,
Expand Down Expand Up @@ -73,6 +74,7 @@ def test_run_amrfinderplus_n_minimal(self, mock_run_command):
plus=False,
report_all_equal=False,
ident_min=None,
curated_ident=True,
coverage_min=None,
translation_table=None,
threads=None,
Expand All @@ -85,6 +87,8 @@ def test_run_amrfinderplus_n_minimal(self, mock_run_command):
"-o",
"path_dir/amr_annotations.tsv",
"--print_node",
"--ident_min",
"-1",
],
"path_dir",
verbose=True,
Expand Down
5 changes: 4 additions & 1 deletion q2_amr/amrfinderplus/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def run_amrfinderplus_n(
plus,
report_all_equal,
ident_min,
curated_ident,
coverage_min,
translation_table,
threads,
Expand Down Expand Up @@ -60,8 +61,10 @@ def run_amrfinderplus_n(
cmd.append("--plus")
if report_all_equal:
cmd.append("--report_all_equal")
if ident_min:
if ident_min and not curated_ident:
cmd.extend(["--ident_min", str(ident_min)])
if curated_ident:
cmd.extend(["--ident_min", "-1"])
if coverage_min:
cmd.extend(["--coverage_min", str(coverage_min)])
if translation_table:
Expand Down
11 changes: 7 additions & 4 deletions q2_amr/plugin_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,8 @@
"organism": Str % Choices(organisms),
"plus": Bool,
"report_all_equal": Bool,
"ident_min": Float % Range(-1, 1, inclusive_start=True, inclusive_end=True),
"ident_min": Float % Range(0, 1, inclusive_start=True, inclusive_end=True),
"curated_ident": Bool,
"coverage_min": Float % Range(0, 1, inclusive_start=True, inclusive_end=True),
"translation_table": Str % Choices(translation_tables),
"threads": Int % Range(0, None, inclusive_start=False),
Expand All @@ -1180,11 +1181,13 @@
"and Name of closest sequence will be different showing "
"each of the database proteins that are equally close to "
"the query sequence.",
"ident_min": "Minimum identity for a blast-based hit hit (Methods BLAST or "
"PARTIAL). -1 means use the curated threshold if it exists and "
"0.9 otherwise. Setting this value to something other than -1 "
"ident_min": "Minimum identity for a blast-based hit (Methods BLAST or "
"PARTIAL). Setting this value to something other than -1 "
"will override curated similarity cutoffs. We only recommend "
"using this option if you have a specific reason.",
"curated_ident": "Use the curated threshold for a blast-based hit, if it "
"exists and 0.9 otherwise. This will overwrite the value specified with the "
"'ident_min' parameter",
"coverage_min": "Minimum proportion of reference gene covered for a "
"BLAST-based hit (Methods BLAST or PARTIAL).",
"translation_table": "Translation table used for BLASTX.",
Expand Down

0 comments on commit 06e809a

Please sign in to comment.