All Projects → 38 → pyd4

38 / pyd4

Licence: other
The python binding for D4 format

Programming Languages

rust
11053 projects
python
139335 projects - #7 most used programming language

pyd4 - Python Binding for D4 File Format

This python module allows python read D4 file.

Installation

Install through pip is recommended

pip install pyd4

or you can also run the setup.py to install:

./setup.py install

Usage by Example

from pyd4 import D4File

file = D4File("test.d4")

# Print the chrom list
print(file.chroms())

# Get the mean cov for region chr1:10000000-20000000
print(file.mean([("chr1", 10000000, 20000000)]))

# Get the depth distribution hisgoram for chr1:10000000-20000000. 
# The max bucket is 1000 and the min bucket is 0
print(file.histogram([("chr1", 10000000, 20000000)], 0, 1000))

# Get a iterator over values
for i in file.value_iter("chr1", 0, 10000):
	print(i)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].