File: spotH5dump.py

package info (click to toggle)
pbsuite 15.8.24%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 14,512 kB
  • ctags: 1,951
  • sloc: python: 10,962; sh: 147; xml: 21; makefile: 14
file content (11 lines) | stat: -rwxr-xr-x 373 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/python
import sys
import h5py

#view with chr:start-end
if __name__ == '__main__':
    h5 = h5py.File(sys.argv[1])
    print "chrom\tposition\t"+"\t".join(h5.attrs["columns"])
    for chrom in h5.keys():
        for pos,i in enumerate(h5["/%s/data" % chrom].value.transpose().tolist()):
            print chrom + "\t" + str(pos) + '\t' + "\t".join(map(str, i))