debbiemarkslab / EVcouplings

Evolutionary couplings from protein and RNA sequence alignments
http://evcouplings.org
Other
226 stars 75 forks source link

user-proof command line options for EVcomplex #117

Open aggreen opened 6 years ago

aggreen commented 6 years ago

Adam brought to my attention today that users are allowed to supply some command line options that are nonsensical for the complex pipeline. This leads to errors upon execution.

For example:

If you use the -b flag in the command line to change bitscores, but supply a complexes config file, the pipeline will fail when it tries to overwrite config["align"]["use_bitscores"] because the align stage is not part of the complexes pipeline.

Fixing this issue will entail:

  1. Figuring out all such options from the monomer pipeline that are nonsensical or lead to errors in the complexes pipeline
  2. Catching them with proper checking and prompting the user not to specify those options.
b-schubert commented 6 years ago

Another solution could be subcommands that change the other command line behavior a la:

evcouplings monomer ....

ecvouplings complex ...

See: https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_subparsers

thomashopf commented 6 years ago

Yep: https://github.com/debbiemarkslab/EVcouplings/blob/develop/evcouplings/utils/app.py#L7 ;)

Conceptually, there are two points here which go a bit mishmash in the current implementation: 1) evcouplings is a generic config file runner that has to be able to run any pipeline specified in the config (right now, this is evcouplings , plus the --yolo flag) 2) Most additional flags are convenience-only config overrides specific to the monomer pipeline and weren't intended to generalize to complexes

I was briefly debating with myself when I first wrote this whether to already use a subcommand or individual app names for 2) but eventually discarded it. But now with complexes available it is definitely the time to improve this behaviour.

I agree with @b-schubert that subcommands are probably the nicest way of doing this (one could also think about individual app names, but I nowadays find subcommands are the better solution). The click package used for the command-line parsing has good support for this.

Here's a couple of thoughts regarding an implementation: