Skip to content

Commit 3bb3be2

Browse files
authored
docs folder for integration with sphinx (#10)
* docs folder for integration with sphinx
1 parent 609bc8e commit 3bb3be2

20 files changed

+2632
-1
lines changed

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/requirements.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-r ../requirements.txt
2+
sphinx>=2.0.1
3+
myst-parser
4+
nbsphinx
5+
sphinx-autodoc-typehints
6+
sphinx-autodoc-annotation
7+
sphinx_rtd_theme
8+
sphinx_gallery
70.8 KB
Loading
2.1 MB
Loading

docs/source/api.rst

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
API
2+
===
3+
4+
Import Paste as::
5+
6+
from paste.visualization import plot_slice, stack_slices_pairwise, stack_slices_center
7+
from paste.PASTE import pairwise_align, center_align
8+
from paste.helper import filter_for_common_genes, match_spots_using_spatial_heuristic, match_spots_using_spatial_heuristic, apply_trsf
9+
10+
.. automodule:: paste
11+
12+
Alignment
13+
~~~~~~~~~
14+
15+
.. autosummary::
16+
:toctree: api
17+
18+
PASTE.pairwise_align
19+
PASTE.center_align
20+
21+
Visualization
22+
~~~~~~~~~~~~~
23+
24+
.. autosummary::
25+
:toctree: api
26+
27+
visualization.stack_slices_pairwise
28+
visualization.stack_slices_center
29+
visualization.plot_slice
30+
31+
Miscellaneous
32+
~~~~~~~~~~~~~
33+
34+
.. autosummary::
35+
:toctree: api
36+
37+
helper.filter_for_common_genes
38+
helper.match_spots_using_spatial_heuristic
39+
helper.apply_trsf
40+
41+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
paste.PASTE.center\_align
2+
=========================
3+
4+
.. currentmodule:: paste.PASTE
5+
6+
.. autofunction:: center_align
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
paste.PASTE.pairwise\_align
2+
===========================
3+
4+
.. currentmodule:: paste.PASTE
5+
6+
.. autofunction:: pairwise_align
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
paste.helper.apply\_trsf
2+
========================
3+
4+
.. currentmodule:: paste.helper
5+
6+
.. autofunction:: apply_trsf
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
paste.helper.filter\_for\_common\_genes
2+
=======================================
3+
4+
.. currentmodule:: paste.helper
5+
6+
.. autofunction:: filter_for_common_genes
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
paste.helper.match\_spots\_using\_spatial\_heuristic
2+
====================================================
3+
4+
.. currentmodule:: paste.helper
5+
6+
.. autofunction:: match_spots_using_spatial_heuristic
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
paste.visualization.plot\_slice
2+
===============================
3+
4+
.. currentmodule:: paste.visualization
5+
6+
.. autofunction:: plot_slice
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
paste.visualization.stack\_slices\_center
2+
=========================================
3+
4+
.. currentmodule:: paste.visualization
5+
6+
.. autofunction:: stack_slices_center
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
paste.visualization.stack\_slices\_pairwise
2+
===========================================
3+
4+
.. currentmodule:: paste.visualization
5+
6+
.. autofunction:: stack_slices_pairwise

docs/source/conf.py

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
from pathlib import Path
10+
11+
12+
# If extensions (or modules to document with autodoc) are in another directory,
13+
# add these directories to sys.path here. If the directory is relative to the
14+
# documentation root, use os.path.abspath to make it absolute, like shown here.
15+
#
16+
17+
import sys
18+
HERE = Path(__file__).parent
19+
sys.path.insert(0, str(HERE.parent.parent) + '/src')
20+
21+
# -- Project information -----------------------------------------------------
22+
23+
project = 'paste3'
24+
copyright = '2022, Raphael Lab'
25+
author = 'Ron Zeira, Max Land, Alexander Strzalkowski, Benjamin J. Raphael'
26+
27+
# The full version, including alpha/beta/rc tags
28+
release = '1.2.0'
29+
30+
31+
# -- General configuration ---------------------------------------------------
32+
33+
# Add any Sphinx extension module names here, as strings. They can be
34+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
35+
# ones.
36+
extensions = [
37+
"myst_parser",
38+
'sphinx.ext.autosummary',
39+
"sphinx.ext.autodoc",
40+
'sphinx.ext.napoleon',
41+
"sphinx_autodoc_typehints",
42+
"nbsphinx",
43+
"sphinx_gallery.load_style",
44+
"sphinx.ext.viewcode"
45+
]
46+
47+
# Moves Type hints from function header into description
48+
autodoc_typehints = "description"
49+
50+
51+
# Add any paths that contain templates here, relative to this directory.
52+
templates_path = ['_templates']
53+
54+
# List of patterns, relative to source directory, that match files and
55+
# directories to ignore when looking for source files.
56+
# This pattern also affects html_static_path and html_extra_path.
57+
exclude_patterns = []
58+
59+
# If true, the current module name will be prepended to all description
60+
# unit titles (such as .. function::).
61+
add_module_names = False
62+
63+
64+
65+
# -- Options for HTML output -------------------------------------------------
66+
67+
# The theme to use for HTML and HTML Help pages. See the documentation for
68+
# a list of builtin themes.
69+
#
70+
html_theme = 'sphinx_rtd_theme'
71+
72+
# Add any paths that contain custom static files (such as style sheets) here,
73+
# relative to this directory. They are copied after the builtin static files,
74+
# so a file named "default.css" will overwrite the builtin "default.css".
75+
html_static_path = ['_static']
76+
77+
html_show_sourcelink = False
78+
html_show_sphinx = False
79+
80+
81+
82+
nbsphinx_thumbnails = {
83+
"notebooks/getting-started": "_static/images/breast_stack_2d.png",
84+
}

docs/source/index.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
|PyPI| |Downloads|
2+
3+
PASTE: Probabilistic Alignment of Spatial Transcriptomics Experiments
4+
=====================================================================
5+
6+
**PASTE** is a computational method that leverages both gene expression similarity and spatial distances between spots to align and integrate spatial transcriptomics data.
7+
In particular, PASTE provides two main functionalities:
8+
9+
1. Pairwise Alignment: align spots across pairwise slices.
10+
2. Center Alignment: integrate multiple slices into one center slice.
11+
12+
.. image:: _static/images/paste_overview.png
13+
:alt: PASTE Overview Figure
14+
:width: 800px
15+
:align: center
16+
17+
|
18+
19+
Manuscript
20+
----------
21+
22+
You can view our `preprint <https://www.biorxiv.org/content/10.1101/2021.03.16.435604v1>`_ on **bioRxiv**.
23+
24+
.. toctree::
25+
:maxdepth: 2
26+
:caption: Contents:
27+
:hidden:
28+
29+
installation
30+
api
31+
tutorial
32+
33+
34+
.. |PyPI| image:: https://img.shields.io/pypi/v/paste-bio.svg
35+
:target: https://pypi.org/project/paste-bio/
36+
:alt: PyPI
37+
38+
.. |Downloads| image:: https://pepy.tech/badge/paste-bio
39+
:target: https://pepy.tech/project/paste-bio
40+
:alt: Downloads

docs/source/installation.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Installation
2+
3+
The easiest way is to install PASTE on pypi: https://pypi.org/project/paste-bio/.
4+
5+
`pip install paste-bio`
6+
7+
Or you can install PASTE on bioconda: https://anaconda.org/bioconda/paste-bio.
8+
9+
`conda install -c bioconda paste-bio`
10+
11+
Note: `pip` is our recommended choice of installation.

0 commit comments

Comments
 (0)