-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Altered if clasuses around selection of commands in umi_tools.py #537
Changes from 5 commits
0470bdb
0762a0a
16fa2fe
82a44f0
9302f51
525c38b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
''' | ||
umi_tools.py - Tools for UMI analyses | ||
=============================================== | ||
===================================== | ||
|
||
:Author: Tom Smith & Ian Sudbury, CGAT | ||
:Release: $Id$ | ||
:Date: |today| | ||
:Tags: Genomics UMI | ||
|
||
There are 6 tools: | ||
|
@@ -50,12 +48,22 @@ def main(argv=None): | |
|
||
return | ||
|
||
elif argv[2] in ["--help", "-h", "--help-extended"]: | ||
elif len(argv) > 2 and argv[2] in ["--help", "-h", "--help-extended"]: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this elif can be removed. The tools all have -h/--help/--help-extended options so no need to catch anything here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My guess is that this was added because the standard There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, maybe. On a related note, the |
||
print("UMI-Tools: Version %s" % __version__) | ||
|
||
command = argv[1] | ||
|
||
module = importlib.import_module("umi_tools." + command, "umi_tools") | ||
try: | ||
module = importlib.import_module("umi_tools." + command, "umi_tools") | ||
except ImportError: | ||
print("Command %s not recognosied" % command) | ||
print() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lazy way to add a blank line 😬 |
||
print("For full UMI-tools documentation, see: " | ||
"https://umi-tools.readthedocs.io/en/latest/\n") | ||
print(globals()["__doc__"]) | ||
|
||
return (1) | ||
|
||
# remove 'umi-tools' from sys.argv | ||
del sys.argv[0] | ||
module.main(sys.argv) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy with this to catch use of tool with no options