Skip to main content
OmicsWeave logo

OmicsWeave

From genomic files to model inputs — one region query away.

CI PyPI Python Platform Engine

Quick start · Support matrix · Documentation · Examples


OmicsWeave is a unified Python toolkit for turning multi-omics files into training data. Ask for a genomic region and get back NumPy arrays — sequence, signal, intervals, alignments, variants or contact maps — straight from the indexed file, without unpacking the whole dataset first. A native Rust engine does the decoding, and the same engine converts formats and quantifies alignments, so data preparation, exploration and data loading all run on one set of tools.

Highlights

  • 🧬 One query model for every omics layer. Sequences, signal tracks, peaks, reads, genotypes, personal haplotypes and Hi-C tiles are all read by the same 0-based, half-open keys: contiguous regions, spliced transcripts, strands and 2-D contact windows.
  • ⚡ Built for data loaders. Decoding runs in Rust and releases the GIL. Readers pickle into DataLoader workers, share an optional block cache, clone for threads and can write straight into preallocated batch buffers with out=.
  • 🔁 Prepare once, query forever. ow convert turns text formats (BED, bedGraph, wig, bedMethyl, VCF, SAM, cool, pairs, ...) into their indexed counterparts, streaming in parallel under a memory budget.
  • 📊 Quantify in a single pass. ow quant scans a sorted BAM once and produces any mix of coverage tracks, RNA / ATAC / ChIP count matrices, splice junctions, velocity layers, metabolic labeling, methylation, Hi-C contacts and allele counts.
  • 🧭 Annotation-aware. GTF / GFF3 load into columnar tables that turn genes and transcripts into query keys (exons, CDS, UTRs) and feature sets (introns, promoters, gene bodies) for queries and quantification.
  • 🎯 Faithful to the reference tools. Reads match what htslib returns, bigWig statistics match libBigWig, consensus sequences match bcftools consensus, and written files are standard: other tools read them as usual.

Quick start

pip install omicsweave
from omicsweave.query import SequenceReader, TrackReader, ContactReader
from omicsweave.types import Region, ContactWindow

region = Region("chr1", 1_000_000, 1_131_072)

with SequenceReader("genome.fa.gz") as genome, TrackReader("atac.bw") as atac:
    bases = genome.fetch(region).bases                    # uint8 [131072], ASCII
    signal = atac.signal(region).values                   # float32 [131072], NaN = no data
    binned = atac.bins(region, 128, ("mean", "max"))      # float32 [2, 1024]

with ContactReader("contacts.hic") as hic:
    tile = hic.matrix(ContactWindow(region, region, 2048)).values  # float32 [64, 64]

Transcripts come straight from the annotation:

from omicsweave.annotation import Annotation

annotation = Annotation.read("genes.gtf.gz", attributes=None)
mrna_key = annotation.locus("ENST00000269305")           # a Spliced key, strand included

with SequenceReader("genome.fa.gz") as genome:
    mrna = genome.fetch(mrna_key).text                   # spliced, 5' → 3'

Files that are not indexed yet are converted once, and BAMs are quantified in one pass:

ow convert peaks.bed peaks.bb --chrom-sizes genome.fa.fai
ow convert cohort.vcf.gz cohort.bcf --index
ow convert contacts.mcool contacts.hic -t 8 -m 4G

ow quant cells.bam -o results --gtf genes.gtf --genes single-cell --velocity --matrix mtx

Support matrix

✅ supported · ➜ convert first · — not applicable. Text inputs may be plain, gzip or BGZF compressed.

Data Format Read by region Convert from it Convert into it Write from Python Index In ow quant
Sequence FASTA ✅ bases bgzip FASTA, 2bit — FastaWriter .fai reference
bgzip FASTA ✅ bases bgzip FASTA, 2bit from FASTA FastaWriter .fai + .gzi reference
gzip FASTA ➜ bgzip FASTA, 2bit — — — —
2bit ✅ bases, soft mask — from FASTA TwoBitWriter built in reference
Signal bigWig ✅ per base, bins, runs — from bedGraph, wig, bedMethyl BigWigWriter built in output: coverage, methylation
bedGraph ➜ bigWig, bigBed — — — —
wig ➜ bigWig — — — —
Intervals bigBed ✅ overlapping records — from BED, bedGraph, bedMethyl BigBedWriter built in peaks as features
BED ➜ bigBed — — — —
bedMethyl ➜ bigBed (all columns), bigWig (one column) — — — —
Alignments BAM ✅ records, chosen fields coordinate-sorted BAM from SAM, CRAM, BAM — .bai / .csi input
CRAM 3.0 / 3.1 ✅ records, chosen fields BAM — — .crai ➜ BAM
SAM ➜ BAM — — — ➜ BAM
Variants BCF ✅ genotypes, INFO / FORMAT, filters, consensus — from VCF — .csi known sites, allele sites
VCF ➜ BCF — — — ➜ BCF
Contacts .hic v8 / v9 ✅ dense tiles, pixels — from cool, mcool, pairs, Juicer short HicWriter, HicBuilder built in output
cool / mcool ➜ .hic — — — —
4DN pairs ➜ .hic — — — output
Juicer short ➜ .hic — — — —
Annotation GTF / GFF3 ✅ loaded in memory — — write_gtf, write_bed12 not needed genes, promoters, gene activity, ...
Loader metadata Sidecar — — — sidecar=True on writers — —

Indexes are never built behind your back: call build_index() on the format object, or pass --index to ow convert. See the format overview for coordinates, compression and indexes across formats.

Query results at a glance

Reader Input Returns
SequenceReader FASTA, bgzip FASTA, 2bit uint8 bases (reverse complement on -)
TrackReader / StrandedTrackReader bigWig (one, or a plus / minus pair) float32 per-base signal; mean / min / max / sum / std / coverage bins; stored runs
IntervalReader bigBed uint32 starts / ends + the remaining BED fields
AlignmentReader BAM, CRAM fixed columns as arrays; names, sequences, qualities, CIGARs, tags on request
VariantReader BCF int8 genotype tensor; typed INFO / FORMAT arrays; bcftools -i / -e filters
ConsensusReader BCF + reference personal sequences per sample, haplotype or ALT, batched; optional chain
ContactReader .hic float32 contact tiles or nonzero pixels, raw counts, BP or FRAG bins

Quantification products

Assay Product Output
Any Coverage bigWig, combined or per strand, optional CPM scaling
scRNA / bulk RNA Counts.rna_single_cell / rna_bulk gene × cell / sample matrices, featureCounts-style table
RNA velocity Counts(..., velocity=True) spliced / unspliced / ambiguous layers
Splicing Junctions STAR-style junction table, optional matrix
Metabolic labeling Labeling, Labeled conversion histograms, mismatch profiles, labeled layer
scATAC Atac fragments + index, barcode metrics, peak / tile / gene-activity matrices
ChIP-seq / CUT&Tag Counts.chip peak or bin counts
DNA methylation Methylation per-cytosine table, beta / coverage bigWig, M-bias, region matrices
Hi-C / Micro-C Contacts 4DN pairs, raw-count .hic, per-cell metrics
Allele counting Alleles, AlleleGenes ref / alt / other layers, haplotype-resolved gene counts

Matrices are written as CellPack (.cpk, default), Matrix Market or CSV. OmicsWeave starts from aligned reads: it does not align, call peaks, call variants or correct barcodes.

Installation

OmicsWeave is on PyPI and supports Python 3.12 or newer; prebuilt wheels target Linux on x86_64 and aarch64.

pip install omicsweave
# or, in a uv-managed project
uv add omicsweave

This installs the omicsweave package and the ow command. NumPy is the only runtime dependency; pyarrow is optional for Arrow string export.

Documentation

Guide What it covers
Query by region keys, readers, result shapes, strands, caching, concurrency, DataLoader use
Convert formats supported routes, indexes, sorting, resource budgets, dry runs
Quantify alignments products, counting rules, matrix storage, assay-specific options
Format guides every format: what it stores, how it is laid out, how OmicsWeave supports it
Examples PyTorch data loaders for sequence-to-function and multi-modal models

The guides are written in Chinese.

Package layout

Module Purpose
omicsweave.types keys (Region, Spliced, ContactWindow) and result types
omicsweave.formats one class per file format, format detection, writers, index builders
omicsweave.query region readers; query.open(path) picks one by content
omicsweave.cache BlockCache, decoded blocks shared across readers
omicsweave.convert convert.plan / convert.run, also ow convert
omicsweave.quant quant.Task, products, quant.plan / quant.run, also ow quant
omicsweave.annotation GTF / GFF3 tables, lookups, overlaps, derived feature sets
omicsweave.errors the exceptions every layer raises

Metadata

Release files for omicsweave 0.1.0

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

Source distribution (sdist)

Source distribution for omicsweave 0.1.0
File Size Uploaded Provenance Actions
omicsweave-0.1.0.tar.gz 2.7 MB Without provenance Details for omicsweave-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for omicsweave 0.1.0
File Interpreter ABI Platform Actions
omicsweave-0.1.0-cp312-abi3-manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.28+ x86-64 Details for omicsweave-0.1.0-cp312-abi3-manylinux_2_28_x86_64.whl
omicsweave-0.1.0-cp312-abi3-manylinux_2_28_aarch64.whl CPython 3.12 abi3 Linux glibc 2.28+ ARM64 Details for omicsweave-0.1.0-cp312-abi3-manylinux_2_28_aarch64.whl

Total release size: 12.7 MB

Release files / omicsweave-0.1.0.tar.gz

Download URL omicsweave-0.1.0.tar.gz
Size 2.7 MB
Tags Source
SHA-256 checksum
How to use checksums
f1308f3b84e3ea691e1b41ae8f198c32bbf1d465eeebd45febd8a8767019d3b9
BLAKE2b-256 checksum
How to use checksums
2a7332768a7c5389b507beaf91a96d3e6d667c2270fb41765c4ec44797c6494d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / omicsweave-0.1.0-cp312-abi3-manylinux_2_28_x86_64.whl

Download URL omicsweave-0.1.0-cp312-abi3-manylinux_2_28_x86_64.whl
Size 5.2 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
b775aabcce648817af8e5c33244d0873eea800886a6919a8d1c299d5e8b13733
BLAKE2b-256 checksum
How to use checksums
8e17506c786b1f42e1f94e6171a05b7e0abf042df763f059508b1a042ff4379c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / omicsweave-0.1.0-cp312-abi3-manylinux_2_28_aarch64.whl

Download URL omicsweave-0.1.0-cp312-abi3-manylinux_2_28_aarch64.whl
Size 4.9 MB
Tags CPython 3.12 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
2e0453d053d05cc533eada4e2478ecebd068eafcb95ae0bb8d389374291ba252
BLAKE2b-256 checksum
How to use checksums
8d5fe1765e1722f0a9c64df30b8a1e90ad2f3a9264058ac27632c4d81cda89bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for omicsweave 0.1.0

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.1.0 This release

3 release files 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