Skip to main content

Crate oboannotation

Crate oboannotation 

Source
Expand description

This library simplifies accessing annotations of biomedical ontologies.

ยงSupported ontologies

The library supports the following ontologies

ยงExamples

ยงLoad HPO annotations

Load a toy HPO annotation file:

use oboannotation::io::AnnotationLoader;
use oboannotation::hpo::HpoAnnotation;
use oboannotation::hpo::io::{HpoAnnotationLines, HpoAnnotationLoader};

// ๐Ÿ‘‡ Replace with path to a real file ๐Ÿ‘‡
let fpath_hpoa = "data/phenotype.real-shortlist.hpoa";

let loader = HpoAnnotationLoader::default();
let data: HpoAnnotationLines = loader.load_from_path(fpath_hpoa)
                                 .expect("Toy HPOA should be well formatted");

assert_eq!(data.lines.len(), 86); // Toy HPOA includes 86 records

See HpoAnnotationLines and HpoAnnotation to learn more about the data format.

ยงLoad GO annotations

Load a toy GO annotation file containing annotations of FBN1 and SURF1 genes for Homo sapiens.

use oboannotation::io::AnnotationLoader;
use oboannotation::go::{GoAnnotations, GoGafAnnotationLoader};

// ๐Ÿ‘‡ Replace with path to a real file ๐Ÿ‘‡
let fpath_goa = "data/goa_human.SURF1_FBN1.gaf";

let loader = GoGafAnnotationLoader;
let data: GoAnnotations = loader.load_from_path(fpath_goa)
                            .expect("Toy GO annotations should be well formatted");

assert_eq!(data.annotations.len(), 156); // Toy GO annotations include 156 records

See GoAnnotations and GoAnnotation to learn more about the data format.

Modulesยง

go
Parse Gene Ontology annotations.
hpo
Types and I/O for working with HPO Annotations.
io
Load ontology annotations.