mhammell-laboratory / TEtranscripts

A package for including transposable elements in differential enrichment analysis of sequencing datasets.
http://hammelllab.labsites.cshl.edu/software/#TEtranscripts
GNU General Public License v3.0
217 stars 29 forks source link

--verbose command line parsing #73

Closed wresch closed 4 years ago

wresch commented 4 years ago

Hi there,

I noticed that in TEtranscripts 2.1.4 verbose is expected to be an integer at

https://github.com/mhammell-laboratory/TEtranscripts/blob/43860492072f22600f72a92f3ef55cf9bd13bd03/TEToolkit/IO/ReadInputs.py#L203

But in the command line parsing at

https://github.com/mhammell-laboratory/TEtranscripts/blob/43860492072f22600f72a92f3ef55cf9bd13bd03/bin/TEtranscripts#L92

it it allowed to have 0 arguments without providing a const - i.e. the value that is produced if the flag is given without an argument. That leads to the following error:

Traceback (most recent call last):
  File "/usr/local/bin/TEtranscripts", line 4, in <module>
    __import__('pkg_resources').run_script('TEtranscripts==2.1.4', 'TEtranscripts')
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 666, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1446, in run_script
    exec(code, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/TEtranscripts-2.1.4-py2.7.egg/EGG-INFO/scripts/TEtranscripts", line 863, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/TEtranscripts-2.1.4-py2.7.egg/EGG-INFO/scripts/TEtranscripts", line 748, in main

Adding a const argument to the add_argument call for verbose would solve it or requiring an argument (i.e. remove nargs='?'

olivertam commented 4 years ago

Thank you for your suggestion. We will add that into the parser to catch the absence of an argument for the verbose parameter.

wresch commented 4 years ago

Super. Thanks @olivertam for the fast response