Biological Entity Typed Universal Language Architecture: JSON Schemas for common bioinformatics data (sequences, alignments, phylogenetic trees, gene annotations, distance matrices, and BLAST results), so tools written in different languages can read and write the same JSON.
Why¶
The projects below each defined these shapes on their own, and the definitions drifted. A sequence
record is {header, sequence} in picea and react-bio-viz but {identifier, sequence} in acacia;
tree support values are packed into node names in different encodings; BLAST hits nest multiple
HSPs in blastserver but are flattened to one row in react-bio-viz. Nothing checked any of it.
betula fixes one definition per shape as a JSON Schema, the language-neutral source of truth, and derives everything else from it:
Schemas: one per shape, built from shared primitives such as identifiers and IUPAC sequence alphabets.
Conformance fixtures: valid and invalid example documents for each schema. Any implementation must accept and reject exactly the same ones.
Language bindings: generated types with validating parsers, tested against every fixture. See Getting started.
Schemas are versioned in their $id (e.g. .../sequence/0.6.0/schema.json) and released as git
tags; see the changelog. The raw
schemas and fixtures are also served from this site, under schema/ and examples/.
Implementations¶
All three are published as betula-schema, versioned in lockstep with the schemas. See
Getting started to install them.
| Language | Package | Source | Built on |
|---|---|---|---|
| Python | betula-schema (PyPI) | bindings/python | Pydantic v2, via datamodel-code-generator |
| TypeScript | betula-schema (npm) | bindings/typescript | json-schema-to-typescript types, ajv |
| Rust | betula-schema (crates.io) | bindings/rust | typify types, the jsonschema crate |
Users¶
The schemas are derived from the JSON these projects produce and consume today. None of them depends on betula yet.
| Project | Language | Shapes |
|---|---|---|
| picea | Python | trees, sequences, alignments, gene annotations |
| react-bio-viz | TypeScript | trees, alignments, gene models, distance matrices, BLAST hits |
| acacia | TypeScript | alignments, trees, distance matrices |
| blastserver | TypeScript | BLAST results |
| iqtreeserver | TypeScript | trees |