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