https://github.com/carrascomj/rust_sbml
SBML parser + bindings to python
https://github.com/carrascomj/rust_sbml
bioinformatics parser sbml
Last synced: 6 months ago
JSON representation
SBML parser + bindings to python
- Host: GitHub
- URL: https://github.com/carrascomj/rust_sbml
- Owner: carrascomj
- License: apache-2.0
- Created: 2020-10-12T09:04:59.000Z (over 5 years ago)
- Default Branch: trunk
- Last Pushed: 2024-09-20T09:07:20.000Z (over 1 year ago)
- Last Synced: 2024-10-31T11:40:18.439Z (over 1 year ago)
- Topics: bioinformatics, parser, sbml
- Language: Rust
- Homepage: https://docs.rs/rust_sbml
- Size: 174 KB
- Stars: 8
- Watchers: 1
- Forks: 4
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
[](https://crates.io/crates/rust_sbml)
[](https://pypi.org/project/rust_sbml/)
[](https://docs.rs/rust_sbml/)
[](https://github.com/carrascomj/rust_sbml)
[](https://codecov.io/gh/carrascomj/rust_sbml)
# rust_sbml
Parser for the [Systems Biology Markup Language (SBML)](http://sbml.org/Special/specifications/sbml-level-3/version-2/core/release-2/sbml-level-3-version-2-release-2-core.pdf):
* [Standalone Rust library](#rust)
* [Python API](#python)
## Getting started
### Rust
Add it to your Cargo.toml with no default features to avoid all
[PyO3](https://github.com/PyO3/pyo3) nuisances.
```toml
[dependencies.rust_sbml]
version = "0.7.0"
default_features=false
```
For example,
```rust
use rust_sbml::Model;
let example=r#"
"#;
let result = Model::parse(example);
println!("{:?}", result.unwrap());
```
See [write_to_file.rs](https://github.com/carrascomj/rust_sbml/blob/trunk/examples/write_to_file.rs)
for an example on serializing to a file.
### Python
It has only been tested on Linux.
#### Using pip
```shell
pip install rust_sbml
```
#### From source
Clone the repository.
```shell
git clone https://github.com/carrascomj/rust_sbml.git
```
You need [maturin](https://github.com/PyO3/maturin) for building it.
```shell
python -m pip install maturin
```
* Build locally
```shell
maturin build --release
pip install .
```
* Build on virtualenv (no pip install required)
```shell
# --release can be omitted to speed up compilation time
maturin develop --release
```
Having it installed, you can use it as a normal Python package.
```python
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
- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
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](https://github.com/livioribeiro/cargo-readme). Please, modify README.tpl or lib.rs instead (check [the github worflow](https://github.com/carrascomj/rust_sbml/blob/trunk/.github/workflows/readme.yml) for more details).