Skip to main content

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 faster
  • mod_approx_mean - a slightly slower but more accurate approximate mean
  • max
  • 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


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)

Uploaded Source

Built Distribution

pyBedGraph-0.1.1-py3-none-any.whl (9.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page