Skip to content

Commit 65e01f1

Browse files
LuisHeinzlmeierLuisZethson
authored
Update make dropdown (key takeaways dropdown and remove anchors) (#352)
* first version of key takeaways script and example file for diff gene expression * bug fixes * clean code * first steps to remove the anchors * script works without anchors for ipynb's and md's * first clean up of code * create files for air_repertoire section * create files for chromatin_accessibility section * create files for chromatin_accessibility2 section * create files for conditions and deconvolution section * create files for introduction section + bug fixes * create files for mechanisms, multimodal integration and preprocessing visualization sections * create files for spatial, surface protein and trajectories sections + small bug fix * first clean up of code and adding first descriptions for the functions * cleaned code and described functions for insert_dropdown.py * cleaned code of keytakeaways.py * improve file structure * change .keytakeaways to .txt and add a description for the dropdowns to CONTRIBUTING.md * change numpy style to google docstring style * improve CONTRIBUTING.md * bug fix CONTRIBUTING.md * add changelog * improve typos * Update CONTRIBUTING.md Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net> * Update CONTRIBUTING.md Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net> * Update scripts/dropdowns/insert_dropdowns.py Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net> * Update scripts/dropdowns/insert_dropdowns.py Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net> * adopt review comments (improve function descriptions, use pathlib instead of os, ...) * replace <name-notebook>.txt with <name-notebook>_keytakeaways.txt * replace os with pathlib --------- Co-authored-by: Luis <ge34lah@mytum.de> Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>
1 parent 7423f34 commit 65e01f1

File tree

95 files changed

+4128
-4793
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+4128
-4793
lines changed

CONTRIBUTING.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,29 @@ conda env create -f CHAPTER.yml
136136

137137
Now you can execute all cells in the notebook.
138138

139+
## Key takeaways, environment, and lamin dropdown
140+
141+
The environment and lamin dropdowns are inserted after the title of every chapter.
142+
If you don't want to have those dropdowns in your chapter, make sure to list your notebook in the blacklists of `scripts/dropdowns/keytakeaways.py` (`black_list_files_yml` or `black_list_files_lamin`).
143+
A key takeaways dropdown is only inserted if a file called `<name-notebook>_keytakeaways.txt` is in the same directory as your notebook.
144+
This file has to contain the key takeaways in the following format:
145+
146+
```
147+
1
148+
The first sentence of key takeaway 1.
149+
The second sentence of key takeaway 1.
150+
151+
2
152+
The first sentence of key takeaway 2.
153+
154+
...
155+
```
156+
157+
If you want to link a key takeaway to a certain heading in your chapter, add `<section-name>-<notebook-name>-key-takeaway-<key-takeaway-number>` as a label before the heading.
158+
Replace all `_` with `-`, and the card of the key takeaway will be linked to the heading in the text (e.g., `(preprocessing-visualization-dimensionality-reduction-key-takeaway-2)=`).
159+
160+
You can insert the dropdowns locally by calling `make dropdown` before `make`.
161+
139162
## Data access
140163

141164
We are currently still working on making all datasets accessible.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build:
55
jupyter-book build $(JUPYTER_BOOK_DIR)
66

77
dropdown:
8-
python3 scripts/insert_dropdown.py
8+
python3 scripts/dropdowns/insert_dropdowns.py
99

1010
clean:
1111
jupyter-book clean --all $(JUPYTER_BOOK_DIR)

changelog.d/352.changed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
update `make dropdown` by adding key takeaways dropdown and removing anchors ([#352](https://github.com/theislab/single-cell-best-practices/pull/352)) <sub>@LuisHeinzlmeier</sub>

jupyter-book/air_repertoire/clonotype.ipynb

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,6 @@
1010
"# Clonotype analysis"
1111
]
1212
},
13-
{
14-
"cell_type": "markdown",
15-
"id": "56750b9d",
16-
"metadata": {},
17-
"source": [
18-
"```{dropdown} <i class=\"fas fa-brain\"></i>&nbsp;&nbsp;&nbsp;Key takeaways\n",
19-
"\n",
20-
":::{card}\n",
21-
":link: air-repertoire-clonotype-key-takeaway-1\n",
22-
":link-type: ref\n",
23-
"Clonal Expansion: Specific lymphocytes proliferate in response to immune stimuli, reducing clonal diversity but increasing the abundance of expanded clones.\n",
24-
"This process is critical for understanding immune responses, as it reflects the transition from naive to effector and memory cells.\n",
25-
":::\n",
26-
"\n",
27-
":::{card}\n",
28-
":link: air-repertoire-clonotype-key-takeaway-2\n",
29-
":link-type: ref\n",
30-
"Gene Segment Usage & Spectratype: The rearrangement of V(D)J gene segments shows preferential usage, and spectratype analysis measures CDR3 length diversity.\n",
31-
"Together, they help identify immunodominant clonotypes and characterize immune repertoire patterns.\n",
32-
":::\n",
33-
"\n",
34-
"```\n",
35-
"\n",
36-
"<!-- START ENV-SETUP -->\n",
37-
"<!-- END ENV-SETUP -->"
38-
]
39-
},
4013
{
4114
"cell_type": "markdown",
4215
"id": "b4976e28",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
1
2+
Clonal Expansion: Specific lymphocytes proliferate in response to immune stimuli, reducing clonal diversity but increasing the abundance of expanded clones.
3+
This process is critical for understanding immune responses, as it reflects the transition from naive to effector and memory cells.
4+
5+
2
6+
Gene Segment Usage & Spectratype: The rearrangement of V(D)J gene segments shows preferential usage, and spectratype analysis measures CDR3 length diversity.
7+
Together, they help identify immunodominant clonotypes and characterize immune repertoire patterns.

jupyter-book/air_repertoire/ir_profiling.ipynb

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,6 @@
88
"# Immune Receptor Profiling "
99
]
1010
},
11-
{
12-
"cell_type": "markdown",
13-
"id": "f55a6006",
14-
"metadata": {},
15-
"source": [
16-
"```{dropdown} <i class=\"fas fa-brain\"></i>&nbsp;&nbsp;&nbsp;Key takeaways\n",
17-
"\n",
18-
":::{card}\n",
19-
":link: air-repertoire-ir-profiling-key-takeaway-1\n",
20-
":link-type: ref\n",
21-
"VDJ-sequencing measures the sequence information of AIRs, which provides us insights into the function of B- and T-cells.\n",
22-
":::\n",
23-
"\n",
24-
":::{card}\n",
25-
":link: air-repertoire-ir-profiling-key-takeaway-2\n",
26-
":link-type: ref\n",
27-
"To detect doublets, cells with multiple AIRs should be identified or filtered.\n",
28-
":::\n",
29-
"\n",
30-
":::{card}\n",
31-
":link: air-repertoire-ir-profiling-key-takeaway-3\n",
32-
":link-type: ref\n",
33-
"Depending on the analysis, we additional filter cells with incomplete AIR information.\n",
34-
":::\n",
35-
"\n",
36-
"```\n",
37-
"\n",
38-
"<!-- START ENV-SETUP -->\n",
39-
"<!-- END ENV-SETUP -->"
40-
]
41-
},
4211
{
4312
"cell_type": "markdown",
4413
"id": "81a16281",
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
1
2+
VDJ-sequencing measures the sequence information of AIRs, which provides us insights into the function of B- and T-cells.
3+
4+
2
5+
To detect doublets, cells with multiple AIRs should be identified or filtered.
6+
7+
3
8+
Depending on the analysis, we additional filter cells with incomplete AIR information.

jupyter-book/air_repertoire/multimodal_integration.ipynb

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,6 @@
88
"# Integrating AIR and transcriptomics"
99
]
1010
},
11-
{
12-
"cell_type": "markdown",
13-
"id": "827c6211",
14-
"metadata": {},
15-
"source": [
16-
"```{dropdown} <i class=\"fas fa-brain\"></i>&nbsp;&nbsp;&nbsp;Key takeaways\n",
17-
"\n",
18-
":::{card}\n",
19-
":link: air-repertoire-multimodal-integration-key-takeaway-1\n",
20-
":link-type: ref\n",
21-
"For multimodal datasets of AIR and GEX, typically, one modality is used for grouping the cells to perform standard uni-modal analysis on the other modality (e.g. Sequence analysis on leiden clusters).\n",
22-
":::\n",
23-
"\n",
24-
":::{card}\n",
25-
":link: air-repertoire-multimodal-integration-key-takeaway-2\n",
26-
":link-type: ref\n",
27-
"Cell functionality (determined by AIR) and cell state (observed via GEX) are interlinked.\n",
28-
"It has been shown, that cells with alike AIR sequences can share similar phenotypes.\n",
29-
":::\n",
30-
"\n",
31-
":::{card}\n",
32-
":link: air-repertoire-multimodal-integration-key-takeaway-3\n",
33-
":link-type: ref\n",
34-
"Due to the inherent structural difference between count matrices (GEX) and amino acid sequences (IR), it is difficult to directly fuse both modalities.\n",
35-
"Therefore, several methods were developed recently, to utilize paired GEX-AIR data for to derive clusters, or an embedding.\n",
36-
"However, these approaches are still novel and not part of a standard analysis pipeline.\n",
37-
":::\n",
38-
"\n",
39-
"```\n",
40-
"\n",
41-
"<!-- START ENV-SETUP -->\n",
42-
"<!-- END ENV-SETUP -->"
43-
]
44-
},
4511
{
4612
"cell_type": "markdown",
4713
"id": "c6b657ac",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
1
2+
For multimodal datasets of AIR and GEX, typically, one modality is used for grouping the cells to perform standard uni-modal analysis on the other modality (e.g. Sequence analysis on leiden clusters).
3+
4+
2
5+
Cell functionality (determined by AIR) and cell state (observed via GEX) are interlinked.
6+
It has been shown, that cells with alike AIR sequences can share similar phenotypes.
7+
8+
3
9+
Due to the inherent structural difference between count matrices (GEX) and amino acid sequences (IR), it is difficult to directly fuse both modalities.
10+
Therefore, several methods were developed recently, to utilize paired GEX-AIR data for to derive clusters, or an embedding.
11+
However, these approaches are still novel and not part of a standard analysis pipeline.

jupyter-book/air_repertoire/specificity.ipynb

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,6 @@
88
"# Specificity analysis"
99
]
1010
},
11-
{
12-
"cell_type": "markdown",
13-
"id": "934665b1",
14-
"metadata": {},
15-
"source": [
16-
"\n",
17-
"```{dropdown} <i class=\"fas fa-brain\"></i>&nbsp;&nbsp;&nbsp;Key takeaways\n",
18-
"\n",
19-
":::{card}\n",
20-
":link: air-repertoire-specificity-key-takeaway-1\n",
21-
":link-type: ref\n",
22-
"The AIR sequence determines the epitope-specificity of the cell.\n",
23-
"Cells with similar AIR sequence, bind to the same antigen.\n",
24-
":::\n",
25-
"\n",
26-
":::{card}\n",
27-
":link: air-repertoire-specificity-key-takeaway-2\n",
28-
":link-type: ref\n",
29-
"Specificity can be inferred via Database queries, AIR comparison, or prediction.\n",
30-
":::\n",
31-
"\n",
32-
":::{card}\n",
33-
":link: air-repertoire-specificity-key-takeaway-3\n",
34-
":link-type: ref\n",
35-
"Most approaches are not independently benchmarked and should be used with some caution and additional validation.\n",
36-
":::\n",
37-
"\n",
38-
"```\n",
39-
"\n",
40-
"<!-- START ENV-SETUP -->\n",
41-
"<!-- END ENV-SETUP -->"
42-
]
43-
},
4411
{
4512
"attachments": {},
4613
"cell_type": "markdown",

0 commit comments

Comments
 (0)