Skip to main content

A parser for SBML

Project description

Crates.io pypi Documentation Build Codecov

rust_sbml

Parser for the Systems Biology Markup Language (SBML):

Getting started

Rust

Add it to your Cargo.toml with no default features to avoid all PyO3 nuisances.

[dependencies.rust_sbml]
version = "0.7.0"
default_features=false

For example,

use rust_sbml::Model;

let example=r#"<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2">
     <model timeUnits="second" extentUnits="mole" substanceUnits="mole">
     </model>
</sbml>"#;
let result = Model::parse(example);
println!("{:?}", result.unwrap());

See write_to_file.rs for an example on serializing to a file.

Python

It has only been tested on Linux.

Using pip

pip install rust_sbml

From source

Clone the repository.

git clone https://github.com/carrascomj/rust_sbml.git

You need maturin for building it.

python -m pip install maturin
  • Build locally
    maturin build --release
    pip install .
    
  • Build on virtualenv (no pip install required)
    # --release can be omitted to speed up compilation time
    maturin develop --release
    

Having it installed, you can use it as a normal Python package.

from rust_sbml import Model

sbml = Model("examples/EcoliCore.xml")
reaction = sbml.getListOfReactions()[0]
print(reaction.getListOfReactants())

Milestones

  • getListOfSpecies() (id, name)
  • getListOfCompartments() (id, name)
  • getListOfReactions() (id, name)
    • .getListOfReactants() (id, name)
    • .getListOfProducts() (id, name)
  • Capable of retrieving FBC bounds.
  • Published to pypi
  • Kinetic Laws, with naive mathml tailored for SBML.
  • Metadata, with naive rdf tailored for SBML.
  • Test suite with python calls.
  • Test suite with libsbml comparison trough cobrapy.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

README.md is automatically generated on CI using cargo-readme. Please, modify README.tpl or lib.rs instead (check the github worflow for more details).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rust_sbml-0.7.0.tar.gz (81.7 kB view hashes)

Uploaded Source

Built Distributions

rust_sbml-0.7.0-cp39-cp39-manylinux2010_x86_64.whl (450.7 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

rust_sbml-0.7.0-cp39-cp39-macosx_10_7_x86_64.whl (418.2 kB view hashes)

Uploaded CPython 3.9 macOS 10.7+ x86-64

rust_sbml-0.7.0-cp38-cp38-manylinux2010_x86_64.whl (449.9 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

rust_sbml-0.7.0-cp38-cp38-macosx_10_7_x86_64.whl (417.6 kB view hashes)

Uploaded CPython 3.8 macOS 10.7+ x86-64

rust_sbml-0.7.0-cp37-cp37m-manylinux2010_x86_64.whl (450.2 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

rust_sbml-0.7.0-cp37-cp37m-macosx_10_7_x86_64.whl (417.7 kB view hashes)

Uploaded CPython 3.7m macOS 10.7+ x86-64

rust_sbml-0.7.0-cp36-cp36m-manylinux2010_x86_64.whl (447.7 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page