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.

RnaAlphabet

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

IUPAC nucleotide codes for RNA: A/C/G/U plus the standard ambiguity codes (R,Y,S,W,K,M,B,D,H,V,N). ‘T’ is deliberately excluded (that’s DnaAlphabet). Also allows ‘-’ and ‘.’ as alignment gap/missing-data characters, since a Sequence doubles as an alignment row. Case-insensitive.

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

Valid examples

ambiguity-codes.json
"ACGURYSWKMBDHVNacguryswkmbdhvn.-"

Invalid examples

contains-t.json
"ACGT"
Schema source
rna-alphabet.schema.json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.wur.nl/betula/core/rna-alphabet/0.6.0/schema.json",
  "title": "RnaAlphabet",
  "description": "IUPAC nucleotide codes for RNA: A/C/G/U plus the standard ambiguity codes (R,Y,S,W,K,M,B,D,H,V,N). 'T' is deliberately excluded (that's DnaAlphabet). Also allows '-' and '.' as alignment gap/missing-data characters, since a Sequence doubles as an alignment row. Case-insensitive.",
  "type": "string",
  "minLength": 1,
  "pattern": "^[ACGURYSWKMBDHVNacguryswkmbdhvn.-]*$"
}

Usage

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

Python
TypeScript
Rust
rna-alphabet.py
from betula_schema import RnaAlphabet, parse_json

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