linnarsson-lab / loom-viewer

Tool for sharing, browsing and visualizing single-cell data stored in the Loom file format
BSD 2-Clause "Simplified" License
35 stars 6 forks source link

Command parser bug #116

Closed slinnarsson closed 7 years ago

slinnarsson commented 7 years ago

Doing loom expand -r <filename> fails because the -r flag actually expects an argument, and therefore eats up the filename:

$ loom expand -r L3_Brain_CholinergicMonoaminergic.loom

usage: loom expand [-h] [-t TRUNCATE] [-m METADATA] [-a ATTRIBUTES] [-r ROWS]
                   [-c COLS]
                   file

positional arguments:
  file                  Loom input file

optional arguments:
  -h, --help            show this help message and exit
  -t TRUNCATE, --truncate TRUNCATE
                        Remove previously expanded files if present (False by
                        default)
  -m METADATA, --metadata METADATA
                        Expand metadata (False by default)
  -a ATTRIBUTES, --attributes ATTRIBUTES
                        Expand attributes (False by default)
  -r ROWS, --rows ROWS  Expand rows (False by default)
  -c COLS, --cols COLS  Expand columns (False by default)

error: the following arguments are required: file

Workaround is to use a dummy extra argument:

loom expand -r dummy L3_Brain_CholinergicMonoaminergic.loom

A side effect of this bug is that you can't do loom expand -marc <filename>.

JobLeonard commented 7 years ago

For some reason, python's flags expect you to pass -r True. If I ever figure out why, I'll fix it, but for now that's a workaround.

slinnarsson commented 7 years ago

I think the argument needs to be added with the action="store_true" flag, as in:

parser.add_argument('--debug', action="store_true")
JobLeonard commented 7 years ago

Ah, so that's how it works! Implemented and pushed to server, just pull and rebuild, then this should to the trick:

loom expand -tmar [filename]

Remember that tiling requires manual removal of old tiles (for now)

JobLeonard commented 7 years ago

So this is fixed, will continue in other issue.