Skip to main content

Crate rtemis_a3

Crate rtemis_a3 

Source
Expand description

§rtemis-a3

Rust implementation of the A3 (Amino Acid Annotation) format.

A3 is a structured format for annotating amino acid sequences with site, region, post-translational modification, processing, and variant information.

§Quick start

use rtemis_a3::{a3_from_json, a3_to_json};

let json = r#"{
  "$schema": "https://schema.rtemis.org/a3/v1/schema.json",
  "a3_version": "1.0.0",
  "sequence": "MAEPRQ",
  "annotations": { "site": {}, "region": {}, "ptm": {}, "processing": {}, "variant": [] },
  "metadata": { "uniprot_id": "", "description": "", "reference": "", "organism": "" }
}"#;

let a3 = a3_from_json(json).unwrap();
assert_eq!(a3.sequence(), "MAEPRQ");

§Module layout

  • errorA3Error enum
  • types — data model structs and enums
  • normalization — pure helpers: sort, deduplicate, overlap check
  • validation — two-stage validation (structural then contextual)

Re-exports§

pub use error::A3Error;
pub use types::A3;
pub use types::A3_SCHEMA_URI;
pub use types::A3_VERSION;
pub use types::A3Index;
pub use types::Annotations;
pub use types::FlexEntry;
pub use types::Metadata;
pub use types::RegionEntry;
pub use types::SiteEntry;
pub use types::VariantRecord;
pub use validation::validate;

Modules§

error
Error types for the rtemis-a3 library.
normalization
Pure normalization helpers.
types
Data model for the A3 format.
validation
Two-stage A3 validation.

Functions§

a3_from_json
Parse and validate an A3 JSON string.
a3_to_json
Serialize a validated A3 to a JSON string.
residue_at
Return the amino acid character at a 1-based position.
variants_at
Return all variant records at a 1-based position.