Skip to content

Commit daf6621

Browse files
authored
Merge pull request #9 from czbiohub-sf/improve_docs
Improve docs
2 parents 1592ab0 + 2ad60c7 commit daf6621

33 files changed

+1648
-1117
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ PACKAGE_NAME := grassp
22

33
.PHONY: setup-develop
44
setup-develop:
5-
pip install -e .'[dev,docs,notebook]'
5+
pip install -e .'[dev, docs, notebook]'
6+
67
pre-commit install
78

89
.PHONY: uninstall

docs/source/_static/custom.css

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
/* Adjust sidebar width */
2-
.bd-sidebar {
3-
min-width: 300px; /* Increase from default */
4-
max-width: 450px; /* Set maximum width */
2+
/* Wider left sidebar so long function names are not truncated */
3+
4+
/* For PyData Sphinx Theme >= 0.13 */
5+
:root {
6+
/* Primary sidebar width */
7+
--pst-sidebar-primary: 400px;
8+
}
9+
10+
/* For older/alternate class names */
11+
.bd-sidebar,
12+
.bd-sidebar-primary {
13+
flex: 0 0 400px; /* fixed width */
14+
max-width: 400px;
15+
min-width: 400px;
516
}
617

718
/* Ensure content adjusts properly */

docs/source/api/plotting.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Plotting: `pl`
1+
# Plotting: `pl`
22

33
```{eval-rst}
44
.. module:: grassp.pl
@@ -11,10 +11,10 @@
1111
This module provides visualization functions for proteomics data.
1212

1313
```{note}
14-
Many of scanpy's plotting functions can be directly used with grassp AnnData objects. So if you are looking for a specific plot, it is worth checking if it is already implemented in scanpy.
14+
Many of [Scanpy's plotting](https://scanpy.readthedocs.io/en/stable/api/plotting.html) functions can be used directly with grassp AnnData objects. If you are looking for a specific plot, check whether it is already implemented in Scanpy.
1515
```
1616

17-
### Preprocessing
17+
## Preprocessing
1818

1919
```{eval-rst}
2020
.. autosummary::
@@ -24,9 +24,10 @@ Many of scanpy's plotting functions can be directly used with grassp AnnData obj
2424
pl.highly_variable_proteins
2525
pl.bait_volcano_plots
2626
pl.protein_clustermap
27+
pl.sample_heatmap
2728
```
2829

29-
### Integration
30+
## Integration
3031
```{eval-rst}
3132
.. autosummary::
3233
:nosignatures:
@@ -35,13 +36,26 @@ Many of scanpy's plotting functions can be directly used with grassp AnnData obj
3536
pl.aligned_umap
3637
pl.remodeling_score
3738
pl.remodeling_sankey
38-
```
39+
pl.mr_plot
40+
```
3941

40-
### Clustering
42+
## Clustering
4143
```{eval-rst}
4244
.. autosummary::
4345
:nosignatures:
4446
:toctree: ../generated/
4547
48+
pl.qsep_heatmap
49+
pl.qsep_boxplot
4650
pl.tagm_map_contours
47-
pl.tagm_map_pca_ellipses
51+
pl.tagm_map_pca_ellipses
52+
```
53+
54+
## Ternary
55+
```{eval-rst}
56+
.. autosummary::
57+
:nosignatures:
58+
:toctree: ../generated/
59+
60+
pl.ternary
61+
```

docs/source/api/preprocessing.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Preprocessing: `pp`
1+
# Preprocessing: `pp`
22

33
```{eval-rst}
44
.. module:: grassp.pp
@@ -10,7 +10,7 @@
1010

1111
Any transformation of the data matrix that is not a *tool*. Other than *tools*, preprocessing steps usually don't return an easily interpretable annotation, but perform a basic transformation on the data matrix.
1212

13-
### Basic Preprocessing
13+
## Basic Preprocessing
1414

1515

1616
```{eval-rst}
@@ -31,7 +31,18 @@ Any transformation of the data matrix that is not a *tool*. Other than *tools*,
3131
pp.filter_min_consecutive_fractions
3232
```
3333

34-
### Imputation
34+
## Enrichment
35+
36+
```{eval-rst}
37+
.. autosummary::
38+
:nosignatures:
39+
:toctree: ../generated/
40+
41+
pp.calculate_enrichment_vs_untagged
42+
pp.calculate_enrichment_vs_all
43+
```
44+
45+
## Imputation
3546

3647
```{eval-rst}
3748
.. autosummary::

docs/source/api/tools.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Tools: `tl`
1+
# Tools: `tl`
22

33
```{eval-rst}
44
.. module:: grassp.tl
@@ -8,9 +8,9 @@
88
.. currentmodule:: grassp
99
```
1010

11-
This module provides various tools for analyzing proteomics data.
11+
This module provides various tools for analyzing proteomics data.
1212

13-
### Clustering
13+
## Clustering
1414

1515
```{eval-rst}
1616
.. autosummary::
@@ -20,14 +20,13 @@ This module provides various tools for analyzing proteomics data.
2020
tl.leiden_mito_sweep
2121
tl.knn_annotation
2222
tl.calculate_interfacialness_score
23-
tl.get_n_nearest_neighbors
2423
tl.silhouette_score
2524
tl.calinski_habarasz_score
2625
tl.tagm_map_train
2726
tl.tagm_map_predict
2827
```
2928

30-
### Enrichment
29+
## Ontology Enrichment
3130

3231
```{eval-rst}
3332
.. autosummary::
@@ -38,7 +37,7 @@ This module provides various tools for analyzing proteomics data.
3837
```
3938

4039

41-
### Integration
40+
## Integration
4241

4342
```{eval-rst}
4443
.. autosummary::
@@ -48,5 +47,15 @@ This module provides various tools for analyzing proteomics data.
4847
tl.align_adatas
4948
tl.aligned_umap
5049
tl.remodeling_score
50+
```
51+
52+
## Graph analysis
53+
54+
```{eval-rst}
55+
.. autosummary::
56+
:nosignatures:
57+
:toctree: ../generated/
5158
52-
```
59+
tl.to_knn_graph
60+
tl.get_n_nearest_neighbors
61+
```

docs/source/conf.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"sphinx.ext.githubpages",
2626
"sphinx.ext.autosummary",
2727
"sphinx_autodoc_typehints",
28+
"sphinx.ext.intersphinx",
2829
"scanpydoc",
2930
"myst_nb", # enable notebook execution and rendering (includes myst_parser)
3031
]
@@ -57,6 +58,15 @@
5758
html_logo = "_static/img/grassp_logo.png"
5859
issues_github_path = "czbiohub-sf/grassp"
5960
html_show_sphinx = False
61+
intersphinx_mapping = dict(
62+
python=("https://docs.python.org/3", None),
63+
numpy=("https://numpy.org/doc/stable", None),
64+
pandas=("https://pandas.pydata.org/pandas-docs/stable", None),
65+
anndata=("https://anndata.readthedocs.io/en/stable/", None),
66+
scanpy=("https://scanpy.readthedocs.io/en/stable/", None),
67+
scipy=("https://docs.scipy.org/doc/scipy", None),
68+
)
69+
6070

6171
# Execute notebooks only when out-of-date and set timeout
6272
nb_execution_mode = "auto" # or "force" to always run, "off" to skip
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
grassp.pl.mr\_plot
2+
==================
3+
4+
.. currentmodule:: grassp.pl
5+
6+
.. autofunction:: mr_plot
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
grassp.pl.qsep\_boxplot
2+
=======================
3+
4+
.. currentmodule:: grassp.pl
5+
6+
.. autofunction:: qsep_boxplot
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
grassp.pl.qsep\_heatmap
2+
=======================
3+
4+
.. currentmodule:: grassp.pl
5+
6+
.. autofunction:: qsep_heatmap
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
grassp.pl.sample\_heatmap
2+
=========================
3+
4+
.. currentmodule:: grassp.pl
5+
6+
.. autofunction:: sample_heatmap

0 commit comments

Comments
 (0)