pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic...

26
pronto Documentation Release dev Martin Larralde Nov 22, 2018

Transcript of pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic...

Page 1: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto DocumentationRelease dev

Martin Larralde

Nov 22, 2018

Page 2: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML
Page 3: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

Contents

1 Installation: 3

2 Contents: 5

3 Indices and tables 19

i

Page 4: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

ii

Page 5: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto Documentation, Release dev

Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXMLformats, open ontologies on the local host or from an network location, and export ontologies to obo format.

Contents 1

Page 6: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto Documentation, Release dev

2 Contents

Page 7: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

CHAPTER 1

Installation:

Run pip install pronto in a shell to download the latest release and all its dependencies from PyPi, or have alook at the Installation page to find other ways to install pronto.

3

Page 8: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto Documentation, Release dev

4 Chapter 1. Installation:

Page 9: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

CHAPTER 2

Contents:

2.1 Installation

2.1.1 PyPi

Pronto is hosted on GitHub, but the easiest way to install it is to download the latest release from its PyPi repository.It will install all dependencies of Pronto and then install the pronto module:

pip install pronto

2.1.2 Conda

Pronto is also available as a recipe in the bioconda channel. To install, simply use the conda installer:

conda install -c bioconda pronto

2.1.3 GitHub + pip

If, for any reason, you prefer to download the library from GitHub, you can clone the repository and install therepository by running (with the admin rights):

pip install https://github.com/althonos/pronto/archive/master.zip

Keep in mind this will install the development version of the library, so not everything may work as expected comparedto a versioned release.

2.1.4 GitHub + setuptools

If you do not have pip installed (the Makefile uses pip to install dependencies and then install pronto), you can do thefollowing (after having properly installed all the dependencies):

5

Page 10: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto Documentation, Release dev

git clone https://github.com/althonos/prontocd prontopython setup.py install

2.2 Examples

2.2.1 Explore an ontology via relationships

Pronto can be used to explore an ontology and find children of a specific term. This example was taken from mzml2isa,a program that parses .mzML files (a format of Mass Spectrometry data).

self.obo = Ontology('http://purl.obolibrary.org/obo/ms.obo')# ... extract metadata and get elements ... #for e in elements:

for ie in e.iterfind('s:cvParam', self.ns):if ie.attrib['accession'] in self.obo['MS:1000031'].rchildren().id:

### ... get instrument info ... ###parents = self.obo[ie.attrib['accession']].rparents()manufacturer = next(parent for parent in parents \

if parent in self.obo['MS:1000031'].children)### ... get manufacturer info ... ###

2.2.2 Merge ontologies and export the merge to the Obo Format

It is really easy to merge two ontologies: for instance, if we want to merge the Amphibian gross anatomy ontologywith the Xenopus anatomy and development ontology:

First, we import the ontologies:

>>> from pronto import Ontology>>> aao = Ontology('http://aber-owl.net/onts/AAO_60.ont')>>> xao = Ontology('http://purl.obolibrary.org/obo/xao.owl')>>> print(len(aao), len(xao))1603 1521

Then, either we merge the ontologies in a new ontology:

>>> merged = Ontology()>>> merged.merge(aao)>>> merged.merge(xao)>>> print(len(merged))3124

Or we can also merge the XAO in the AAO to keep the AAO metadata intact:

>>> aao.merge(xao)>>> print(len(aao))3124

Then we do the following to export the merged ontology:

>> with open('merged.obo', 'w') as f:f.write(aao.obo) #or f.write(merged.obo)

6 Chapter 2. Contents:

Page 11: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto Documentation, Release dev

2.3 API Reference

The following classes are imported when running from pronto import *:

pronto.Ontology An ontology.pronto.Description A description with optional cross-references.pronto.Relationship A Relationship object.pronto.Synonym A synonym in an ontology.pronto.SynonymType A synonym type in an ontology.pronto.Term A term in an ontology.pronto.TermList A list of Term instances.

2.3.1 Ontology

class pronto.OntologyAn ontology.

Ontologies inheriting from this class will be able to use the same API as providing they generated the expectedstructure in the _parse() method.

metadict – the metatada contained in the Ontology .

termsdict – the terms of the ontology. Not very useful to access directly, since Ontology provides many usefulshortcuts and features to access them.

importslist – a list of paths and/or URLs to additional ontologies the ontology depends on.

pathstr, optional – the path to the ontology, if any.

Examples

Import an ontology from a remote location:

>>> from pronto import Ontology>>> envo = Ontology("http://purl.obolibrary.org/obo/bfo.owl")

Merge two local ontologies and export the merge:

>>> uo = Ontology("tests/resources/uo.obo", False)>>> cl = Ontology("tests/resources/cl.ont.gz", False)>>> uo.merge(cl)>>> with open('tests/run/merge.obo', 'w') as f:... f.write(uo.obo)

Export an ontology with its dependencies embedded:

>>> cl = Ontology("tests/resources/cl.ont.gz")>>> with open('tests/run/cl.obo', 'w') as f:... f.write(cl.obo)

Use the parser argument to force usage a parser:

2.3. API Reference 7

Page 12: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto Documentation, Release dev

>>> cl = Ontology("tests/resources/cl.ont.gz",... parser='OwlXMLParser')

__contains__(item)Check if the ontology contains a term.

It is possible to check if an Ontology contains a Term using an id or a Term instance.

Raises TypeError – if argument (or left operand) is neither a string nor a Term

Example

>>> 'CL:0002404' in clTrue>>> from pronto import Term>>> Term('TST:001', 'tst') in clFalse

__getitem__(item)Get a term in the Ontology .

Method was overloaded to allow accessing to any Term of the Ontology using the Python dictionarysyntax.

Example

>>> cl['CL:0002380']<CL:0002380: oospore>>>> cl['CL:0002380'].relations{Relationship('is_a'): [<CL:0000605: fungal asexual spore>]}

__init__(handle=None, imports=True, import_depth=-1, timeout=2, parser=None)Create an Ontology instance from a file handle or a path.

Parameters

• handle (io.IOBase or str) – the location of the file (either a path on the localfilesystem, or a FTP or HTTP URL), a readable file handle containing an ontology, orNone to create a new ontology from scratch.

• imports (bool, optional) – if True (the default), embed the ontology importsinto the returned instance.

• import_depth (int, optional) – The depth up to which the imports should beresolved. Setting this to 0 is equivalent to setting imports to False. Leave as default(-1) to handle all the imports.

• timeout (int, optional) – The timeout in seconds for network operations.

• parser (BaseParser, optional) – A parser instance to use. Leave to None toautodetect.

__iter__()Return an iterator over the Terms of the Ontology.

For convenience of implementation, the returned instance is actually a generator that yields each term ofthe ontology, sorted in the definition order in the ontology file.

8 Chapter 2. Contents:

Page 13: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto Documentation, Release dev

Example

>>> for k in uo:... if 'basepair' in k.name:... print(k)<UO:0000328: kilobasepair><UO:0000329: megabasepair><UO:0000330: gigabasepair>

__len__()Return the number of terms in the Ontology.

__repr__()Return repr(self).

_empty_cache(termlist=None)Empty the cache associated with each Term instance.

This method is called when merging Ontologies or including new terms in the Ontology to make surethe cache of each term is cleaned and avoid returning wrong memoized values (such as Term.rchildren()TermLists, which get memoized for performance concerns)

_get_parsers(name)Return the appropriate parser asked by the user.

Todo: Change Ontology._get_parsers behaviour to look for parsers through a setuptools entry-point instead of mere subclasses.

_include_term(term)Add a single term to the current ontology.

It is needed to dereference any term in the term’s relationship and then to build the reference again to makesure the other terms referenced in the term’s relations are the one contained in the ontology (to make surechanges to one term in the ontology will be applied to every other term related to that term).

_include_term_list(termlist)Add terms from a TermList to the ontology.

_obo_meta()Generate the obo metadata header and updates metadata.

When called, this method will create appropriate values for the auto-generated-by and date fields.

Note: Generated following specs of the unofficial format guide: ftp://ftp.geneontology.org/pub/go/www/GO.format.obo-1_4.shtml

adopt()Make terms aware of their children.

This is done automatically when using the merge and include methods as well as the __init__method, but it should be called in case of manual editing of the parents or children of a Term.

include(*terms)Add new terms to the current ontology.

Raises TypeError – when the arguments is (are) neither a TermList nor a Term.

2.3. API Reference 9

Page 14: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto Documentation, Release dev

Note: This will also recursively include terms in the term’s relations dictionnary, but it is considered badpractice to do so. If you want to create your own ontology, you should only add an ID (such as ‘ONT:001’)to your terms relations, and let the Ontology link terms with each other.

Examples

Create a new ontology from scratch

>>> from pronto import Term, Relationship>>> t1 = Term('ONT:001','my 1st term',... 'this is my first term')>>> t2 = Term('ONT:002', 'my 2nd term',... 'this is my second term',... {Relationship('part_of'): ['ONT:001']})>>> ont = Ontology()>>> ont.include(t1, t2)>>>>>> 'ONT:002' in ontTrue>>> ont['ONT:001'].children[<ONT:002: my 2nd term>]

merge(other)Merge another ontology into the current one.

Raises TypeError – When argument is not an Ontology object.

Example

>>> from pronto import Ontology>>> nmr = Ontology('tests/resources/nmrCV.owl', False)>>> po = Ontology('tests/resources/po.obo.gz', False)>>> 'NMR:1000271' in nmrTrue>>> 'NMR:1000271' in poFalse>>> po.merge(nmr)>>> 'NMR:1000271' in poTrue

parse(stream, parser=None)Parse the given file using available BaseParser instances.

Raises

• TypeError – when the parser argument is not a string or None.

• ValueError – when the parser argument is a string that does not name a BaseParser.

reference()Make relations point to ontology terms instead of term ids.

This is done automatically when using the merge and include methods as well as the __init__method, but it should be called in case of manual changes of the relationships of a Term.

10 Chapter 2. Contents:

Page 15: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto Documentation, Release dev

resolve_imports(imports, import_depth, parser=None)Import required ontologies.

jsonstr – the ontology serialized in json format.

obostr – the ontology serialized in obo format.

2.3.2 Description

class pronto.DescriptionA description with optional cross-references.

__init__(text, xref=None)Initialize self. See help(type(self)) for accurate signature.

static __new__(cls, text, xref=None)Create and return a new object. See help(type) for accurate signature.

__repr__()Return repr(self).

__weakref__list of weak references to the object (if defined)

2.3.3 Relationship

class pronto.RelationshipA Relationship object.

The Relationship class actually behaves as a factory, creating new relationships via the default Python syntaxonly if no relationship of the same name are present in the class py:attribute::_instances (a dictionnarycontaining memoized relationships).

Relationships are each singletons, so you can use the is operator to check for equality between relationships.

Note: Relationships are pickable and always refer to the same adress even after being pickled and unpickled,but that requires to use at least pickle protocol 2 (which is not default on Python 2, so take care !):

>>> import pronto>>> import io, pickle>>>>>> src = io.BytesIO()>>> p = pickle.Pickler(src, pickle.HIGHEST_PROTOCOL)>>>>>> isa = pronto.Relationship('is_a')>>> isa_id = id(isa)>>>>>> p.dump(isa)>>> dst = io.BytesIO(src.getvalue())>>>>>> u = pickle.Unpickler(dst)>>> new_isa = u.load()>>>>>> id(new_isa) == isa_id

(continues on next page)

2.3. API Reference 11

Page 16: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto Documentation, Release dev

(continued from previous page)

True>>> # what's that black magic ?!

__init__(obo_name, symmetry=None, transitivity=None, reflexivity=None, complementary=None,prefix=None, direction=None, comment=None, aliases=None)

Instantiate a new relationship.

Parameters

• obo_name (str) – the name of the relationship as it appears in obo files (such as is_a,has_part, etc.)

• symetry (bool or None) – the symetry of the relationship

• transitivity (bool or None) – the transitivity of the relationship.

• reflexivity (bool or None) – the reflexivity of the relationship.

• complementary (string or None) – if any, the obo_name of the complementaryrelationship.

• direction (string, optional) – if any, the direction of the relationship (can be‘topdown’, ‘bottomup’, ‘horizontal’). A relationship with a direction set as ‘topdown’ willbe counted as _childhooding_ when acessing Term.children.

• comment (string, optional) – comments about the relationship.

• aliases (list, optional) – a list of names that are synonyms to the obo name ofthis relationship.

Note: For symetry, transitivity, reflexivity, the allowed values are the following:

• True for reflexive, transitive, symmetric

• False for areflexive, atransitive, asymmetric

• None for non-reflexive, non-transitive, non-symmetric

static __new__(cls, obo_name, *args, **kwargs)Create a relationship or returning an already existing one.

This allows to do the following:

>>> Relationship('has_part').directionu'topdown'

The Python syntax is overloaded, and what looks like a object initialization in fact retrieves an existingobject with all its properties already set. The Relationship class behaves like a factory of its own objects !

Todo:

• Add a warning for unknown relationship (the goal being to instantiate every known ontology relation-ship and even allow instatiation of file-defined relationships).

__repr__()Return a string reprensentation of the relationship.

12 Chapter 2. Contents:

Page 17: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto Documentation, Release dev

classmethod bottomup()Get all bottomup Relationship instances.

Example

>>> from pronto import Relationship>>> for r in Relationship.bottomup():... print(r)Relationship('is_a')Relationship('part_of')

complement()Return the complementary relationship of self.

Raises ValueError – if the relationship has a complementary which was not defined.

Returns the complementary relationship.

Return type complementary (Relationship)

Example

>>> from pronto.relationship import Relationship>>> print(Relationship('has_part').complement())Relationship('part_of')>>> print(Relationship('has_units').complement())None

classmethod topdown()Get all topdown Relationship instances.

Returns generator

Example

>>> from pronto import Relationship>>> for r in Relationship.topdown():... print(r)Relationship('can_be')Relationship('has_part')

__weakref__list of weak references to the object (if defined)

obostr – the Relationship serialized in an [Typedef] stanza.

Note: The following guide was used: ftp://ftp.geneontology.org/pub/go/www/GO.format.obo-1_4.shtml

2.3. API Reference 13

Page 18: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto Documentation, Release dev

2.3.4 Synonym

class pronto.SynonymA synonym in an ontology.

__eq__(other)Return self==value.

__hash__()Return hash(self).

__init__(desc, scope=None, syn_type=None, xref=None)Create a new synonym.

Parameters

• desc (str) – a description of the synonym.

• scope (str, optional) – the scope of the synonym (either EXACT, BROAD, NAR-ROW or RELATED).

• syn_type (SynonymType, optional) – the type of synonym if relying on a syn-onym type defined in the Typedef section of the ontology.

• xref (list, optional) – a list of cross-references for the synonym.

__repr__()Return repr(self).

__weakref__list of weak references to the object (if defined)

obostr – the synonym serialized in obo format.

2.3.5 SynonymType

class pronto.SynonymTypeA synonym type in an ontology.

namestr – the name of the synonym type

scopestr, optional – the scope all synonyms of that type will always have(either ‘EXACT’, ‘BROAD’, ‘NAR-ROW’, ‘RELATED’, or None).

descDescription – the description of the synonym type

__hash__()Return hash(self).

__init__(name, desc, scope=None)Create a new synonym type.

Parameters

• name (str) – the name of the synonym type.

• desc (str) – the description of the synonym type.

• scope (str, optional) – the scope modifier.

14 Chapter 2. Contents:

Page 19: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto Documentation, Release dev

__repr__()Return repr(self).

obostr – the synonym type serialized in obo format.

2.3.6 Term

class pronto.TermA term in an ontology.

Example

>>> ms = Ontology('tests/resources/psi-ms.obo')>>> type(ms['MS:1000015'])<class 'pronto.term.Term'>

__init__(id, name=”, desc=”, relations=None, synonyms=None, other=None)Create a new Term.

Parameters

• id (str) – the Term id (e.g. “MS:1000031”)

• name (str) – the name of the Term in human language

• desc (str) – a description of the Term

• relations (dict, optional) – a dictionary containing the other terms the Term isin a relationship with.

• other (dict, optional) – other information about the term

• synonyms (set, optional) – a list containing pronto.synonym.Synonym ob-jects relating to the term.

Example

>>> new_term = Term('TR:001', 'new term', 'a new term')>>> linked_term = Term('TR:002', 'other new', 'another term',... { Relationship('is_a'): 'TR:001'})

__repr__()Return repr(self).

_empty_cache()Empty the cache of the Term’s memoized functions.

rchildren(level=-1, intermediate=True)Create a recursive list of children.

Parameters

• level (int) – The depth level to continue fetching children from (default is -1, to getchildren to the utter depths)

• intermediate (bool) – Also include the intermediate children (default is True)

2.3. API Reference 15

Page 20: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto Documentation, Release dev

Returns The recursive children of the Term following the parameters

Return type pronto.TermList

rparents(level=-1, intermediate=True)Create a recursive list of children.

Note that the :param:‘intermediate‘ can be used to include every parents to the returned list, not only themost nested ones.

Parameters

• level (int) – The depth level to continue fetching parents from (default is -1, to getparents to the utter depths)

• intermediate (bool) – Also include the intermediate parents (default is True)

Returns The recursive children of the Term following the parameters

Return type pronto.TermList

__deref__dict – the Term as a dict without circular references.

__weakref__list of weak references to the object (if defined)

children~TermList – The direct children of the Term.

obostr – the Term serialized in an Obo [Term] stanza.

Note: The following guide was used: ftp://ftp.geneontology.org/pub/go/www/GO.format.obo-1_4.shtml

parents~TermList – The direct parents of the Term.

2.3.7 TermList

class pronto.TermListA list of Term instances.

TermList behaves exactly like a list, except it contains shortcuts to generate lists of terms’ attributes.

Example

>>> nmr = Ontology('tests/resources/nmrCV.owl')>>> type(nmr['NMR:1000031'].children)<class 'pronto.term.TermList'>

>>> nmr['NMR:1000031'].children.id[u'NMR:1000122', u'NMR:1000156', u'NMR:1000157', u'NMR:1000489']>>> nmr['NMR:1400014'].relations[Relationship('is_a')][<NMR:1400011: cardinal part of NMR instrument>]

Tip: It is also possible to call Term methods on a TermList to create another TermList:

16 Chapter 2. Contents:

Page 21: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto Documentation, Release dev

>>> nmr['NMR:1000031'].rchildren(3, False).rparents(3, False).id[u'NMR:1000031']

__contains__(term)Check if the TermList contains a term.

The method allows to check for the presence of a Term in a TermList based on a Term object or on a termaccession number.

Example

>>> from pronto import *>>> nmr = Ontology('tests/resources/nmrCV.owl')>>> 'NMR:1000122' in nmr['NMR:1000031'].childrenTrue>>> nmr['NMR:1000122'] in nmr['NMR:1000031'].childrenTrue

__init__(elements=None)Create a new TermList.

Parameters elements (collections.Iterable, optional) – an Iterable that yieldsTerm objects.

Raises TypeError – when the given elements are not instances of Term.

append(object)→ None – append object to end

extend(iterable)→ None – extend list by appending elements from the iterable

__weakref__list of weak references to the object (if defined)

children~TermList – the children of all the terms in the list.

desclist – the description of all the terms in the list.

idlist – a list of id corresponding to each term of the list.

namelist – the name of all the terms in the list.

obolist – all the terms in the term list serialized in obo.

otherlist – the “other” property of all the terms in the list.

parents~TermList – the parents of all the terms in the list.

2.4 To-do

2.4. To-do 17

Page 22: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto Documentation, Release dev

Todo: Change Ontology._get_parsers behaviour to look for parsers through a setuptools entrypoint insteadof mere subclasses.

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/pronto/checkouts/latest/pronto/ontology.py:docstringof pronto.Ontology._get_parsers, line 3.)

Todo:

• Add a warning for unknown relationship (the goal being to instantiate every known ontology relationship andeven allow instatiation of file-defined relationships).

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/pronto/checkouts/latest/pronto/relationship.py:docstringof pronto.Relationship.__new__, line 13.)

2.5 About

2.5.1 Author

pronto is developped and maintained by:

Martin LarraldeEcole Normale Supérieure de Cachan, [email protected]

2.5.2 Reference

If you wish to cite this library, please make sure you are using the latest version of the code, and use the DOI shownon the Zenodo record.

18 Chapter 2. Contents:

Page 23: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

CHAPTER 3

Indices and tables

• genindex

• search

19

Page 24: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto Documentation, Release dev

20 Chapter 3. Indices and tables

Page 25: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

Index

Symbols__contains__() (pronto.Ontology method), 8__contains__() (pronto.TermList method), 17__deref__ (pronto.Term attribute), 16__eq__() (pronto.Synonym method), 14__getitem__() (pronto.Ontology method), 8__hash__() (pronto.Synonym method), 14__hash__() (pronto.SynonymType method), 14__init__() (pronto.Description method), 11__init__() (pronto.Ontology method), 8__init__() (pronto.Relationship method), 12__init__() (pronto.Synonym method), 14__init__() (pronto.SynonymType method), 14__init__() (pronto.Term method), 15__init__() (pronto.TermList method), 17__iter__() (pronto.Ontology method), 8__len__() (pronto.Ontology method), 9__new__() (pronto.Description static method), 11__new__() (pronto.Relationship static method), 12__repr__() (pronto.Description method), 11__repr__() (pronto.Ontology method), 9__repr__() (pronto.Relationship method), 12__repr__() (pronto.Synonym method), 14__repr__() (pronto.SynonymType method), 14__repr__() (pronto.Term method), 15__weakref__ (pronto.Description attribute), 11__weakref__ (pronto.Relationship attribute), 13__weakref__ (pronto.Synonym attribute), 14__weakref__ (pronto.Term attribute), 16__weakref__ (pronto.TermList attribute), 17_empty_cache() (pronto.Ontology method), 9_empty_cache() (pronto.Term method), 15_get_parsers() (pronto.Ontology method), 9_include_term() (pronto.Ontology method), 9_include_term_list() (pronto.Ontology method), 9_obo_meta() (pronto.Ontology method), 9

Aadopt() (pronto.Ontology method), 9

append() (pronto.TermList method), 17

Bbottomup() (pronto.Relationship class method), 12

Cchildren (pronto.Term attribute), 16children (pronto.TermList attribute), 17complement() (pronto.Relationship method), 13

Ddesc (pronto.SynonymType attribute), 14desc (pronto.TermList attribute), 17Description (class in pronto), 11

Eextend() (pronto.TermList method), 17

Iid (pronto.TermList attribute), 17imports (pronto.Ontology attribute), 7include() (pronto.Ontology method), 9

Jjson (pronto.Ontology attribute), 11

Mmerge() (pronto.Ontology method), 10meta (pronto.Ontology attribute), 7

Nname (pronto.SynonymType attribute), 14name (pronto.TermList attribute), 17

Oobo (pronto.Ontology attribute), 11obo (pronto.Relationship attribute), 13obo (pronto.Synonym attribute), 14

21

Page 26: pronto Documentation - Read the Docspronto Documentation, Release dev Pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse obo and owlXML

pronto Documentation, Release dev

obo (pronto.SynonymType attribute), 15obo (pronto.Term attribute), 16obo (pronto.TermList attribute), 17Ontology (class in pronto), 7other (pronto.TermList attribute), 17

Pparents (pronto.Term attribute), 16parents (pronto.TermList attribute), 17parse() (pronto.Ontology method), 10path (pronto.Ontology attribute), 7

Rrchildren() (pronto.Term method), 15reference() (pronto.Ontology method), 10Relationship (class in pronto), 11resolve_imports() (pronto.Ontology method), 10rparents() (pronto.Term method), 16

Sscope (pronto.SynonymType attribute), 14Synonym (class in pronto), 14SynonymType (class in pronto), 14

TTerm (class in pronto), 15TermList (class in pronto), 16terms (pronto.Ontology attribute), 7topdown() (pronto.Relationship class method), 13

22 Index