Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

DnaAlphabet

https://schemas.wur.nl/betula/core/dna-alphabet/0.6.0/schema.json

IUPAC nucleotide codes for DNA: A/C/G/T plus the standard ambiguity codes (R,Y,S,W,K,M,B,D,H,V,N). Also allows ‘-’ and ‘.’ as alignment gap/missing-data characters, since a Sequence doubles as an alignment row. Case-insensitive (lowercase is the common convention for soft-masked regions in genome assemblies).

string (minLength 1, pattern ^[ACGTRYSWKMBDHVNacgtryswkmbdhvn.-]*$)

Valid examples

ambiguity-codes.json
"ACGTRYSWKMBDHVNacgtryswkmbdhvn.-"

Invalid examples

contains-u.json
"ACGU"
Schema source
dna-alphabet.schema.json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.wur.nl/betula/core/dna-alphabet/0.6.0/schema.json",
  "title": "DnaAlphabet",
  "description": "IUPAC nucleotide codes for DNA: A/C/G/T plus the standard ambiguity codes (R,Y,S,W,K,M,B,D,H,V,N). Also allows '-' and '.' as alignment gap/missing-data characters, since a Sequence doubles as an alignment row. Case-insensitive (lowercase is the common convention for soft-masked regions in genome assemblies).",
  "type": "string",
  "minLength": 1,
  "pattern": "^[ACGTRYSWKMBDHVNacgtryswkmbdhvn.-]*$"
}

Usage

Read a JSON document and parse it as a DnaAlphabet. CI runs this exact code against the first valid example above; see Getting started to install the bindings.

Python
TypeScript
Rust
dna-alphabet.py
from betula_schema import DnaAlphabet, parse_json

with open("dna-alphabet.json") as f:
    dna_alphabet = parse_json(DnaAlphabet, f.read())
# DnaAlphabet is a RootModel; dna_alphabet.root is the plain value
print(dna_alphabet)