pronto 0.12.2
pip install pronto==0.12.2
Released:
Python frontend to ontologies
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT License (MIT)
- Author: Martin Larralde
- Tags Bio-Informatics, Ontology, OBO, Owl, convert, parse
- Requires: Python >= 2.7, != 3.0.*, != 3.1.*, != 3.2.*
Classifiers
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
Project description
Overview
Pronto is a python module to parse, create, browse and export ontologies from some popular formats. For now, obo and owl/xml are available, but more formats are to be added in the future (you can even add your own to work with the current API).
Installation
Installing with pip is the easiest:
pip install pronto # if you have the admin rights
pip install pronto --user # if you want to install it for only one user
There is also a conda recipe in the bioconda channel:
conda install -c bioconda pronto
If for some reason you do not like pip, you can also clone the repository and install it with the setup script (still requires setuptools):
git clone https://github.com/althonos/pronto
cd pronto
python setup.py install # may also require admin rights
Usage
The Ontology class is the main entrypoint of pronto. It can be instantiated with a given ontology file (.owl, .ont or .obo) or from scratch, without any existing terms.
Open an ontology and get a term by accession:
import pronto
ont = pronto.Ontology('path/to/file.obo')
term = ont['REF:ACCESSION']
Display an ontology in obo format and in json format:
import pronto
ont = pronto.Ontology('https://net.path.should/work/too.owl')
print(ont.obo)
print(ont.json)
Merge two ontologies:
Example here uses the NMR controlled vocabulary and the HUPO-PSI MS controlled vocabulary
import pronto
nmr = pronto.Ontology('http://nmrml.org/cv/v1.1.0/nmrCV.owl')
ms = pronto.Ontology('https://raw.githubusercontent.com/HUPO-PSI/psi-ms-CV/master/psi-ms.obo')
ms.merge(nmr)
>>> 'NMR:1000004' in ms
True
>>> ms.meta['coverage']
'Mass spectrometer output files and spectra interpretation'
Find ontology terms with children
import pronto
ont = pronto.Ontology('path/to/file.obo')
for term in ont:
if term.children:
print(term)
Get all the transitive children of an ontology term
import pronto
ont = pronto.Ontology('path/to/file.obo')
print(ont['RF:XXXXXXX'].rchildren())
Reference
If you wish to use this library in a scientific publication, please cite it ! (see the Zenodo record to get a DOI or a BibTEX record).
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT License (MIT)
- Author: Martin Larralde
- Tags Bio-Informatics, Ontology, OBO, Owl, convert, parse
- Requires: Python >= 2.7, != 3.0.*, != 3.1.*, != 3.2.*
Classifiers
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pronto-0.12.2.zip
.
File metadata
- Download URL: pronto-0.12.2.zip
- Upload date:
- Size: 33.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c27b484e34eaaadc97dd6d6f5a767cfdf29ccda34431f9c3bf6a0c8cc54c83e8 |
|
MD5 | 6ac5813b110b3028803e0262aab121d6 |
|
BLAKE2b-256 | acbc5ce0c0748cc58127fe0ababe2ad6af1655c1cef38f5c17e264e6f755e5ee |
File details
Details for the file pronto-0.12.2-py2.py3-none-any.whl
.
File metadata
- Download URL: pronto-0.12.2-py2.py3-none-any.whl
- Upload date:
- Size: 27.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 646700e43ce3781d6839b31572db9d4de0a36ebc08af9578e2f98ad1b9e0bcf1 |
|
MD5 | 894fa2cfe0e014cd4be6131b59e0547f |
|
BLAKE2b-256 | ac96f32acb57d1fef6e7ebcad8366d740e3e31370af2c074d1ff70bc8b833505 |