-
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
Conversation
umi_tools/Utilities.py
Outdated
@@ -1030,7 +1030,7 @@ def Start(parser=None, | |||
|
|||
if return_parser: | |||
return parser | |||
|
|||
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.
Is that just a tab added?
umi_tools/count_tab.py
Outdated
@@ -86,12 +86,17 @@ def main(argv=None): | |||
|
|||
if argv is None: | |||
argv = 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.
Another tab to remove?
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.
There are a few of these in the PR. One in each tool it looks like. Unless I'm missunderstanding the github diff markup.
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.
I don't think you are misunderstanding.
# setup command line parser | ||
parser = U.OptionParser(version="%prog version: $Id$", | ||
usage=usage, | ||
description=globals()["__doc__"]) | ||
|
||
if len(argv) == 1: |
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
@@ -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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
My guess is that this was added because the standard --help
within each tool doesn't output the version number?
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.
Ah, maybe.
On a related note, the --version
options for each tool also don't properly return the version. Should probably just remove that option from the tools and make it available via umi_tools --version
only
Hey @IanSudbery. Assuming you're referring to the below and the line numbers are from this PR? UMI-tools/umi_tools/umi_tools.py Lines 53 to 54 in 0c72fa9
I'm not sure what was going on with that elif either. It looks like I added it when we split into multiple tools to print help when a tool is specified and then you changed the output to be the version number (0101494 ). Regardless, each tool command line has help options added so no need to catch it in I'm fine with having the same code in each tool to output help if no options are given. I agree it would be best done centrally though if you can be bothered recoding. I guess the easiest way to do it would be to catch instances where |
Can't see how to comment on lines that haven't been updated in the PR but L46 in
That Minor thing. |
umi_tools/umi_tools.py
Outdated
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 comment
The reason will be displayed to describe this comment to others. Learn more.
What's the print()
for?
Thats not what I meant. I guess I was thinking about a tool that had no required arguements. For example, you could imagine that if
Although of course it doesn't, and I think all our tools require options of some sort (although come to think of it the new In the above I'll clean up the rough tabs. |
Ah, got it. Yeah, that is a good point. Probably being optimistic about future tools being added 😉 |
Whitespace should be tidied up. |
Noticed in passing that a lot of the changes to umi_tools.py are also in #506. Should we first merge that one so that the contributions include @[epruesse]? |
yes
Ian Sudbery
Senior Lecturer in Bioinformatics,
Sheffield Institute for Nucleic Acids,
School of Biosciences,
The University of Sheffield.
web: www.sudlab.co.uk
Tel: 0114 222 2738
Twitter: IanSudbery
Show Calendar Availability
<https://calendar.google.com/calendar/u/0?cid=aS5zdWRiZXJ5QHNoZWZmaWVsZC5hYy51aw>
…On Wed, 8 Jun 2022 at 14:31, Tom Smith ***@***.***> wrote:
Noticed in passing that a lot of the changes to umi_tools.py are also in
#506 <#506>. Should we first
merge that one so that the contributions include @[epruesse]?
—
Reply to this email directly, view it on GitHub
<#537 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJELDS3HG4H2VSPTZ4G5FDVOCOEBANCNFSM5X5LFZZA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@IanSudbery - This is OK to merge, right? |
Fixes (or at least starts to fix) #536
@TomSmithCGAT Bit confused as to what is going on in the umi_tools module. Specifically what the original purpose of the if clause at lines 51-52 was.
I've also made each tool print its usage message if no options are passed at all. Don't know if this was the right was to do this, or if I should have done something more central (although that would become a problem if there was a tool that could be run without options. Which currently there isn't).