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

using listr in remote mode #123

Closed stolarczyk closed 3 years ago

stolarczyk commented 3 years ago

when using refgenie listr in remote mode (with no config initialized) the alias should be looked up on the server.

current behavior:

[mstolarczyk@MichalsMBP refgenie]: refgenie listr -s http://rg.databio.org -g hg38
Using default config. No config found in env var: ['REFGENIE']
Subscribed to: http://rg.databio.org
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/bin/refgenie", line 10, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/refgenie/cli.py", line 264, in main
    genomes=args.genome, server_url=server_url
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/refgenconf/refgenconf.py", line 422, in get_asset_table
    self, genomes_data, Table(title=title, min_width=70, caption=c), genomes
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/refgenconf/refgenconf.py", line 375, in _fill_table_with_genomes_data
    genome = rgc.get_genome_alias_digest(alias=g, fallback=True)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/refgenconf/refgenconf.py", line 1676, in get_genome_alias_digest
    return self[CFG_GENOMES_KEY].get_key(alias=alias)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/yacman/alias.py", line 223, in get_key
    raise UndefinedAliasError("No key defined for: {}".format(alias))
yacman.exceptions.UndefinedAliasError: No key defined for: hg38

Follow refgenie seekr, for example:

[mstolarczyk@MichalsMBP refgenie]: refgenie seekr hg38/fasta -s http://rg.databio.org
Using default config. No config found in env var: ['REFGENIE']
Subscribed to: http://rg.databio.org
No local digest for genome alias: hg38
Setting 'hg38' identity with server: http://rg.databio.org/v3/genomes/genome_digest/hg38
Determined server digest for local genome alias (hg38): 2230c535660fb4774114bfa966a62f823fdb6d21acf138d4
Set genome alias (2230c535660fb4774114bfa966a62f823fdb6d21acf138d4: hg38)
http://awspds.refgenie.databio.org/rg.databio.org/2230c535660fb4774114bfa966a62f823fdb6d21acf138d4/fasta__default/2230c535660fb4774114bfa966a62f823fdb6d21acf138d4.fa
stolarczyk commented 3 years ago

fixed:

[mstolarczyk@MichalsMBP code]: refgenie listr -s http://rg.databio.org -g hg38
Using default config. No config found in env var: ['REFGENIE']
Subscribed to: http://rg.databio.org
Setting 'hg38' identity with server: http://rg.databio.org/v3/genomes/genome_digest/hg38
Determined server digest for local genome alias (hg38): 2230c535660fb4774114bfa966a62f823fdb6d21acf138d4
Set genome alias (2230c535660fb4774114bfa966a62f823fdb6d21acf138d4: hg38)
                        Remote refgenie assets                        
                  Server URL: http://rg.databio.org                   
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ genome    ┃ asset (seek_keys)                          ┃ tags      ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ hg38      │ fasta (fasta, fai, chrom_sizes)            │ default   │
│ hg38      │ bowtie2_index (bowtie2_index)              │ default   │
└───────────┴────────────────────────────────────────────┴───────────┘