Skip to content

Commit

Permalink
small command line interface, and added reqs to setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzbuck committed Sep 18, 2020
1 parent 9e25854 commit b87ab9e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
13 changes: 8 additions & 5 deletions mOTUlizer/bin/mOTUlize.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from mOTUlizer.utils import *
from mOTUlizer.classes.MetaBin import MetaBin
from mOTUlizer.classes.mOTU import mOTU
from mOTUlizer import __version__

#from mOTUlizer.config import *

Expand Down Expand Up @@ -130,7 +131,7 @@ def main(args):
parser = argparse.ArgumentParser(prog = "mOTUlize", description=description_text, epilog = "Let's do this")
parser.add_argument('--output', '-o', nargs = '?', help = "send output to this file")
parser.add_argument('--force', '-f', action='store_true', help = "force execution answering default answers")
parser.add_argument('--checkm', '-k',nargs = '?', help = "checkm file (or whatever you want to use as completness)", required=True)
parser.add_argument('--checkm', '-k',nargs = '?', help = "checkm file (or whatever you want to use as completness)")
parser.add_argument('--similarities', '-I', nargs = '?', help = "file containing similarities between MAGs, if not provided, will use fastANI to compute one")
parser.add_argument('--fnas','-F', nargs = '*', help = "list of nucleotide fasta-files of MAGs or whatnot")
parser.add_argument('--prefix', '-n', nargs = '?', default = "mOTU_", help = "prefix for the mOTU names, default : mOTU_ ")
Expand All @@ -146,13 +147,15 @@ def main(args):

args = parser.parse_args()

if len(sys.argv)==1:
if len(sys.argv)==1 or args.version:
parser.print_help(sys.stderr)
print("{script} Version {version}".format(script = __file__, version = __version__))
sys.exit(1)

if not args.checkm:
print("mOTUlize: error: the following arguments are required: --checkm/-k")
sys.exit(1)

if args.version:
print("{script} Version {version}".format(script = __file__, version = __version__))
sys.exit()

# print(args, file=sys.stderr)

Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
long_description_content_type="text/markdown",
url="https://github.com/moritzbuck/0039_mOTUlizer/",
packages=setuptools.find_packages(),
install_requires = [
"igraph"
],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
Expand Down

0 comments on commit b87ab9e

Please sign in to comment.