Skip to content

Commit

Permalink
Merge pull request #14 from biolink/rtd
Browse files Browse the repository at this point in the history
Preparing docs for RTD
  • Loading branch information
cmungall committed May 15, 2017
2 parents 68b1dc4 + f15f640 commit d548d93
Show file tree
Hide file tree
Showing 38 changed files with 6,214 additions and 128 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CHANGES
-------

* todo
323 changes: 323 additions & 0 deletions CONTRIBUTING.md

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test:

# only run local tests
travis_test:
pytest tests/*local*.py
pytest tests/test_*local*.py tests/test_*parser*.py

cleandist:
rm dist/*
Expand All @@ -24,3 +24,6 @@ release: cleandist

nb:
PYTHONPATH=.. jupyter notebook

foo:
./bin/flask2marshmallow.pl ../biolink-api/biolink/datamodel/serializers.py
30 changes: 4 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Build Status](https://travis-ci.org/biolink/ontobio.svg?branch=master)](https://travis-ci.org/biolink/ontobio)
<[![Build Status](https://travis-ci.org/biolink/ontobio.svg?branch=master)](https://travis-ci.org/biolink/ontobio)
[![DOI](https://zenodo.org/badge/13996/biolink/ontobio.svg)](https://zenodo.org/badge/latestdoi/13996/biolink/ontobio)
[![PyPI](https://img.shields.io/pypi/v/ontobio.svg)](https://pypi.python.org/pypi/ontobio)

# ontobio - a python API for working with ontologies and associations

Expand All @@ -11,35 +12,12 @@ The ontologies and associations can either be local files or provided
by remote services (currently the OntoBee SPARQL service for
ontologies and a Monarch or GO Golr service for associations).

# API Docs
# Documentation

[ontobio](https://www.pydoc.io/pypi/ontobio-0.1.6/index.html) on pydoc.io

# Command Line

See the README in the [bin](https://github.com/biolink/ontobio/tree/master/bin) directory
Documentation is on [readthedocs](https://ontobio.readthedocs.io)

# Notebooks

See the [Jupyter Notebooks](http://nbviewer.jupyter.org/github/biolink/ontobio/tree/master/notebooks/) for code examples

# Basics

There are two ways of initiating an ontology object:

* via a local obo-json file
* via remote connections to OBO PURLs
* via remote query to a SPARQL service (currently ontobee, but soon others)

Persistent caching is used (currently cachier) to avoid repeated expensive I/O connections

This is handled via the [ontol_manager.py](ontobio/ontol_manager.py)
module. This creates an ontology object (see [ontol.py](ontobio/ontol.py) ).

Note that object modeling is lightweight - we use the python networkx
package for representing the basic graph portion of an ontology. See
also the [obographs](https://github.com/geneontology/obographs) spec.

# Associations

See the ontobio.golr package
7 changes: 5 additions & 2 deletions bin/ogr-assoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ def main():
parser.add_argument('-r', '--resource', type=str, required=False,
help='Name of ontology')
parser.add_argument('-f', '--assocfile', type=str, required=False,
help='Name of input file for associations - currently GAF is assumed')
help='Name of input file for associations')
parser.add_argument('--assocformat', type=str, default='gaf', required=False,
help='Format of association file, if passed (default: gaf)')
parser.add_argument('-o', '--outfile', type=str, required=False,
help='Path to output file')
parser.add_argument('-t', '--to', type=str, required=False,
Expand Down Expand Up @@ -154,7 +156,8 @@ def main():
aset = None
if args.assocfile is not None:
aset = afactory.create_from_file(file=args.assocfile,
ontology=ont)
fmt=args.assocformat,
ontology=ont)
else:
# create using GO/Monarch services
aset = afactory.create(ontology=ont,
Expand Down
4 changes: 2 additions & 2 deletions bin/qbiogolr.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Type:
qbiogorl -h
qbiogolr -h
For instructions
Expand All @@ -14,7 +14,7 @@
import argparse
from ontobio.golr.golr_associations import search_associations_compact
from ontobio.ontol_factory import OntologyFactory
from ontobio.graph_io import *
from ontobio.io.ontol_renderers import *
import networkx as nx
from networkx.algorithms.dag import ancestors, descendants
from networkx.drawing.nx_pydot import write_dot
Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = ontobio
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
34 changes: 34 additions & 0 deletions docs/analyses.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. _analyses:

Ontology-Based Analyses
=======================

.. warning ::
In the future the analysis methods may migrate from the `Ontology`
class to dedicated analysis engine classes.
Enrichment
----------

See the `Notebook example <http://nbviewer.jupyter.org/github/biolink/ontobio/blob/master/notebooks/Phenotype_Enrichment.ipynb>`_

Semantic Similarity
-------------------

**TODO**

Slimming
--------

**TODO**

Graph Reduction
---------------

**TODO**

Lexical Analyses
----------------

**TODO**
100 changes: 100 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
.. _api:

API
===

.. currentmodule:: ontobio

Ontology Access
---------------

Factory
^^^^^^^

The OntologyFactory class provides a means of creating an ontology
object backed by either local files or remote services. See
:ref:`inputs` for more details.

.. currentmodule:: ontobio.ontol_factory

.. autoclass:: OntologyFactory
:members:

Ontology Object Model
^^^^^^^^^^^^^^^^^^^^^

.. currentmodule:: ontobio.ontol

.. autoclass:: Ontology
:members:
:inherited-members:

.. autoclass:: Synonym
:members:
:inherited-members:

.. autoclass:: LogicalDefinition
:members:
:inherited-members:


Assocation Access
-----------------

Factory
^^^^^^^

.. currentmodule:: ontobio.assoc_factory

.. autoclass:: AssociationSetFactory
:members:

Assocation Object Model
^^^^^^^^^^^^^^^^^^^^^^^

.. currentmodule:: ontobio.assocmodel

.. autoclass:: AssociationSet
:members:

**TODO** - detailed association modeling

Association File Parsers
^^^^^^^^^^^^^^^^^^^^^^^^

.. currentmodule:: ontobio.io.gafparser

.. autoclass:: AssocParser
:members:
:inherited-members:


.. autoclass:: GafParser
:members:
:inherited-members:


.. autoclass:: GpadParser
:members:
:inherited-members:

.. autoclass:: HpoaParser
:members:
:inherited-members:

.. autoclass:: AssocParserConfig
:members:


GOlr Queries
------------

.. currentmodule:: ontobio.golr.golr_query

.. autoclass:: GolrAssociationQuery
:members:

.. autoclass:: GolrSearchQuery
:members:


10 changes: 10 additions & 0 deletions docs/biolink.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
:: _biolink:

Biolink
=======

Biolink is a REST API layer that leverages ontobio

https://github.com/biolink/biolink-api


1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. include:: ../CHANGELOG.rst

0 comments on commit d548d93

Please sign in to comment.