Skip to main content
OmicsWeave logo

OmicsWeave

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

Python PyPI Platform Backend

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, multi-species alignments, reads, variants, personal sequences 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, quantifies alignments and scans motifs, so data preparation, exploration and data loading all run on one set of tools.

Highlights

  • 🧬 One query, every layer. Sequence, signal, peaks, multiple alignments, reads, variants and Hi-C are read by the same genomic keys — regions, transcripts from GTF / GFF3, 2-D windows — straight into NumPy.
  • ⚡ Built for training. Rust decoding outside the GIL, readers that drop into PyTorch DataLoader workers, and direct writes into batch buffers.
  • 🧪 Personal genomes and variant effects. Apply a BCF per haplotype for personal sequences, or one variant at a time for effect prediction.
  • 🔎 Composable motif scanning. MEME, JASPAR, HOCOMOCO and other motif formats in one file; FIMO, MAST, MCAST and GLAM2Scan as building blocks over a single pass.
  • 🔁 Convert and quantify. ow convert makes text formats queryable; ow quant turns one pass over a BAM into coverage, count matrices, methylation, contacts and more.
  • 🎯 Matches the reference tools. Same results as htslib, libBigWig, bcftools consensus and MEME Suite; files written are standard.

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'

Personal sequences come from a BCF over the reference, either a genome's view or one variant's view:

from omicsweave.query import ConsensusReader
from omicsweave.types import Haplotype, Record, Variant

with SequenceReader("genome.fa.gz") as genome, ConsensusReader("cohort.bcf", genome) as cohort:
    window = Region("chr17", 43_040_904, 43_049_096)
    hap1, hap2 = cohort.fetch_batch(window, [Haplotype("NA12878", "1"), Haplotype("NA12878", "2")])

    alt = cohort.fetch(window, Record(0))                # only the window's first variant applied
    snv = cohort.fetch(window, Variant(43_045_000, "C", "T"))  # one variant, chosen by content

Motifs are converted once into FFM, then scanned in memory:

from omicsweave import motif
from omicsweave.query import MotifReader

with MotifReader("jaspar.ffm") as motifs:
    program = motif.compile(motifs, motif.Background.uniform(motifs.alphabet))

with SequenceReader("genome.fa.gz") as genome:
    promoters = [genome.fetch(Region("chr1", s - 1_000, s)) for s in (1_000_000, 2_000_000)]
hits, counts = program.scan(promoters, motif.Hits(pvalue=1e-4), motif.Counts(pvalue=1e-4))
# hits: sequence / motif / start / end / strand / score / pvalue columns
# counts: sparse sequence × motif matrix (CSR), .to_dense() or .to_scipy()

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 convert multiz100way.maf.gz multiz100way.bigmaf --ref-species hg38
ow convert JASPAR2026_CORE_vertebrates_pfms.jaspar jaspar.ffm
ow convert cisbp/pwms/*.txt cisbp.ffm

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

Support matrix

➜ convert first · — not applicable · other entries in Read by region describe how the format is read. 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) — — — —
Multiple alignments bigMaf species × reference-base matrices — from MAF — built in —
MAF ➜ bigMaf — — — —
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, HiC-Pro HicWriter, HicBuilder built in output
cool / mcool ➜ .hic — — — —
4DN pairs ➜ .hic — — — output
Juicer short ➜ .hic — — — —
HiC-Pro valid pairs ➜ .hic — — — —
Annotation GTF / GFF3 loaded in memory — — write_gtf, write_bed12 not needed genes, promoters, gene activity, ...
Motifs FFM motifs by ID or index FFM from the motif text formats below, one or many files FfmWriter built in —
Motif texts: MEME / STREME, JASPAR (.jaspar, raw .pfm), TRANSFAC, HOMER, CIS-BP, HOCOMOCO (PCM / PWM / DPCM / DPWM), Cluster-Buster, BaMM, ProBound, GLAM2 ➜ FFM — — — —
Loader metadata Sidecar — — — sidecar=True on writers — —

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; typed columns by autoSql
MsaReader bigMaf uint8 alignment [species, length] in reference coordinates
AlignmentReader BAM, CRAM fixed columns as arrays; names, sequences, qualities, CIGARs, tags and MM / ML base modifications 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 (a genome's view), or with one variant applied (a variant's view); batched; optional chain
ContactReader .hic float32 contact tiles or nonzero pixels, raw counts, BP or FRAG bins
MotifReader FFM motif models by ID or index, ready to compile for scanning

Motif matching

Capability What you get
Motif collections MEME / STREME, JASPAR, TRANSFAC, HOMER, CIS-BP, HOCOMOCO, Cluster-Buster, BaMM, ProBound and GLAM2 merged into one FFM file
Site scanning windows past a p-value or score threshold, dense score tracks, each sequence's best window
Sequence features sparse sequence × motif count matrices, ready for model inputs
Sequence ranking MAST combined p- and E-values with non-overlapping hit tiling
Motif clusters MCAST cis-regulatory module search with p-, E- and q-values
Gapped profiles GLAM2Scan alignments of gapped motifs
MEME Suite parity fimo, mast, mcast and glam2scan match MEME Suite 5.5.9 output

Every reduction is collected in one pass over the sequences, any Markov-order background can be given, and each statistic (best-of-n, combined p-values, E- / q-values) can be swapped for your own. See the motif guide.

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
Match motifs FFM collections, scoring, scans, reductions and gapped profiles
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.

Metadata

Release files for omicsweave 0.2.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.2.0
File Size Uploaded Provenance Actions
omicsweave-0.2.0.tar.gz 3.0 MB Without provenance Details for omicsweave-0.2.0.tar.gz

Built distributions (wheels)

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

Total release size: 15.9 MB

Release files / omicsweave-0.2.0.tar.gz

Download URL omicsweave-0.2.0.tar.gz
Size 3.0 MB
Tags Source
SHA-256 checksum
How to use checksums
b95854abbb65fc4381dff05aa425133b82ff5d4ef90b5f9a4562ce0b3252f527
BLAKE2b-256 checksum
How to use checksums
17e1b6030d30ba81aff2aaa6b64284fd897cd69c0977caf284b08553b8265e9e
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.2.0-cp312-abi3-manylinux_2_28_x86_64.whl

Download URL omicsweave-0.2.0-cp312-abi3-manylinux_2_28_x86_64.whl
Size 6.6 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
4a68b2ba761abeb71646e6cbb6d7f02788206484ffafa32f169e007bdecec206
BLAKE2b-256 checksum
How to use checksums
06c973d8a08af4313f51907926d30445767adf11af72a4b2de1ef39eb9226904
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.2.0-cp312-abi3-manylinux_2_28_aarch64.whl

Download URL omicsweave-0.2.0-cp312-abi3-manylinux_2_28_aarch64.whl
Size 6.2 MB
Tags CPython 3.12 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
0c7c7957150fcce7e0e9ee14e8e81877f96fa35449a298f68432b1e68d509eea
BLAKE2b-256 checksum
How to use checksums
0f4de3944989f13f44207ced4add79b4416a264dbb7dbd8c2357e63ed25e0b51
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.2.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.2.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