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-io

v0.3.5 I/O

Read and write every major bioinformatics format at native speed.

I/O layer Apache-2.0 8 functions Interactive playground

High-performance parsers and writers for bioinformatics formats. FASTA, FASTQ, VCF, BED, GFF3, SAM, BLAST XML, GFA, and more.

Playground

Loading playground…

Overview

cyanea-io is the I/O workhorse of the ecosystem. It provides zero-copy, streaming parsers for every major bioinformatics file format — FASTA, FASTQ, VCF, BED, GFF3, SAM/BAM, BLAST XML, GFA, BedGraph, and more. Each parser returns structured JSON that downstream crates can consume directly.

The parsers are designed for both server-side Rust pipelines and browser-side WASM use. In the browser, you can paste or drag-drop a file and get immediate, interactive results — no server round-trip required.

Key Concepts

Streaming vs. Full Parse

For large files (multi-GB FASTQ), the Rust API provides streaming iterators that process one record at a time with constant memory. The WASM bindings parse the full text in one call, which is appropriate for the smaller files typically handled in the browser.

FormatExtensionContent
FASTA.fa, .fastaSequences with headers
FASTQ.fq, .fastqSequences + quality scores
VCF.vcfVariant calls with genotypes
BED.bedGenomic intervals
GFF3.gff3Gene annotations
SAM.samRead alignments
BLAST XML.xmlSearch results
GFA.gfaAssembly graphs

Validation

Each parser validates the format structure and reports clear error messages with line numbers. Malformed records are flagged but don’t halt parsing — you get both the valid data and a list of warnings.

Code Examples

Rust

use cyanea_io::{FastaReader, VcfReader};

let reader = FastaReader::from_path("genome.fa")?;
for record in reader {
    println!("{}: {} bp", record.name, record.seq.len());
}

Python

import cyanea

records = cyanea.parse_fasta(open("genome.fa").read())
variants = cyanea.parse_vcf(open("calls.vcf").read())

JavaScript (WASM)

import { parse_fasta, parse_vcf_text, parse_bed_text } from '/wasm/cyanea_wasm.js';

const records = JSON.parse(parse_fasta(fastaText));
const variants = JSON.parse(parse_vcf_text(vcfText));
const intervals = JSON.parse(parse_bed_text(bedText));

Use Cases

  • Format conversion — Parse one format, emit another. FASTA ↔ FASTQ, VCF → BED, GFF3 → BED.
  • Browser-based QC — Drop a FASTQ file onto the page and see per-base quality distributions instantly.
  • Pipeline glue — Read SAM text, generate pileup, and feed it into variant calling.

API Surface

parse_fasta (data: &str) -> JSON Parse FASTA format into records with name and sequence
parse_fastq (data: &str) -> JSON Parse FASTQ format into records with quality scores
parse_vcf_text (text: &str) -> JSON Parse VCF variant records with INFO and genotype fields
parse_bed_text (text: &str) -> JSON Parse BED interval records
parse_gff3_text (text: &str) -> JSON Parse GFF3 gene annotation records
pileup_from_sam (sam: &str) -> JSON Generate pileup from SAM alignment text
parse_blast_xml (xml: &str) -> JSON Parse BLAST XML output into structured hits
parse_gfa (text: &str) -> JSON Parse GFA assembly graph format

Depends on

Tags

I/O Parsing FASTA FASTQ VCF BED GFF3 SAM GFA