Example Gallery

Explore practical BioLang examples organized by domain. Each category contains complete, runnable code that you can copy into your projects or use as learning material. From quick one-liners to full analysis workflows, these examples demonstrate idiomatic BioLang patterns.

One-Liners

20+ concise snippets for everyday tasks: GC content, reverse complement, k-mer counting, FASTQ filtering, and more.

📊

Data Wrangling

CSV/TSV/JSON loading, table transforms, reshaping, merging files, and data cleaning pipelines.

🧬

Genomics

Genome-scale analysis: alignment statistics, variant density plots, coverage windows, and annotation overlap.

🧬

Proteomics

Protein analysis: mass spec data processing, molecular weight calculation, domain searching, and peptide identification.

🌍

Population Genetics

Allele frequency computation, Hardy-Weinberg testing, Fst estimation, PCA on genotype matrices.

🏥

Clinical Variants

ClinVar queries, pathogenicity filtering, ACMG classification, and clinical report generation.

🦠

Metagenomics

Taxonomic classification, alpha/beta diversity, abundance tables, and community profiling.

🔬

Single-Cell

Count matrix processing, normalization, clustering, marker gene detection, and UMAP visualization.

🧬

Structural Biology

PDB file parsing, contact map generation, Ramachandran analysis, B-factor visualization.

🏆

Rosalind Armory

All 15 Bioinformatics Armory problems from Rosalind: GenBank queries, FASTQ quality, ORF finding, alignment, and more.

🧩

Rosalind Stronghold

Worked solutions to the Rosalind Bioinformatics Stronghold: sequence analysis, combinatorics, probability, alignment, phylogeny and assembly. Every solution is asserted against the official answer.

📚

Rosalind Textbook Track

The canonical bioinformatics algorithms curriculum, answered with BioLang builtins — 17 of 20 sampled algorithms already exist as one call. A showcase, not a course companion.

Rosalind Algorithmic Heights

All 34 problems of the algorithms track: sorting, heaps, graph search, Dijkstra, Bellman-Ford, strongly connected components and 2-satisfiability. No builtins to lean on — every one is written in BioLang itself.

⚠️

Edge Cases & Gotchas

Empty sequences, nil handling, large file streaming, encoding issues, and common pitfalls.

Research Workflows

End-to-end research scenarios that mirror real-world bioinformatics studies. Each workflow combines data processing, statistical analysis, database queries, and publication-quality visualizations into a single self-contained script.

How to Use These Examples

Every code block on these pages is a complete, runnable snippet. Copy any example and run it directly with bl run:

# Save an example to a file
bl run my_example.bl

# Or pipe directly
echo 'dna"ATCG" |> reverse_complement |> print' | bl run -

Examples that require input files will note the expected format. Most use built-in sample data or generate synthetic data for demonstration purposes.

Contributing Examples

Have a useful BioLang snippet? Examples are maintained in the examples/ directory of the BioLang repository. Submit a pull request with your example and it will be reviewed for inclusion in this gallery.