refgenie / refgenconf

A Python object for standardized reference genome assets.
http://refgenie.databio.org
BSD 2-Clause "Simplified" License
3 stars 6 forks source link

Adding values that aren't file paths #93

Open nsheff opened 4 years ago

nsheff commented 4 years ago

We recently removed the file checks on the seek function, which allows us to store things in refgenie that aren't file paths, like we are now doing for the bowtie2_index asset.

But it's still impossible to use add on a string that is not a filepath.

  1. the value is called path:
refgenie add x/y
usage: refgenie add [-h] [-c GENOME_CONFIG] [-g GENOME] -p PATH
                    asset-registry-paths [asset-registry-paths ...]
refgenie add: error: the following arguments are required: -p/--path
  1. It has to be a path, can't be an arbitrary string:
refgenie add x/y -p 1,500
Using 'default' as the default tag for 'x/y'
Traceback (most recent call last):
  File "/home/nsheff/.local/bin/refgenie", line 10, in <module>
    sys.exit(main())
  File "/home/nsheff/.local/lib/python3.7/site-packages/refgenie/refgenie.py", line 638, in main
    refgenie_add(rgc, asset_list[0], args.path)
  File "/home/nsheff/.local/lib/python3.7/site-packages/refgenie/refgenie.py", line 274, in refgenie_add
    format(abs_asset_path, rgc[CFG_FOLDER_KEY]))
OSError: Absolute path '/home/nsheff/code/refgenie_sandbox/x/1,500' does not exist. The provided path must be relative to: /home/nsheff/code/refgenie_sandbox

Should we change add to reflect the changes? I'd suggest:

  1. change the name of the arg from path to value.
  2. don't enforce that the path must exist or make it absolute

perhaps there could be a -p/--path flag that would flag your value as a path, and then behave as it currently does?

nsheff commented 4 years ago

PS Looks like they also use this capability in nextflow:

https://github.com/nf-core/tools/blob/ebf63095ab222e4df987c4e950ce3839e8784d3e/nf_core/pipeline-template/%7B%7Bcookiecutter.name_noslash%7D%7D/conf/igenomes.config#L22-L23

so it's not just galaxy...