Skip to content

Error looking for .names property on zarr group  #137

Closed
@alimanfoo

Description

@alimanfoo

Cannot pass Zarr group into VariantChunkedTable constructor:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-14-17c60e02130f> in <module>()
----> 1 variants_2L = allel.VariantChunkedTable(callset['2L/variants'])
      2 variants_2L

/home/aliman/miniconda3/envs/biipy240/lib/python3.5/site-packages/allel/model/chunked.py in __init__(self, data, names, index)
    814 
    815     def __init__(self, data, names=None, index=None):
--> 816         super(VariantChunkedTable, self).__init__(data, names=names)
    817         self.index = None
    818         if index is not None:

/home/aliman/miniconda3/envs/biipy240/lib/python3.5/site-packages/allel/chunked/core.py in __init__(self, data, names)
    804     # noinspection PyMissingConstructor
    805     def __init__(self, data, names=None):
--> 806         names, columns = _util.check_table_like(data, names=names)
    807         # skip super-class constructor because we are more flexible about type of values here
    808         self._values = data

/home/aliman/miniconda3/envs/biipy240/lib/python3.5/site-packages/allel/chunked/util.py in check_table_like(data, names)
     68         columns = list(data)
     69 
---> 70     elif hasattr(data, 'names'):
     71         # bcolz ctable or similar
     72         if names is None:

/home/aliman/miniconda3/envs/biipy240/lib/python3.5/site-packages/zarr/hierarchy.py in __getattr__(self, item)
    320     def __getattr__(self, item):
    321         # allow access to group members via dot notation
--> 322         return self.__getitem__(item)
    323 
    324     def group_keys(self):

/home/aliman/miniconda3/envs/biipy240/lib/python3.5/site-packages/zarr/hierarchy.py in __getitem__(self, item)
    302                          synchronizer=self._synchronizer)
    303         else:
--> 304             raise KeyError(item)
    305 
    306     def __setitem__(self, item, value):

KeyError: 'names'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions