Coverage for sfkit/parser.py: 100%
18 statements
« prev ^ index » next coverage.py v7.2.7, created at 2023-08-01 13:35 -0400
« prev ^ index » next coverage.py v7.2.7, created at 2023-08-01 13:35 -0400
1import argparse
4def get_parser() -> argparse.ArgumentParser:
5 parser = argparse.ArgumentParser(
6 description="Run workflow with sfkit. Start with ``sfkit auth`` to authenticate."
7 )
8 subparsers = parser.add_subparsers(dest="command")
9 subparsers.add_parser("auth", help="Authenticate with the CLI")
10 networking = subparsers.add_parser(
11 "networking", help="Set up the networking, including your IP address and any relevant ports"
12 )
13 networking.add_argument(
14 "--ports",
15 help="Comma-separated list of ports you want to use for communication for each other User respectively. In a two-party study, you only need to provide one port (e.g. 8100). For each port provided, you should be sure to open that port and the next few ports (for faster communication) in your firewall. If not provided, you may be prompted to enter a port for each participant.",
16 )
17 networking.add_argument(
18 "--ip_address",
19 help="IP address you want to use for communication. If not provided, your external IP address will be determined automatically.",
20 )
21 subparsers.add_parser("generate_keys", help="Generate your public and private cryptographic keys")
22 registerdataparser = subparsers.add_parser(
23 "register_data", help="Register and validate your data.", description="Register and validate your data."
24 )
25 registerdataparser.add_argument(
26 "--geno_binary_file_prefix",
27 help="Absolute path to the genotype binary file prefix for SF-GWAS (e.g. ``/home/username/for_sfgwas/geno/ch%d``). See https://sfkit.org/instructions#data_preparation for more details on the files you need.",
28 )
29 registerdataparser.add_argument(
30 "--data_path",
31 help="Absolute path to the data directory (files like ``pheno.txt`` and ``cov.txt`` for GWAS and ``data.txt`` for PCA) (e.g. ``/home/username/for_sfgwas``). See https://sfkit.org/instructions#data_preparation for more details on the files you need.",
32 )
33 runprotocol = subparsers.add_parser(
34 "run_protocol",
35 help="Run the protocol. When not using docker, this command will also install required dependencies and software updates as needed. As this command may be long-running, you may consider using ``nohup``, ``screen``, or ``tmux``.",
36 )
37 # runprotocol.add_argument(
38 # "--phase",
39 # help="Phase of the protocol to run (e.g. '1' for QC, 2 for PCA, 3 for Association Statistics)",
40 # )
41 runprotocol.add_argument("--demo", help="Run the demo protocol", action="store_true")
42 runprotocol.add_argument(
43 "--visualize_results", help="Visualize the results in the UI (``Yes`` or ``No``) (default is ``No``)"
44 )
45 runprotocol.add_argument(
46 "--results_path",
47 help="The path in a GCP bucket (you have access to) where you would like to send the results of the protocol (e.g. ``<bucket>/<path>``).",
48 )
49 runprotocol.add_argument("--retry", help="Retry the protocol", action="store_true")
51 return parser