Open aggreen opened 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
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
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:
The ability to just execute a config file without any config overrides (so just evcouplings
Each pipeline that gets a subcommand should now get their own input verification + config substitution function (equivalent to Anna's points 1) & 2) above),
One should also check you're not putting a complexes config through the monomer subcommand asf (could be done generically without needing to check in each verification function, see next point)
Ideally, this would be implemented as generically as possible so one can easily define new subcommands that go with new pipelines, and all one needs to do is to define a new verification/substitution function; while the rest of the machinery (config unrolling + execution) just happens the same way for all subcommands and for a general run without overrides
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: