def read_array(self, key):
        import tables
        node = getattr(self.group, key)
        data = node[:]
        attrs = node._v_attrs

        transposed = getattr(attrs, 'transposed', False)

        if isinstance(node, tables.VLArray):
            ret = data[0]
        else:
            dtype = getattr(attrs, 'value_type', None)
            shape = getattr(attrs, 'shape', None)

            if shape is not None:
                # length 0 axis
                ret = np.empty(shape, dtype=dtype)
            else:
                ret = data

            if dtype == u('datetime64'):

                # reconstruct a timezone if indicated
                ret = _set_tz(ret, getattr(attrs, 'tz', None), coerce=True)

            elif dtype == u('timedelta64'):
                ret = np.asarray(ret, dtype='m8[ns]')

        if transposed:
            return ret.T
        else:
            return ret
Calculate overlap of CAPseq peaks and h3k4me1 peaks (enhancer)
dataset/ETHPy150Open pydata/pandas/pandas/io/pytables.py/GenericFixed.read_array--crossover with--dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_proj007.py/getH3K4Me1Overlap