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.
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.
Cancer Genomics
Somatic mutation analysis, COSMIC/ClinVar annotation, drug target lookup, oncoprint, and tumor board report.
RNA-seq DE Analysis
Differential expression with normalization, ORA/GSEA enrichment, volcano plot, clustered heatmap.
GWAS Analysis
Type 2 Diabetes GWAS: Manhattan/QQ plots, LD clumping, forest plot, functional enrichment.
Gut Microbiome
16S analysis: Shannon/Simpson diversity, Bray-Curtis, differential abundance, IBD vs healthy.
Pharmacogenomics
Warfarin dosing from CYP2C9/VKORC1 genotypes, metabolizer phenotypes, drug interactions.
Single-Cell RNA-seq
Tumor microenvironment: UMAP, Leiden clustering, marker genes, cell type annotation.
CRISPR Screen
KO screen for drug resistance in melanoma: sgRNA fold changes, hit calling, rank plots.
Epigenomics / ChIP-seq
H3K27ac super-enhancers in leukemia: interval operations, motif scanning, genome tracks.
Phylogenomics
SARS-CoV-2 spike evolution: NJ trees, MinHash sketching, sequence logos, dN/dS.
Clinical WES
Rare disease trio WES: inheritance filtering, ACMG classification, clinical diagnostic report.
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.