An alternative to pyBigWig for bedgraph files
Project description
pyBedGraph
pyBedGraph is an alternative to pyBigWig.
Features:
- Finds mean, approximate mean, max, min, coverage, and standard deviation
Improvements:
- Much faster
Usage:
Create the object:
# Chromosome that is stored in object will be the first that appears in the bedgraph file if not given
genome = Genome('bedgraph_file.bedgraph', 'chr1')
# Specify a bin size (default is 64)
genome = Genome('bedgraph_file.bedgraph', 'chr1', 128)
Search from a file:
# Out file is optional, output goes to stdout if not given
# Default statistic to find is mean
genome.stats_from_file('intervals_to_search_for.txt', 'out.txt')
Search from a list of intervals:
intervals = [
[0, 100],
[101, 200],
[4, 100],
[100000, 999999]
]
print(genome.stats(intervals))
# output is [value1, value2, value3, value4]
Choose a specific statistic:
mean
approx_mean
- an approximate mean that is around 4x fastermod_approx_mean
- a slightly slower but more accurate approximate meanmax
min
coverage
std
intervals = [
[0, 100],
[101, 200],
[4, 100],
[100000, 999999]
]
genome.stats(intervals, 'approx_mean')
genome.stats_from_file('intervals_to_search_for.txt', 'out.txt', 'std')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyBedGraph-0.1.1.tar.gz
(6.7 kB
view hashes)
Built Distribution
Close
Hashes for pyBedGraph-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6de6af858ad9b0e3afc6f240e13c715e87d012fe300073959634626dd9f2d0eb |
|
MD5 | e9e6850019baf7c75dff541f03f00bec |
|
BLAKE2b-256 | 9f4b5fb93b5a104c0d0a29aef9b3d7bd6721ad57d97cf5687c412272da761c58 |