Code Monkey home page Code Monkey logo

pyd4's Introduction

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)

pyd4's People

Contributors

38 avatar arq5x avatar

Stargazers

David Laub avatar Matthias Zepper avatar Sophia Sue avatar Mario Solís avatar Douglas Wu avatar Dr. K. D. Murray avatar Clint Valentine avatar Matt Shirley avatar Konstantinos Kyriakidis avatar  avatar Sam Bryce-Smith avatar Leighton Pritchard avatar Romain Feron avatar Richard avatar Luiz Irber avatar Brent Pedersen avatar

Watchers

James Cloos avatar  avatar  avatar

pyd4's Issues

examples

here is an example where a mosdepth user wants to do custom stuff with the d4 output:
brentp/mosdepth#127
would be nice to have examples for this as a key benefit of the d4 format is that it allows the user to quickly do any custom analysis, rather than pushing more functionality into mosdepth.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.