Skip to content

Commit

Permalink
docs: added more informative CL messages (#18)
Browse files Browse the repository at this point in the history
*fixes typo in the help messages
  • Loading branch information
akcorut committed Aug 25, 2023
1 parent 8b12099 commit cb30745
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
4 changes: 2 additions & 2 deletions workflow/cli_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def show_help_message():
"\n kgwasflow test -t 16 -n"
"\n\n2. Run the kGWASflow test using the test config file with 16 threads:\n"
"\n kgwasflow test -t 16"
"\n\n3. Run the kGWASflow test and define the test output folder:\n"
"\n kgwasflow test -t 16 --output path/to/test_output_dir"
"\n\n3. Run the kGWASflow test and define the working directory:\n"
"\n kgwasflow test -t 16 --work-dir path/to/test_output_dir"
)
return message

Expand Down
22 changes: 21 additions & 1 deletion workflow/kgwasflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ def run(snakefile, config_file, **kwargs):
@click.command(epilog=show_help_message(), context_settings=dict(help_option_names=["-h", "--help"], ignore_unknown_options=True))
def test(snakefile, config_file, **kwargs):
"""Test kGWASflow workflow."""

click.secho("Starting kGWASflow test using the E.coli dataset...", fg="yellow")
click.secho("\nFor detailed info on this test, visit: ", fg="yellow", nl=False)
click.secho("https://github.com/akcorut/kGWASflow#testing", fg="blue", underline=True)

if kwargs.get('dryrun', False):
click.secho("\n[WARNING] This is a dryrun (flag -n or --dryrun was used)!\n", fg="magenta")

if not snakefile:
snakefile = get_snakefile()

Expand All @@ -72,6 +80,8 @@ def test(snakefile, config_file, **kwargs):
def init_workdir(work_dir):
"""Initialize a new kGWASflow working directory with default configuration files."""

click.secho("Initializing a new kGWASflow working directory... Won't take long!", fg="yellow")

config_file = get_configfile() # Get the default config.yaml file
sample_file = get_samplefile() # Get the default samples.tsv file
phenos_file = get_phenosfile() # Get the default phenos.tsv file
Expand All @@ -89,11 +99,21 @@ def init_workdir(work_dir):
os.makedirs(work_dir)
if not os.path.exists(config_path):
os.makedirs(config_path)

copyfile(config_file, config_yaml_path)
click.secho("\n[INFO] Config.yaml file has been created at: " + config_yaml_path, fg="cyan")

copyfile(sample_file, samples_tsv_path)
click.secho("[INFO] Samples.tsv file has been created at: " + samples_tsv_path, fg="cyan")

copyfile(phenos_file, phenos_tsv_path)
click.secho("[INFO] Phenos.tsv file has been created at: " + phenos_tsv_path, fg="cyan")

shutil.copytree(test_dir, new_test_dir, dirs_exist_ok=True)
click.secho("[INFO] Test directory has been created at: " + new_test_dir, fg="cyan")

click.secho("\nSuccess! kGWASflow initialization is complete! You can now run the workflow with:", fg="green")
click.secho("\nkgwasflow run (...)\n", fg="blue", bold=True)

cli.add_command(run)
cli.add_command(test)
Expand Down

0 comments on commit cb30745

Please sign in to comment.