https://schemas.wur.nl/betula/core/location/0.6.0/schema.json
A 1-based inclusive interval on a named reference sequence (GFF3 convention). Not yet consumed by another betula schema: annotation keeps seqid/start/end/strand flat to match picea’s and react-bio-viz’s current wire shape rather than nesting them under this. This exists as the reusable primitive for when a genomic-interval-only shape is needed, e.g. a future schema for react-bio-viz’s GenomeBrowser feature tracks.
Field | Type | Required | Description |
|---|---|---|---|
| required | ||
|
| required | |
|
| required | |
| one of | required |
No properties beyond those listed are allowed.
Valid examples¶
{
"seqid": "chr1",
"start": 1,
"end": 100,
"strand": "+"
}
Invalid examples¶
{
"seqid": "chr1",
"start": 1,
"end": 100
}
Schema source
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.wur.nl/betula/core/location/0.6.0/schema.json",
"title": "Location",
"description": "A 1-based inclusive interval on a named reference sequence (GFF3 convention). Not yet consumed by another betula schema: annotation keeps seqid/start/end/strand flat to match picea's and react-bio-viz's current wire shape rather than nesting them under this. This exists as the reusable primitive for when a genomic-interval-only shape is needed, e.g. a future schema for react-bio-viz's GenomeBrowser feature tracks.",
"type": "object",
"properties": {
"seqid": { "$ref": "https://schemas.wur.nl/betula/core/identifier/0.6.0/schema.json" },
"start": { "type": "integer", "minimum": 1 },
"end": { "type": "integer", "minimum": 1 },
"strand": { "type": "string", "enum": ["+", "-", "."] }
},
"required": ["seqid", "start", "end", "strand"],
"additionalProperties": false
}
Usage¶
Read a JSON document and parse it as a Location. CI runs this exact code against the first valid example above; see Getting started to install the bindings.
from betula_schema import Location, parse_json
with open("location.json") as f:
location = parse_json(Location, f.read())
print(location)
import { readFileSync } from "node:fs";
import { parseJson, type Location } from "betula-schema";
const location: Location = parseJson("Location", readFileSync("location.json", "utf8"));
console.log(location);
fn main() -> Result<(), Box<dyn std::error::Error>> {
let text = std::fs::read_to_string("location.json")?;
let location: betula_schema::Location = betula_schema::parse_str(&text)?;
println!("{location:?}");
Ok(())
}