From dc6c48865bd326e56c8ed19e382865ec3e3326e1 Mon Sep 17 00:00:00 2001 From: ticlla <monicaroxana.ticllaccenhua@unibas.ch> Date: Mon, 23 Sep 2019 11:47:33 -0500 Subject: [PATCH] allow running tacos with 'path/to/python -m tacos --help' --- README.md | 4 ++++ tacos/__main__.py | 4 ++++ tacos/cli.py | 6 ++++-- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 tacos/__main__.py diff --git a/README.md b/README.md index c23171f..34c8f78 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,10 @@ Run the application: $ conda activate <path/tacos_env> # if not already activated $ tacos --help ``` +or +``` +$ <path/tacos_env>/bin/python -m tacos --help # no need to activate the environment +``` To run the tests: ``` diff --git a/tacos/__main__.py b/tacos/__main__.py new file mode 100644 index 0000000..53b8076 --- /dev/null +++ b/tacos/__main__.py @@ -0,0 +1,4 @@ +from tacos import cli + +if __name__ == "__main__": + cli.tacos() \ No newline at end of file diff --git a/tacos/cli.py b/tacos/cli.py index 96d076e..9f1ea35 100644 --- a/tacos/cli.py +++ b/tacos/cli.py @@ -8,6 +8,7 @@ from tacos.distance import hamming_pool @click.group() def tacos(): pass + @tacos.command() @click.option('--ignore_gap', 'ignore_gap', is_flag=True, help='enable coding gaps(i.e indels) as missing values') @click.option('-d','--separator', 'sep', default='\t', help='field separator [default: TAB]') @@ -123,5 +124,6 @@ def distance_matrix(ignore_gap, adjust, n_jobs, type, input_, output): f.write('\n') click.echo('Finished! Computed {} pairwise distances for {} genomes.'.format(len(genome_pairs), nr_genomes)) -if __name__ == '__main__': - tacos() \ No newline at end of file + +#if __name__ == '__main__': +# tacos() \ No newline at end of file -- GitLab