From 971851e023884cd3d037d7a4fba27be8037be726 Mon Sep 17 00:00:00 2001 From: DoronHav Date: Wed, 24 Apr 2024 14:23:38 -0400 Subject: [PATCH] add modules --- docs/docs_requirements.txt | 12 +++++- docs/source/conf.py | 79 ++++++++++++++++++++++++++++++-------- docs/source/index.rst | 61 +++++++---------------------- 3 files changed, 86 insertions(+), 66 deletions(-) diff --git a/docs/docs_requirements.txt b/docs/docs_requirements.txt index 9544a9a..4a6600f 100644 --- a/docs/docs_requirements.txt +++ b/docs/docs_requirements.txt @@ -1,2 +1,10 @@ -sphinx_rtd_theme >= 2.0.0 -myst_parser >= 3.0.0 +sphinxcontrib-autoprogram +sphinxcontrib-napoleon +sphinx-autodocgen +sphinx-github-style +sphinx-mdinclude +m2r2 +nbsphinx +furo +typing-extensions +IPython \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 690c3f5..6ee8ce2 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -6,33 +6,78 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html -project = 'scenvi' -copyright = '2024, DoronHav' -author = 'DoronHav' -release = '0.3.1' - -# -- General configuration --------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration +# -- Path setup -------------------------------------------------------------- +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# import os import sys -sys.path.insert(0, os.path.abspath('../..')) +from pathlib import Path + +sys.path.insert(0, os.path.abspath("../../src")) + +this_directory = Path(__file__).parent + + + + +# -- Project information ----------------------------------------------------- + +project = "scenvi" +copyright = "2024, " + 'Doron Haviv' +author = 'Doron Haviv' + +# The full version, including alpha/beta/rc tags +release = '3.0.2' + + +# -- 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 = [ - 'sphinx.ext.autodoc', - 'sphinx_rtd_theme', - 'myst_parser'] + "sphinx.ext.autodoc", + "nbsphinx", + "sphinx.ext.napoleon", + "sphinx_mdinclude", +] +if os.environ.get('READTHEDOCS') == 'True': + extensions.append("sphinx_github_style") + +source_suffix = [".rst", ".md"] -templates_path = ['_templates'] -exclude_patterns = [] +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ["_build", "**.ipynb_checkpoints"] # -- Options for HTML output ------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output -html_theme = 'sphinx_rtd_theme' -html_static_path = ['_static'] +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "furo" +pygments_style = "tango" + +highlight_language = "none" + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = [] + -autoclass_content = 'both' \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst index 0ea6cf4..f9165ef 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -3,58 +3,25 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to scenvi's documentation! -================================== - -ENVI is a deep learnining based variational inference method to integrate scRNA-seq with spatial transcriptomics data. ENVI learns to reconstruct spatial onto for dissociated scRNA-seq data and impute unimagd genes onto spatial data. - -This implementation is written in Python3 and relies on jax, flax, sklearn, scipy and scanpy. - - -To install JAX, simply run the command: - - pip install -U "jax[cuda12_pip]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html - -And to install ENVI along with the rest of the requirements: - - pip install scenvi - -To run ENVI: - - import scenvi - - envi_model = scenvi.ENVI(spatial_data = st_data, sc_data = sc_data) - - envi_model.train() - envi_model.impute_genes() - envi_model.infer_niche_covet() - envi_model.infer_niche_celltype() - - st_data.obsm['envi_latent'] = envi_model.spatial_data.obsm['envi_latent'] - st_data.uns['COVET_genes'] = envi_model.CovGenes - st_data.obsm['COVET'] = envi_model.spatial_data.obsm['COVET'] - st_data.obsm['COVET_SQRT'] = envi_model.spatial_data.obsm['COVET_SQRT'] - st_data.obsm['cell_type_niche'] = envi_model.spatial_data.obsm['cell_type_niche'] - st_data.obsm['imputation'] = envi_model.spatial_data.obsm['imputation'] - - - sc_data.obsm['envi_latent'] = envi_model.sc_data.obsm['envi_latent'] - sc_data.uns['COVET_genes'] = envi_model.CovGenes - sc_data.obsm['COVET'] = envi_model.sc_data.obsm['COVET'] - sc_data.obsm['COVET_SQRT'] = envi_model.sc_data.obsm['COVET_SQRT'] - sc_data.obsm['cell_type_niche'] = envi_model.sc_data.obsm['cell_type_niche'] - - -And to just compute COVET for spatial data: - - st_data.obsm['COVET'], st_data.obsm['COVET_SQRT'], st_data.uns['CovGenes'] = scenvi.compute_covet(st_data) - .. toctree:: :hidden: - :maxdepth: 2 + :maxdepth: 4 :caption: Modules: modules +.. toctree:: + :hidden: + :caption: Tutorials: + + MOp_MERFISH_tutorial.ipynb + +.. mdinclude:: ../../README.md + +Index +===== + +* :ref:`genindex` +