fastobo Star me

Faultless AST for Open Biomedical Ontologies.

Actions Codecov License Source Crate Documentation Changelog GitHub issues DOI

Overview

This library provides a mostly-complete implementation of the OBO flat file format 1.4.

Warning: this project adheres to Semantic Versioning, but the API is likely to change a lot before the release of a stable 1.0.

Features

All the following features are enabled by default, but can be disabled and cherry-picked using the default-features = false option in the Cargo.toml manifest of your project:

Usage

Add fastobo to the [dependencies] sections of your Cargo.toml manifest: toml [dependencies] fastobo = "0.15.0"

The top-level fastobo module provides several functions to parse an OboDoc. Use fastobo::from_reader to load an OBO document from a BufRead implementor (use std::io::BufReader if needed):

```rust extern crate fastobo; extern crate ureq;

fn main() { let response = ureq::get("http://purl.obolibrary.org/obo/ms.obo").call(); let mut reader = std::io::BufReader::new(response.unwrap().into_reader());

match fastobo::from_reader(&mut reader) {
    Ok(doc) => println!("Number of MS entities: {}", doc.entities().len()),
    Err(e) => panic!("Could not parse the Mass-Spec Ontology: {}", e),
}

} ```

See also

Feedback

Found a bug ? Have an enhancement request ? Head over to the GitHub issue tracker of the project if you need to report or ask something. If you are filling in on a bug, please include as much information as you can about the issue, and try to recreate the same bug in a simple, easily reproducible situation.

About

This project was developed by Martin Larralde as part of a Master's Degree internship in the BBOP team of the Lawrence Berkeley National Laboratory, under the supervision of Chris Mungall. Cite this project as:

Larralde M. Developing Python and Rust libraries to improve the ontology ecosystem [version 1; not peer reviewed]. F1000Research 2019, 8(ISCB Comm J):1500 (poster) (https://doi.org/10.7490/f1000research.1117405.1)