#bigwig #reading #associated #bigbeds #big-wig #big-bed

bin+lib bigtools

A library and associated tools for reading and writing bigwigs and bigbeds

22 unstable releases (3 breaking)

0.4.2 Feb 12, 2024
0.3.0 Sep 11, 2023
0.2.4 Jul 30, 2023
0.1.11 Aug 2, 2022
0.1.1 Nov 21, 2019

#13 in Biology

Download history 179/week @ 2024-01-01 118/week @ 2024-01-08 127/week @ 2024-01-15 113/week @ 2024-01-22 138/week @ 2024-01-29 146/week @ 2024-02-05 141/week @ 2024-02-12 291/week @ 2024-02-19 319/week @ 2024-02-26 333/week @ 2024-03-04 200/week @ 2024-03-11 86/week @ 2024-03-18 130/week @ 2024-03-25 279/week @ 2024-04-01 147/week @ 2024-04-08 292/week @ 2024-04-15

853 downloads per month
Used in 5 crates (4 directly)

MIT license

2MB
11K SLoC

Bigtools

License Zenodo

crates.io Rust Docs Anaconda-Server Badge

PyPI Python Docs Anaconda-Server Badge

Bigtools is a library and associated tools for reading and writing bigwig and bigbed files.

The primary goals of the project are to be

  • Performant
  • Extensible
  • Modern

Performant

Bigtools uses async/await internally to allow for efficient, multi-core computation when possible. In addition, tools are optimized for minimal memory usage. See Benchmarks for more details.

Extensible

Bigtools is designed to be as modular as possible. This, in addition to the safety and reliability of Rust, allows both flexibility and correctness as a library. In addition, its extremely easy to quickly create new tools or binaries. A number of binaries are available that parallel related existing binaries from UCSC, with drop-in compatibility for the most common flags.

Modern

Bigtools is written in Rust and published to crates.io, so binaries can be installed with cargo install bigtools or it can be used as a library by simply including it in your cargo.toml.

Library

See the bigtools 🦀 Documentation.

Example

use bigtools::bbiread::BigWigRead;

let mut reader = BigWigRead::open("test.bigWig").unwrap();
let chr1 = reader.get_interval("chr1", 0, 10000).unwrap();
for interval in chr1 {
    println!("{:?}", interval);
}

Binaries

The following binaries are available:

binary description
bigtools Provides access to multiple subcommands, including all below
bedgraphtobigwig Writes a bigWig from a given bedGraph file
bedtobigbed Writes a bigBed from a given bed file
bigbedinfo Shows info about a provided bigBed
bigbedtobed Writes a bed from the data in a bigBed
bigwigaverageoverbed Calculate statistics over the regions of a bed file using values from a bigWig
bigwiginfo Shows info about a provided bigWig
bigwigmerge Merges multiple bigWigs, outputting to either a new bigWig or a bedGraph
bigwigtobedgraph Writes a bedGraph from the data in a bigWig
bigwigvaluesoverbed Get the per-base values from a bigWig over the regions of a bed file using values

Renaming the bigtools binary to any of the subcommands (case-insensitive) allows you to run that subcommand directly.

The bigtools CLI binaries can be installed through crates.io (cargo install bigtools) or conda. Additionally, pre-built binaries can be downloaded through Github releases.

Python wrapper

Also included in this repo is a Python wrapper, pybigtools written using PyO3.

See the pybigtools 🐍 API Documentation.

The pybigtools package can be used as a dpendency either through pypi or conda.

Benchmarks

Benchmarks are included in the ./bench directory. They require python to run.

Multiple tools are compared against the comparable UCSC tools. For completeness, both single-threaded and multi-threaded (when available) benchmarks are included. Multiple different configuration options are benchmarked across multiple replicates, but a summar is available in the table below:

How to cite

This repository contains contains a CITATION.cff file with citation information. Github allows you to get a citation in either APA or BibTeX format; this is available in "Cite this repository" under About.

Dependencies

~3–16MB
~188K SLoC