https://schemas.wur.nl/betula/core/sequence-reference/0.6.0/schema.json
A pointer to a Sequence by identifier, without embedding the sequence itself. Not yet consumed by another betula schema (every current producer embeds full Sequence objects, e.g. in alignment); this exists as the reusable primitive for when a by-reference link is needed, e.g. a hit record pointing at a locally-known query sequence instead of repeating it.
Field | Type | Required | Description |
|---|---|---|---|
| required |
No properties beyond those listed are allowed.
Valid examples¶
simple.json
{
"identifier": "seq1"
}
Invalid examples¶
missing-identifier.json
{}
Schema source
sequence-reference.schema.json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.wur.nl/betula/core/sequence-reference/0.6.0/schema.json",
"title": "SequenceReference",
"description": "A pointer to a Sequence by identifier, without embedding the sequence itself. Not yet consumed by another betula schema (every current producer embeds full Sequence objects, e.g. in alignment); this exists as the reusable primitive for when a by-reference link is needed, e.g. a hit record pointing at a locally-known query sequence instead of repeating it.",
"type": "object",
"properties": {
"identifier": { "$ref": "https://schemas.wur.nl/betula/core/identifier/0.6.0/schema.json" }
},
"required": ["identifier"],
"additionalProperties": false
}
Usage¶
Read a JSON document and parse it as a SequenceReference. CI runs this exact code against the first valid example above; see Getting started to install the bindings.
Python
TypeScript
Rust
sequence-reference.py
from betula_schema import SequenceReference, parse_json
with open("sequence-reference.json") as f:
sequence_reference = parse_json(SequenceReference, f.read())
print(sequence_reference)
sequence-reference.ts
import { readFileSync } from "node:fs";
import { parseJson, type SequenceReference } from "betula-schema";
const sequenceReference: SequenceReference = parseJson("SequenceReference", readFileSync("sequence-reference.json", "utf8"));
console.log(sequenceReference);
sequence-reference.rs
fn main() -> Result<(), Box<dyn std::error::Error>> {
let text = std::fs::read_to_string("sequence-reference.json")?;
let sequence_reference: betula_schema::SequenceReference = betula_schema::parse_str(&text)?;
println!("{sequence_reference:?}");
Ok(())
}