-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
181 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = Bio2BELCHEBI | ||
SOURCEDIR = source | ||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import os | ||
import re | ||
import sys | ||
|
||
sys.path.insert(0, os.path.abspath('../../src')) | ||
|
||
extensions = [ | ||
'sphinx.ext.autodoc', | ||
'sphinx.ext.intersphinx', | ||
'sphinx.ext.todo', | ||
'sphinx.ext.coverage', | ||
'sphinx.ext.viewcode' | ||
] | ||
templates_path = ['_templates'] | ||
source_suffix = '.rst' | ||
master_doc = 'index' | ||
project = 'Bio2BEL ChEBI' | ||
copyright = '2017-2018, Charles Tapley Hoyt' | ||
author = 'Charles Tapley Hoyt' | ||
|
||
release = '0.0.1-dev' | ||
|
||
parsed_version = re.match( | ||
'(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?:-(?P<release>[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+(?P<build>[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?', | ||
release | ||
) | ||
version = parsed_version.expand('\g<major>.\g<minor>.\g<patch>') | ||
|
||
if parsed_version.group('release'): | ||
tags.add('prerelease') | ||
|
||
language = None | ||
exclude_patterns = [] | ||
pygments_style = 'sphinx' | ||
todo_include_todos = True | ||
html_theme = 'sphinx_rtd_theme' | ||
html_static_path = [] | ||
htmlhelp_basename = 'bioebel_chebidoc' | ||
latex_elements = {} | ||
latex_documents = [ | ||
(master_doc, 'bio2bel_chebi.tex', 'Bio2BEL ChEBI Documentation', 'Charles Tapley Hoyt', 'manual'), | ||
] | ||
man_pages = [ | ||
(master_doc, 'Bio2BEL ChEBI', 'Bio2BEL ChEBI Documentation', [author], 1) | ||
] | ||
texinfo_documents = [ | ||
(master_doc, 'Bio2BEL ChEBI', 'Bio2BEL ChEBI Documentation', author, 'Bio2BEL ChEBI', 'Serialize ChEBI to BEL', 'Miscellaneous'), | ||
] | ||
|
||
# Example configuration for intersphinx: refer to the Python standard library. | ||
intersphinx_mapping = { | ||
'python': ('https://docs.python.org/3', None), | ||
'networkx': ('https://networkx.github.io/', None), | ||
'sqlalchemy': ('https://docs.sqlalchemy.org/en/latest', None), | ||
'pybel': ('https://pybel.readthedocs.io/en/latest/', None), | ||
} | ||
|
||
autodoc_member_order = 'bysource' | ||
autoclass_content = 'both' | ||
|
||
if os.environ.get('READTHEDOCS'): | ||
tags.add('readthedocs') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Constants | ||
========= | ||
.. automodule:: bio2bel_chebi.constants | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Enrichment | ||
========== | ||
.. automodule:: bio2bel_chebi.enrich | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Bio2BEL ChEBI | ||
============= | ||
.. automodule:: bio2bel_chebi | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
enrichment | ||
manager | ||
constants | ||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Manager | ||
========== | ||
.. automodule:: bio2bel_chebi.manager | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ tqdm | |
pybel>=0.9.5 | ||
pybel_tools>=0.4.5 | ||
bio2bel | ||
flask[web] | ||
flask_admin[web] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import logging | ||
|
||
from pybel import to_database | ||
from .manager import Manager | ||
|
||
__all__ = [ | ||
'enrich_chemical_hierarchy', | ||
'to_bel', | ||
'upload_bel' | ||
] | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
def enrich_chemical_hierarchy(graph, manager=None): | ||
"""Enriches the biological processses in a BEL graph | ||
:type graph: pybel.BELGraph | ||
:type manager: Optional[bio2bel_chebi.Manager] | ||
""" | ||
manager = manager or Manager() | ||
manager.enrich_chemical_hierarchy(graph) | ||
|
||
|
||
def to_bel(manager=None): | ||
"""Creates a BEL graph from the Gene Ontology | ||
:type manager: Optional[bio2bel_chebi.Manager] | ||
""" | ||
manager = manager or Manager() | ||
return manager.to_bel() | ||
|
||
|
||
def upload_bel(manager=None, pybel_manager=None): | ||
"""Creates a BEL graph from the Gene Ontology and uplopads it to the PyBEL edge store | ||
:type manager: Optional[bio2bel_chebi.Manager] | ||
:type pybel_manager: Optional[pybel.Manager] | ||
:rtype: pybel.manager.models.Network | ||
""" | ||
log.info('converting bel') | ||
graph = to_bel(manager=manager) | ||
log.info('storing') | ||
return to_database(graph, connection=pybel_manager) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters