Skip to content

Commit

Permalink
refresh theme and main pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ckmah committed Apr 11, 2024
1 parent ea77b78 commit a6bc0e4
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 138 deletions.
9 changes: 9 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
display: inline-block;
}

/* right margin */
.sd-octicon {
margin-right: 0.3em !important;
}

/* .headerlink{
} */

/* Font size */
/* --pst-font-size-base: 14px; base font size - applied at body / html level */

Expand Down
44 changes: 17 additions & 27 deletions docs/source/api.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
```{toctree}
:maxdepth: 2
:hidden: true
```

```{eval-rst}
.. module:: bento
```


# {octicon}`code-square` API

Import Bento with:
Expand All @@ -32,7 +32,7 @@ Bento's API structure takes inspiration from other libraries in the Scverse ecos

`bt.ut`: utility functions

# Read/Write
## Read/Write

Bento is designed to work with [`SpatialData`](https://spatialdata.scverse.org/en/latest/) objects out of the box! Check out [SpatialData documentation](https://spatialdata.scverse.org/en/latest/tutorials/notebooks/notebooks.html) to learn how to bring your own data, whether it is from commercial platforms or a custom data format.

Expand All @@ -46,9 +46,9 @@ Bento is designed to work with [`SpatialData`](https://spatialdata.scverse.org/e
prep
```

# Tools
## Tools

## Point Features
### Point Features

Compute spatial summary statistics describing groups of molecules e.g. distance to the cell membrane, relative symmetry, dispersion, etc. The set of available point features is described in the Point Feature Catalog. Use the function `bt.tl.analyze_points()` to compute features and add your own custom calculation. See the [tutorial](https://bento-tools.github.io/bento/tutorials/TBD.html) for more information.

Expand All @@ -64,12 +64,11 @@ Compute spatial summary statistics describing groups of molecules e.g. distance
register_point_feature
```

## Shape Features
### Shape Features

Compute spatial properties of shape features e.g. area, aspect ratio, etc. of the cell, nucleus, or other region of interest. The set of available shape features is described in the Shape Feature Catalog. Use the function `bt.analyze_points()` to compute features and add your own custom calculation. See the [tutorial](https://bento-tools.github.io/bento/tutorials/TBD.html) for more information.

```{eval-rst}
.. currentmodule:: bento.tl
.. autosummary::
:toctree: api
Expand All @@ -81,12 +80,11 @@ Compute spatial properties of shape features e.g. area, aspect ratio, etc. of th
register_shape_feature
```

### Shape Feature Catalog
#### Shape Feature Catalog

The set of implemented shape features is described below. Each feature is computed using the `bt.analyze_shapes()` function.

```{eval-rst}
.. currentmodule:: bento.tl
.. autosummary::
:toctree: api
Expand All @@ -105,12 +103,11 @@ The set of implemented shape features is described below. Each feature is comput
```

## RNAflux: Subcellular RNA embeddings and domains
### RNAflux: Subcellular RNA embeddings and domains

Methods for computing RNAflux embeddings and semantic segmentation of subcellular domains.

```{eval-rst}
.. currentmodule:: bento.tl
.. autosummary::
:toctree: api
Expand All @@ -124,12 +121,11 @@ Methods for computing RNAflux embeddings and semantic segmentation of subcellula
load_gene_sets
```

## RNAforest: Predict RNA localization patterns
### RNAforest: Predict RNA localization patterns

Perform multilabel classification of RNA localization patterns using spatial summary statistics as features.

```{eval-rst}
.. currentmodule:: bento.tl
.. autosummary::
:toctree: api
Expand All @@ -141,12 +137,11 @@ Perform multilabel classification of RNA localization patterns using spatial sum
lp_diff_continuous
```

## RNAcoloc: Colocalization analysis
### RNAcoloc: Colocalization analysis

Methods for compartments-ecific gene-gene colocalization analyses.

```{eval-rst}
.. currentmodule:: bento.tl
.. autosummary::
:toctree: api
Expand All @@ -156,11 +151,11 @@ Methods for compartments-ecific gene-gene colocalization analyses.
coloc_quotient
```

# Plotting
## Plotting

These are convenient functions for static 2D plots of cells, molecules, and embeddings. We generate `matplotlib` style figures for accessible publication quality plots. There are a couple additional functions summarizing results from `bt.tl` analysis.

## Spatial plots
### Spatial plots

```{eval-rst}
.. currentmodule:: bento.pl
Expand All @@ -174,10 +169,9 @@ These are convenient functions for static 2D plots of cells, molecules, and embe
shapes
```

## Shape features
### Shape features

```{eval-rst}
.. currentmodule:: bento.pl
.. autosummary::
:toctree: api
Expand All @@ -186,10 +180,9 @@ These are convenient functions for static 2D plots of cells, molecules, and embe
shape_stats
```

## RNAflux
### RNAflux

```{eval-rst}
.. currentmodule:: bento.pl
.. autosummary::
:toctree: api
Expand All @@ -201,10 +194,9 @@ These are convenient functions for static 2D plots of cells, molecules, and embe
fe
```

## RNAforest
### RNAforest

```{eval-rst}
.. currentmodule:: bento.pl
.. autosummary::
:toctree: api
Expand All @@ -216,10 +208,9 @@ These are convenient functions for static 2D plots of cells, molecules, and embe
lp_genes
```

## Colocalization analysis
### Colocalization analysis

```{eval-rst}
.. currentmodule:: bento.pl
.. autosummary::
:toctree: api
Expand All @@ -229,8 +220,7 @@ These are convenient functions for static 2D plots of cells, molecules, and embe
colocation
```

---
# Manipulating spatial data
## Manipulating spatial data

Convenient methods for setting, getting, and reformatting data. These functions are used internally by other functions in Bento.

Expand All @@ -251,7 +241,7 @@ Convenient methods for setting, getting, and reformatting data. These functions
set_shape_metadata
```

# Utility functions
## Utility functions

```{eval-rst}
.. currentmodule:: bento.ut
Expand Down
47 changes: 20 additions & 27 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
import os
import sys
from dataclasses import asdict

from sphinxawesome_theme import LinkIcon, ThemeOptions

sys.path.insert(0, os.path.abspath("..")) # Source code dir relative to this file

Expand Down Expand Up @@ -66,24 +69,29 @@
#
html_theme = "sphinxawesome_theme"

from sphinxawesome_theme import LinkIcon

html_theme_options = {
"show_breadcrumbs": True,
"awesome_external_links": True,
"extra_header_link_icons": {
theme_options = ThemeOptions(
show_scrolltop=True,
show_breadcrumbs=True,
awesome_external_links=True,
main_nav_links={
"Installation": "installation",
"Tutorials": "tutorials",
"How it Works": "howitworks",
"API": "api",
},
extra_header_link_icons={
"GitHub": LinkIcon(
dict(
link="https://github.com/ckmah/bento-tools",
icon='<svg fill="currentColor" height="26px" style="margin-top:-2px;display:inline" viewBox="0 0 45 44" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22.477.927C10.485.927.76 10.65.76 22.647c0 9.596 6.223 17.736 14.853 20.608 1.087.2 1.483-.47 1.483-1.047 0-.516-.019-1.881-.03-3.693-6.04 1.312-7.315-2.912-7.315-2.912-.988-2.51-2.412-3.178-2.412-3.178-1.972-1.346.149-1.32.149-1.32 2.18.154 3.327 2.24 3.327 2.24 1.937 3.318 5.084 2.36 6.321 1.803.197-1.403.759-2.36 1.379-2.903-4.823-.548-9.894-2.412-9.894-10.734 0-2.37.847-4.31 2.236-5.828-.224-.55-.969-2.759.214-5.748 0 0 1.822-.584 5.972 2.226 1.732-.482 3.59-.722 5.437-.732 1.845.01 3.703.25 5.437.732 4.147-2.81 5.967-2.226 5.967-2.226 1.185 2.99.44 5.198.217 5.748 1.392 1.517 2.232 3.457 2.232 5.828 0 8.344-5.078 10.18-9.916 10.717.779.67 1.474 1.996 1.474 4.021 0 2.904-.027 5.247-.027 5.96 0 .58.392 1.256 1.493 1.044C37.981 40.375 44.2 32.24 44.2 22.647c0-11.996-9.726-21.72-21.722-21.72" fill="currentColor" fill-rule="evenodd"></path></svg>',

)
link="https://github.com/ckmah/bento-tools",
icon='<svg fill="currentColor" height="26px" style="margin-top:-2px;display:inline" viewBox="0 0 45 44" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22.477.927C10.485.927.76 10.65.76 22.647c0 9.596 6.223 17.736 14.853 20.608 1.087.2 1.483-.47 1.483-1.047 0-.516-.019-1.881-.03-3.693-6.04 1.312-7.315-2.912-7.315-2.912-.988-2.51-2.412-3.178-2.412-3.178-1.972-1.346.149-1.32.149-1.32 2.18.154 3.327 2.24 3.327 2.24 1.937 3.318 5.084 2.36 6.321 1.803.197-1.403.759-2.36 1.379-2.903-4.823-.548-9.894-2.412-9.894-10.734 0-2.37.847-4.31 2.236-5.828-.224-.55-.969-2.759.214-5.748 0 0 1.822-.584 5.972 2.226 1.732-.482 3.59-.722 5.437-.732 1.845.01 3.703.25 5.437.732 4.147-2.81 5.967-2.226 5.967-2.226 1.185 2.99.44 5.198.217 5.748 1.392 1.517 2.232 3.457 2.232 5.828 0 8.344-5.078 10.18-9.916 10.717.779.67 1.474 1.996 1.474 4.021 0 2.904-.027 5.247-.027 5.96 0 .58.392 1.256 1.493 1.044C37.981 40.375 44.2 32.24 44.2 22.647c0-11.996-9.726-21.72-21.722-21.72" fill="currentColor" fill-rule="evenodd"></path></svg>',
)
},
}
)

html_theme_options = asdict(theme_options)

html_sidebars = {
"**": ["sidebar_main_nav_links.html", "sidebar_toc.html"]
"**": ["sidebar_main_nav_links.html", "sidebar_toc.html"]
}

html_context = {"default_mode": "auto"}
Expand Down Expand Up @@ -115,18 +123,3 @@
# -- Options for extensions -------------------------------------------------------------------------------

nb_execution_mode = "off"

# This is for including API docs in the toctree
def setup(app):
"""App setup hook."""
app.add_config_value(
"recommonmark_config",
{
"auto_toc_tree_section": "Contents",
"enable_auto_toc_tree": True,
"enable_math": True,
"enable_inline_math": False,
"enable_eval_rst": True,
},
True,
)
4 changes: 4 additions & 0 deletions docs/source/howitworks.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
```{toctree}
:hidden: true
```

# {octicon}`gear` How it Works

## Data Structure
Expand Down
44 changes: 22 additions & 22 deletions docs/source/index.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
:::{image} https://badge.fury.io/py/bento-tools.svg
```{toctree}
:hidden: true
installation
tutorials
howitworks
api
```

```{image} https://badge.fury.io/py/bento-tools.svg
:alt: PyPI version
:target: https://badge.fury.io/py/bento-tools
:class: inline-link
:::
```

:::{image} https://codecov.io/gh/ckmah/bento-tools/branch/master/graph/badge.svg?token=XVHDKNDCDT
```{image} https://codecov.io/gh/ckmah/bento-tools/branch/master/graph/badge.svg?token=XVHDKNDCDT
:alt: codecov
:target: https://codecov.io/gh/ckmah/bento-tools
:class: inline-link
:::
```

:::{image} https://readthedocs.org/projects/bento-tools/badge/?version=latest
```{image} https://readthedocs.org/projects/bento-tools/badge/?version=latest
:alt: Documentation Status
:target: https://bento-tools.readthedocs.io/en/latest/?badge=latest
:class: inline-link
:::
```

:::{image} https://img.shields.io/pypi/dm/bento-tools
```{image} https://img.shields.io/pypi/dm/bento-tools
:alt: PyPI - Downloads
:class: inline-link
:::
```


# Bento

<img src="_static/tutorial_img/bento_tools.png" alt="Bento Workflow" width="800">

:::{image} _static/tutorial_img/bento_tools.png
:alt: Bento Workflow
:align: center
:width: 800px
:::

Bento is a Python toolkit for performing subcellular analysis of spatial transcriptomics data. The package is part of the [Scverse ecosystem](https://scverse.org/packages/#ecosystem). Check out the [documentation](https://bento-tools.readthedocs.io/en/latest/) for installation instructions, tutorials, and API. Cite [our preprint](https://doi.org/10.1101/2022.06.10.495510) if you use Bento in your work. Thanks!

Expand Down Expand Up @@ -53,16 +64,5 @@ Bento is a Python toolkit for performing subcellular analysis of spatial transcr
---
:::{image} https://img.shields.io/github/license/ckmah/bento-tools.svg
:alt: GitHub license
:target:
:class: inline-link
:::

```{toctree}
:maxdepth: 1
:hidden: true
installation
tutorials
howitworks
api
```
Loading

0 comments on commit a6bc0e4

Please sign in to comment.