Skip to main content

gwseq_io

Read and write the files genome-wide sequencing produces, from Python or the command line. The parsing, indexing and binning are done in Rust.

Format What you can do Reference
bigWig, bigBed Read binned values and entries, write files, convert from bedGraph, WIG and BED bbi_api
BED, peak tables (TSV, CSV, .xlsx) Read into memory, with the same calls as a bigBed bed_api
bedGraph, WIG Read into memory, with the same calls as a bigWig bbi_api
BEDPE Read pairs of intervals by one region or by a pair of them bedpe_api
GTF, GFF3 Read records and gene models, sort, index gtf_api
FASTA, .2bit Read bases and base probabilities, index fasta_api
BAM, CRAM Read alignments, index, pile up into a coverage bigWig alignment_api
HiC Read contact matrices, quantify contacts hic_api
cooler (.cool, .mcool) The same reads as a .hic cooler_api

Every format reads from a local path or an http(s):// URL, into numpy arrays and tables of columns.

Every example in these pages is run by the test suite, and every signature is checked against the package's source.

Install

pip install gwseq-io

This installs the package, the gwseq-io command and numpy (1.23.2 or newer). Only a source distribution is published, so pip compiles the extension on your machine. That needs Rust 1.89 or newer and Python 3.11 or newer. The extension is pure Rust, so it needs no C compiler or Python headers. It builds for x86_64 and aarch64 (Linux, macOS, Windows).

cargo install --path crates/gwseq-io-cli, from a checkout, builds the same command without Python.

Quick start

>>> import gwseq_io
>>> with gwseq_io.open("signal.bw", "w", chr_sizes={"chr1": 10_000}) as writer:
...     writer.write_values("chr1", 0, 100, [0.5, 1.0, 1.5, 2.0])
>>> reader = gwseq_io.open("signal.bw")
>>> reader
<gwseq_io.BigWigReader chromosomes=1>
>>> reader.read_values("chr1:1-400", bin_size=100)
array([[0.5, 1. , 1.5, 2. ]], dtype=float32)
>>> reader.quantify(["chr1:1-200", "chr1:201-400"])
array([0.75, 1.75])

The same from the command line:

$ gwseq-io read signal.bw -r chr1:1-400 --bin-size 100
chr1    0    400    0.5    1    1.5    2
$ gwseq-io quantify signal.bw -r chr1:1-200 -r chr1:201-400
chr1    0    200    0.75
chr1    200  400    1.75

Metadata

Release files for gwseq-io 0.10.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gwseq-io 0.10.1
File Size Uploaded Provenance Actions
gwseq_io-0.10.1.tar.gz 1.8 MB Without provenance Details for gwseq_io-0.10.1.tar.gz

Release files / gwseq_io-0.10.1.tar.gz

Download URL gwseq_io-0.10.1.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
f10a1741179b548c9e688113faef949823b669bcde55e08be7855aa9f280578a
BLAKE2b-256 checksum
How to use checksums
2aa1538ea6b0e915763063a36396e637879da42ee3b34384df2b57db4457c06c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for gwseq-io 0.10.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.10.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page