Skip to main content
Alpha Cyanea is in public alpha. We're building in the open — expect rough edges and rapid iteration. See what's live

cyanea-omics

v0.2.1 Analysis

Interval arithmetic and multi-omics analysis at scale.

Analysis layer Apache-2.0 8 functions Interactive playground

Multi-omics analysis — genomic intervals, copy-number segmentation, CpG island detection, methylation analysis, and spatial autocorrelation.

Playground

Loading 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.

API Surface

merge_intervals (json: &str) -> JSON Merge overlapping genomic intervals
intersect_intervals (a, b: &str) -> JSON Find intersection of two interval sets
subtract_intervals (a, b: &str) -> JSON Subtract interval set B from A
jaccard_intervals (a, b: &str) -> f64 Jaccard similarity between interval sets
make_windows (genome, window_size) -> JSON Tile a genome into fixed-size windows
cbs_segment (pos, vals, chrom, alpha, min) -> JSON Circular binary segmentation for CNV detection
find_cpg_islands (seq, chrom) -> JSON Detect CpG islands in a DNA sequence
morans_i (values, neighbors) -> JSON Moran's I spatial autocorrelation statistic

Depended on by

Tags

Omics Intervals CNV Methylation Spatial