cyanea-omics
v0.2.1 AnalysisInterval arithmetic and multi-omics analysis at scale.
Multi-omics analysis — genomic intervals, copy-number segmentation, CpG island detection, methylation analysis, and spatial autocorrelation.
Playground
Overview
cyanea-omics provides two broad capabilities: genomic interval arithmetic (merge, intersect, subtract, window, Jaccard) and multi-omics analysis routines (copy-number segmentation, CpG island detection, spatial autocorrelation).
Interval operations follow the BEDTools convention — zero-based, half-open coordinates, sorted by chromosome and position. They are the building blocks for coverage analysis, peak calling, and variant filtration.
Key Concepts
Interval Arithmetic
Genomic analyses constantly manipulate intervals: “which peaks overlap my gene list?”, “subtract blacklist regions from my ChIP-seq peaks”, “what fraction of two peak sets overlap?” The five core operations — merge, intersect, subtract, closest, and Jaccard — answer these questions efficiently.
Circular Binary Segmentation (CBS)
CBS is the standard algorithm for detecting copy-number alterations from array or sequencing data. It finds breakpoints in a signal by recursively testing whether splitting a segment produces two subsegments with significantly different means. The alpha parameter controls the significance threshold.
CpG Islands
CpG islands are regions of elevated CG dinucleotide frequency, typically found near gene promoters. find_cpg_islands scans a sequence for regions meeting the Gardiner-Garden & Frommer criteria (length ≥ 200 bp, GC ≥ 50%, observed/expected CpG ≥ 0.6).
Spatial Autocorrelation
Moran’s I measures whether values at nearby locations tend to be similar (positive autocorrelation) or dissimilar (negative). It is used in spatial transcriptomics to identify genes whose expression varies spatially across a tissue section.
Code Examples
Rust
use cyanea_omics::{merge_intervals, cbs_segment, Interval};
let merged = merge_intervals(&intervals);
let segments = cbs_segment(&positions, &log2ratios, "chr1", 0.01, 5);
Python
import cyanea
merged = cyanea.merge_intervals([
{"chrom": "chr1", "start": 100, "end": 200},
{"chrom": "chr1", "start": 150, "end": 300},
])
JavaScript (WASM)
import { merge_intervals, cbs_segment, find_cpg_islands } from '/wasm/cyanea_wasm.js';
const merged = JSON.parse(merge_intervals(JSON.stringify(intervals)));
const islands = JSON.parse(find_cpg_islands(dnaSequence, "chr1"));
Use Cases
- ChIP-seq analysis — Intersect peak calls with gene promoters.
- CNV calling — Segment log2-ratio arrays to detect amplifications and deletions.
- Epigenomics — Map CpG islands and correlate with methylation profiles.
- Spatial transcriptomics — Identify spatially variable genes with Moran’s I.