Skip to content

Commit 5105778

Browse files
committed
Limit maxiterate and retree params to range
1 parent 38fb3a8 commit 5105778

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

q2_alignment/_mafft.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,10 @@ def _mafft(sequences_fp, alignment_fp, n_threads, parttree, addfragments,
110110
if strategy:
111111
cmd += [("--" + strategy)]
112112

113-
# --maxiterate is set to 0 by default, so we only pass this argument onto
114-
# MAFFT if it deviates from this value.
115-
if maxiterate not in (None, 0):
113+
if maxiterate is not None:
116114
cmd += ['--maxiterate', str(maxiterate)]
117115

118-
# --retree is set to 2 by default, so we only pass this argument onto
119-
# MAFFT if it deviates from this value.
120-
if retree not in (None, 2):
116+
if retree is not None:
121117
cmd += ['--retree', str(retree)]
122118

123119
if alignment_fp is not None:

q2_alignment/plugin_setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"strategy": Str % Choices({
2020
"auto", "nofft", "globalpair", "localpair", "genafpair",
2121
}),
22-
"maxiterate": Int,
23-
"retree": Int,
22+
"maxiterate": Int % Range(0, None),
23+
"retree": Int % Range(0, None),
2424
}
2525
mafft_param_descriptions = {
2626
"n_threads": "The number of threads. (Use `auto` to automatically use "

0 commit comments

Comments
 (0)