Skip to content

Commit

Permalink
updated github test, sphynx docs generation, notebooks, readthedoc.ya…
Browse files Browse the repository at this point in the history
…ml and README
  • Loading branch information
marcorusc committed Apr 18, 2024
1 parent c466bba commit 2012bb9
Show file tree
Hide file tree
Showing 16 changed files with 12,921 additions and 99 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/sphinx_autodoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.10.13
- name: Install pandoc
run: sudo apt-get install -y pandoc
- name: Load cached Poetry installation
uses: actions/cache@v2
with:
Expand Down
28 changes: 9 additions & 19 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
version: 2

sphinx:
builder: html
configuration: docs/source/conf.py
fail_on_warning: true

formats:
- htmlzip
- pdf

build:
os: ubuntu-22.04
tools:
python: 3.10

os: ubuntu-22.04
tools:
python: "3.10"
sphinx:
configuration: docs/src/conf.py
python:
install:
- method: pip
path: .
extra_requirements:
- docs
install:
- method: pip
path: .
- requirements: docs/src/requirements.txt
25 changes: 0 additions & 25 deletions README.md

This file was deleted.

24 changes: 24 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
==================
Neko
==================

:target: /~https://github.com/sysbio-curie/Neko/actions/workflows/test.yml
:alt: Tests

.. image:: https://img.shields.io/readthedocs/omniflow_project
:target: https://neko.readthedocs.io
:alt: Documentation

Package to extract, visualize, convert and study interactions from database into executable activity flow based model.
Neko, is based on `Omnipath </~https://github.com/saezlab/omnipath>`_, `Pypath </~https://github.com/saezlab/pypath>`_ and `Atopo </~https://github.com/druglogics/atopo>`_.

This is a work-in-progress package made in collaboration with Dénes Turei and Asmund Flobak.

CURRENT FEATURES:

version 0.9.0
--------------

- Network creation and manipulation: The package allows for the creation of a network of nodes and edges, with various methods for enrichment analysis. This includes adding and removing nodes and edges, loading a network from a SIF (Simple Interaction Format) file, and adding paths to the edge list of the network.
- Connection of nodes: The package provides several methods to connect nodes in the network. This includes connecting all nodes, connecting a subgroup of nodes, connecting all nodes of a network object, and connecting subcomponents of a network object.
- Connection of genes to phenotype: The package provides a method to connect genes to a phenotype based on provided parameters. This includes retrieving phenotype markers, identifying unique Uniprot genes, and connecting them to the network. There is also an option to compress the network by substituting specified genes with the phenotype name.
64 changes: 37 additions & 27 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,52 +17,59 @@
here = pathlib.Path(__file__).parent
sys.path.insert(0, str(here.parent))

import neko # noqa: E402
from neko._metadata import __version__, __author__ # noqa: E402

# -- Project information -----------------------------------------------------

project = 'neko'
version = neko.__version__
author = ', '.join(neko.__author__)
version = __version__
author = ', '.join(__author__)
years = '-'.join(sorted({'2022', f'{datetime.now():%Y}'}))
copyright = f'{years}, Saez Lab'
repository_url = '/~https://github.com/sysbio-curie/neko'
copyright = f'{years}, Sysbio-Curie'
repository_url = '/~https://github.com/sysbio-curie/Neko'

# thank you stupid sphinx, thank you stupid github :((( <-- directly taken from conf.py of Pypath XD
readme_lines = []
readme = pathlib.Path().absolute().parents[1].joinpath('README.rst')

if readme.exists():

with readme.open('r') as fp:

readme_lines = fp.readlines()[4:]

with open('index.rst', 'w') as fp:

fp.write('==================\n Neko \n==================\n\n')
fp.write(''.join(readme_lines))

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named "sphinx.ext.*") or your custom
# ones.
extensions = [
'myst_parser',
'sphinx.ext.duration',
'sphinx.ext.doctest',
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
'sphinx.ext.todo', # not for output but to remove warnings
'sphinx.ext.githubpages',
'sphinx.ext.viewcode',
'sphinx.ext.ifconfig',
'sphinxcontrib.bibtex',
'sphinx_autodoc_typehints',
'sphinx.ext.mathjax',
'sphinx_copybutton',
'sphinx_last_updated_by_git',
'sphinxcontrib.fulltoc',
'sphinx_remove_toctrees',
'sphinx.ext.intersphinx',
'sphinx.ext.autosectionlabel',
'numpydoc',
'nbsphinx',
'IPython.sphinxext.ipython_console_highlighting',
'IPython.sphinxext.ipython_console_highlighting'
]

autosummary_generate = True
autodoc_member_order = 'groupwise'
default_role = 'literal'
napoleon_google_docstring = False
napoleon_numpy_docstring = True
numpydoc_show_class_members = False # don't show class members in both class and __init__ docstrings
napoleon_include_init_with_doc = False
napoleon_use_rtype = True # having a separate entry generally helps readability
napoleon_use_param = True

nbsphinx_execute = 'never'
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand All @@ -73,10 +80,12 @@
# Usually you set "language" from the command line for these cases.
language = 'en'

# Add bibtex files
bibtex_bibfiles = ['references.bib']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'contents'
Expand All @@ -99,11 +108,12 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.

html_theme = 'pydata_sphinx_theme'
html_theme_options = {
'navigation_depth': 2,
'collapse_navigation': True,
}
html_theme = 'sphinx_rtd_theme'

html_theme_options = dict(
logo_only=True,
display_version=True,
)
html_context = {
'display_github': True, # Integrate GitHub
'github_user': 'sysbio-curie', # Username
Expand Down
22 changes: 22 additions & 0 deletions docs/src/contents.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Contents
========

.. toctree::
:maxdepth: 3

index
api

Notebooks
=========

.. toctree::
:maxdepth: 2
:caption: Notebooks

notebooks/1_network_building
notebooks/2_add_resources
notebooks/3_build_phosphosite_network
notebooks/4_Connect_upstream
notebooks/5_ontology
notebooks/6_tissue_mapping
40 changes: 17 additions & 23 deletions docs/src/index.rst
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
############
Introduction
############
==================
Neko
==================

Created from a project template. Please write the docs of your project here,
and remove the parts below (or edit ``README.rst`` in the project root).
:target: /~https://github.com/sysbio-curie/Neko/actions/workflows/test.yml
:alt: Tests

.. include:: ../../README.rst
.. image:: https://img.shields.io/readthedocs/omniflow_project
:target: https://neko.readthedocs.io
:alt: Documentation

#########
Reference
#########
Package to extract, visualize, convert and study interactions from database into executable activity flow based model.
Neko, is based on `Omnipath </~https://github.com/saezlab/omnipath>`_, `Pypath </~https://github.com/saezlab/pypath>`_ and `Atopo </~https://github.com/druglogics/atopo>`_.

project_name
============
This is a work-in-progress package made in collaboration with Dénes Turei and Asmund Flobak.

.. automodule:: project_name
:members:
CURRENT FEATURES:

###########################
Indices, Tables, and Search
###########################
version 0.9.0
--------------

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


.. toctree::
:maxdepth: 4
- Network creation and manipulation: The package allows for the creation of a network of nodes and edges, with various methods for enrichment analysis. This includes adding and removing nodes and edges, loading a network from a SIF (Simple Interaction Format) file, and adding paths to the edge list of the network.
- Connection of nodes: The package provides several methods to connect nodes in the network. This includes connecting all nodes, connecting a subgroup of nodes, connecting all nodes of a network object, and connecting subcomponents of a network object.
- Connection of genes to phenotype: The package provides a method to connect genes to a phenotype based on provided parameters. This includes retrieving phenotype markers, identifying unique Uniprot genes, and connecting them to the network. There is also an option to compress the network by substituting specified genes with the phenotype name.
Loading

0 comments on commit 2012bb9

Please sign in to comment.