Skip to main content

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

Project description

Version Py versions Build Status Dev repo Codacy Grade License DOI coverage Documentation Status

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

Project details


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

pronto-0.8.0.tar.gz (36.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pronto-0.8.0-py3.6.egg (36.3 kB view details)

Uploaded Egg

pronto-0.8.0-py2.py3-none-any.whl (39.6 kB view details)

Uploaded Python 2Python 3

pronto-0.8.0-py2.7.egg (86.9 kB view details)

Uploaded Egg

File details

Details for the file pronto-0.8.0.tar.gz.

File metadata

  • Download URL: pronto-0.8.0.tar.gz
  • Upload date:
  • Size: 36.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pronto-0.8.0.tar.gz
Algorithm Hash digest
SHA256 7303f187bef3b63f1758a1157bf59f7cede17dc78b4ee51a9ee12e4ed7ecd08f
MD5 479f80f97af6ac040765cb3555719a71
BLAKE2b-256 b8a07d8318f06f56dd4dc739bb7dc0444af827b1af81f3638c26d437412298f9

See more details on using hashes here.

File details

Details for the file pronto-0.8.0-py3.6.egg.

File metadata

  • Download URL: pronto-0.8.0-py3.6.egg
  • Upload date:
  • Size: 36.3 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pronto-0.8.0-py3.6.egg
Algorithm Hash digest
SHA256 9c37b4b469da3730fd88954289b749d8b4d695d0bb0589a1c31048d3284972e6
MD5 601b88f92c4c68c7e0f6b47cec011ecf
BLAKE2b-256 1de46b822f7071d079ba16527cd7a3bb50e73569dc7fc5c5213d4e966dadb97a

See more details on using hashes here.

File details

Details for the file pronto-0.8.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pronto-0.8.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a749bfd8a54732b413fb6f1749f0152a38a0bc9c221b8ed060672733e4ea1748
MD5 27410c740496ea82dd98c522aee321d1
BLAKE2b-256 126d7b3160aa43338dc95e301a2c2bd7b85ced05e135b4dbc986df6cd779a81b

See more details on using hashes here.

File details

Details for the file pronto-0.8.0-py2.7.egg.

File metadata

  • Download URL: pronto-0.8.0-py2.7.egg
  • Upload date:
  • Size: 86.9 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pronto-0.8.0-py2.7.egg
Algorithm Hash digest
SHA256 7170f65531e2cc514eda6518825b348cbdf64033373aac573393a0779ef20c97
MD5 146ccd0c53882a13d62f13216dde1814
BLAKE2b-256 ab09d760a26bf5832285cd09e3906938a6969372f0911516a8c426932588ef19

See more details on using hashes here.

Supported by

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