diff --git a/q2_amr/amrfinderplus/sample_data.py b/q2_amr/amrfinderplus/sample_data.py index f63adb3..ffef175 100644 --- a/q2_amr/amrfinderplus/sample_data.py +++ b/q2_amr/amrfinderplus/sample_data.py @@ -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, diff --git a/q2_amr/amrfinderplus/tests/test_utils.py b/q2_amr/amrfinderplus/tests/test_utils.py index f464e77..efe9e05 100644 --- a/q2_amr/amrfinderplus/tests/test_utils.py +++ b/q2_amr/amrfinderplus/tests/test_utils.py @@ -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, @@ -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, @@ -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, diff --git a/q2_amr/amrfinderplus/utils.py b/q2_amr/amrfinderplus/utils.py index ee30541..8141761 100644 --- a/q2_amr/amrfinderplus/utils.py +++ b/q2_amr/amrfinderplus/utils.py @@ -13,6 +13,7 @@ def run_amrfinderplus_n( plus, report_all_equal, ident_min, + curated_ident, coverage_min, translation_table, threads, @@ -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: diff --git a/q2_amr/plugin_setup.py b/q2_amr/plugin_setup.py index 08ec28f..1838f44 100644 --- a/q2_amr/plugin_setup.py +++ b/q2_amr/plugin_setup.py @@ -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), @@ -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.",