vitessce / vitessce-data

Utils for loading HuBMAP data formats
MIT License
6 stars 4 forks source link

Create tiles from hdf5 image data #23

Open mccalluc opened 5 years ago

mccalluc commented 5 years ago

Copied from Slack:

pete [12:29 PM]

Check out clodius/tiles/mrmatrix.py also check out this file: https://github.com/higlass/clodius/blob/pkerpedjiev/tsv-to-mrmatrix/scripts/tsv-to-mrmatrix.py it’s brand new but I used it on a 87K x 87K matrix

pete [12:33 PM]

it loads a dense matrix as a tsv file into an hdf5 file and then creates a data pyramid

pete [1 month ago]

you should be able to test it out using higlass-python

pete [1 month ago]

import higlass
import higlass.client as hgc
import higlass.tilesets as hgti

f = h5py.File('../blah.h5', 'r')

ts1 = hgti.mmatrix('../blah.h5')

tr1 = hgc.Track('heatmap', 
                position='center',
                height=400,
                tileset=ts1)

view1 = hgc.View([tr1])
(display, server, viewconf) = higlass.display([view1])

pete [1 month ago]

https://github.com/higlass/higlass-python

pete [12:33 PM]

in particular take a look at the coarsen function which takes an hdf5 array and creates the downsampled layers the 120 lines of code should be pretty straightforward. Let me know if you have any issues.

manzt commented 4 years ago

This is essentially what we do now with ImgHdf5Reader.to_zarr + tile_zarr_base.py