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

get_tag_seek_keys() returns None - leading to potential TypeError: 'NoneType' object is not iterable #133

Open jpsmith5 opened 2 years ago

jpsmith5 commented 2 years ago

In the scenario in which an child asset is pulled from the refgenie servers, parent asset metadata is generated, but does NOT include a seek_keys: tag. As such, the return from get_tag_seek_keys() in refgenconf.py is None, and the command for seek_key_name in get_tag_seek_keys(tag_mapping): in list_seek_keys_values() produces a TypeError.

For example:

refgenie pull rCRSd/bowtie2_index

This successfully pulls the bowtie2_index asset and generates the parent fasta metadata, but does not pull the actual fasta asset and therefore does not include a seek_keys: tag, yielding a None return in that function call.

See:

94e0d21feb576e6af61cd2a798ad30682ef2428bb7eabbb4:
    aliases:
     - rCRSd
    assets:
      fasta:
        tags:
          default:
            asset_digest: 4eb430296bc02ed7e4006624f1d5ac53
            asset_children:
             - 94e0d21feb576e6af61cd2a798ad30682ef2428bb7eabbb4/bowtie2_index:default
      bowtie2_index:
        tags:
          default:
            seek_keys:
              bowtie2_index: 94e0d21feb576e6af61cd2a798ad30682ef2428bb7eabbb4
              dir: .
            asset_parents:
             - 94e0d21feb576e6af61cd2a798ad30682ef2428bb7eabbb4/fasta:default
            asset_path: bowtie2_index
            asset_digest: 1262e30d4a87db9365d501de8559b3b4
        default_tag: default
    genome_description: The revised cambridge reference sequence. This is the human mitochondrial reference genome

Handling of the None type appears necessary with room for improved messaging in this scenario.

nsheff commented 2 years ago

what version are you using? is this the dev version or the released version?

jpsmith5 commented 2 years ago

what version are you using? is this the dev version or the released version?

Release: 0.12.0