torognes / swarm

A robust and fast clustering method for amplicon-based studies
GNU Affero General Public License v3.0
123 stars 23 forks source link

restrict -x usage to d > 1 #153

Closed frederic-mahe closed 4 years ago

frederic-mahe commented 4 years ago

The option --disable-sse3 (or -x) disables SSE3 and any other x86 extensions beyond SSE2 (which is always present on x86_64). SSE3 is only used when d > 1.

so, should swarm output an error or a warning if -x is used with d < 2?

This is what swarm does when the fastidious option is used out of context:

Error: Fastidious mode (specified with -f or --fastidious) only works 
when the resolution (specified with -d or --differences) is 1.

Silently accepting options that make no sense is ok, but in the long run I think it would benefit users if swarm requires "clean option sets". At the very least, users will have a clearer understanding of each option's role. We could have something like that:

Error: --disable-sse3 or -x has no effect when d = 1 or d = 0 
(SSE3 instructions are only used when d > 1).
frederic-mahe commented 4 years ago

Test could be:

printf ">s1_1\nA\n>s2_1\nT\n"   | swarm -d 1 -x  # FAIL
printf ">s1_1\nAA\n>s2_1\nTT\n" | swarm -d 2 -x  # PASS
torognes commented 4 years ago

Added now in commit a1884502e2f1356989c287d20127927f16358f39.