Tabix (pysam)

petlx.tabix.fromtabix(filename, reference=None, start=None, end=None, region=None, header=None)[source]

Extract rows from a tabix indexed file. E.g.:

>>> from petlx.tabix import fromtabix
>>> from petl import look
>>> t = fromtabix('test.bed.gz', region='Pf3D7_02_v3:100000-200000')
>>> look(t)
+---------------+----------+----------+-----------------------------+
| '#chrom'      | 'start'  | 'end'    | 'region'                    |
+===============+==========+==========+=============================+
| 'Pf3D7_02_v3' | '23100'  | '105800' | 'SubtelomericHypervariable' |
+---------------+----------+----------+-----------------------------+
| 'Pf3D7_02_v3' | '105800' | '447300' | 'Core'                      |
+---------------+----------+----------+-----------------------------+

New in version 0.4.

Project Versions

Previous topic

HDF5 Files (pytables)

Next topic

iPython Utilities

This Page