Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Python frontend to ontologies - a library to parse, create, browse and export ontologies.

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

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 children of an ontology term recursively

import pronto
ont = pronto.Ontology('path/to/file.obo')
print(ont['RF:XXXXXXX'].children.children)

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).

Release History

Release History

This version
History Node

0.8.0

History Node

0.7.4

History Node

0.7.3

History Node

0.7.2

History Node

0.7.1

History Node

0.7.0

History Node

0.6.2

History Node

0.6.1

History Node

0.6.0

History Node

0.5.0

History Node

0.4.2

History Node

0.4.1

History Node

0.4.0

History Node

0.3.3

History Node

0.3.2

History Node

0.3.1

History Node

0.3.0

History Node

0.2.1

History Node

0.2.0

History Node

0.1.12

History Node

0.1.11

History Node

0.1.10

History Node

0.1.9

History Node

0.1.7

History Node

0.1.6

History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pronto-0.8.0-py2.7.egg (86.9 kB) Copy SHA256 Checksum SHA256 2.7 Egg Jul 19, 2017
pronto-0.8.0-py2.py3-none-any.whl (39.6 kB) Copy SHA256 Checksum SHA256 3.6 Wheel Jul 19, 2017
pronto-0.8.0-py3.6.egg (36.3 kB) Copy SHA256 Checksum SHA256 3.6 Egg Jul 19, 2017
pronto-0.8.0.tar.gz (36.2 kB) Copy SHA256 Checksum SHA256 Source Jul 19, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting