-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #732 from haddocking/haddock3_restraints
Haddock3 restraints
- Loading branch information
Showing
10 changed files
with
1,134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ tox==3.24.5 | |
pandas==1.5.1 | ||
plotly==5.11.0 | ||
kaleido==0.2.1 | ||
freesasa==2.2.0.post3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
""" | ||
HADDOCK3 CLI for restraints-related tasks. | ||
DISCLAIMER: these scripts have been ported from old code and are not | ||
optimized for code quality and performance. They are provided as a convenience | ||
for the user. | ||
USAGE:: | ||
haddock3-restraints <TASK_NAME> <TASK_ARGS> | ||
For the list of available tasks, run:: | ||
haddock3-restraints -h | ||
For the list of arguments for a given task, run:: | ||
haddock3-restraints <TASK_NAME> -h | ||
""" | ||
import argparse | ||
import sys | ||
|
||
from haddock.restraints.restrain_bodies import add_restrain_bodies_arguments, restrain_bodies | ||
from haddock.restraints.passive_from_active import add_pass_from_act_arguments, passive_from_active | ||
from haddock.restraints.validate_tbl import add_validate_tbl_arguments, validate_tbl | ||
from haddock.restraints.active_passive_to_ambig import add_actpass_to_ambig_arguments, actpass_to_ambig | ||
|
||
|
||
# Command line interface parser | ||
ap = argparse.ArgumentParser( | ||
prog="haddock3-restraints", | ||
description=__doc__, | ||
formatter_class=argparse.RawDescriptionHelpFormatter, | ||
) | ||
|
||
subparsers = ap.add_subparsers(title='subcommands', | ||
description='valid subcommands', | ||
help='additional help') | ||
|
||
# restrain_bodies subcommand | ||
restrain_bodies_subcommand = subparsers.add_parser('restrain_bodies') | ||
restrain_bodies_subcommand.set_defaults(func=restrain_bodies) | ||
restrain_bodies_subcommand = add_restrain_bodies_arguments(restrain_bodies_subcommand) | ||
|
||
# passive_from_active subcommand | ||
pass_from_act_subcommand = subparsers.add_parser('passive_from_active') | ||
pass_from_act_subcommand.set_defaults(func=passive_from_active) | ||
pass_from_act_subcommand = add_pass_from_act_arguments(pass_from_act_subcommand) | ||
|
||
# validate_tbl subcommand | ||
validate_tbl_subcommand = subparsers.add_parser('validate_tbl') | ||
validate_tbl_subcommand.set_defaults(func=validate_tbl) | ||
validate_tbl_subcommand = add_validate_tbl_arguments(validate_tbl_subcommand) | ||
|
||
# active_passive_to_ambig subcommand | ||
actpass_to_ambig_subcommand = subparsers.add_parser('active_passive_to_ambig') | ||
actpass_to_ambig_subcommand.set_defaults(func=actpass_to_ambig) | ||
actpass_to_ambig_subcommand = add_actpass_to_ambig_arguments(actpass_to_ambig_subcommand) | ||
|
||
|
||
def _ap(): | ||
return ap | ||
|
||
|
||
def load_args(ap): | ||
"""Load argument parser args.""" | ||
return ap.parse_args() | ||
|
||
|
||
def maincli(): | ||
"""Execute main client.""" | ||
args = ap.parse_args() | ||
cmd = vars(load_args(ap)) | ||
cmd.pop("func") | ||
args.func(**cmd) | ||
|
||
|
||
if __name__ == "__main__": | ||
sys.exit(maincli()) |
Oops, something went wrong.