epruesse / SINA

SINA - Reference based multiple sequence alignment
https://sina.readthedocs.io
GNU General Public License v3.0
40 stars 4 forks source link

calling SINA 1.6 from arb_edit4: positional arguments exception #84

Closed bph6212ln closed 3 years ago

bph6212ln commented 4 years ago

I have backported the SINA fix for bug # 76 to both SINA 1.5 and 1.6. When launching SINA 1.5 from within arb_edit4, the aligner runs successfully. However, when launching SINA 1.6.0 from within arb_edit4, the run fails with the error:

Configuration error: too many positional options have been specified on the command line Use "--help" to show options

It doesn't look to me from the command line in the console that there are any positional options:

sina -i : --ptdb : --ptport localhost:3076 --turn all --overhang attach --filter none --fs-min 40 --fs-msc 0.700000 --fs-max 40 --fs-req 1 --fs-req-full 1 --fs-full-len 1400 --fs-kmer-len 10 --fs-kmer-mm 0 --fs-min-len 150 --fs-weight 1 --pen-gap 5.000000 --pen-gapext 2.000000 --match-score 2.000000 --mismatch-score -1.000000 --prot-level 0 --select-file /users/rfox/.arb_tmp/tmp/sina_select_rfox_15937_0.tmp --insertion shift --lowercase none --auto-filter-field none --gene-start 0 --gene-end 0 --fs-cover-gene 1 --color --realign

I have experimented with filtering the options to try to find out what is causing the exception and from what I have been able to assess, the "--turn all" argument is what is triggering it.

epruesse commented 4 years ago

Hi @bph6212ln,

I've just tried that command line with the current SINA. It works for me. Maybe something was broken in the 1.5 or during your backport?

Since you were looking at code, this is where --turn [all|revcomp|none] is defined:

https://github.com/epruesse/SINA/blob/a73f148d30c37c4c4540de336c89896ad762fe5f/src/famfinder.cpp#L144-L148

The default_value part tells boost program options which value to set if the option is not given. The implicit_value tell it which value to use if it is given but not followed by a value. It still does accept a value.

As a workaround, a simple hack might be to intercept the command line and just remove the problematic argument. E.g. by mv sina sina.real and then adding the below as new sina script (don't forget to chmod +x sina).

#!/bin/bash

echo "Rewriting command to omit argument #8 (was '$8')" >&2
set -- "${@:1:7}" "${@:9}"

exec sina.real "$@"

(Yes, it could be a bit smarter than just always removing the 8th argument, but you get the picture. This is untested.)

epruesse commented 3 years ago

Closing as stale.