Skip to content

Commit dcd3a0e

Browse files
authored
Add Artifact fetching for pseudotemporal and lamindb default text (#344)
* Add pseudotemporal registration script Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net> * Add lamindb pseudotime * Fix envs * Pin jupyterbook * dropdown * Polish * Polish --------- Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>
1 parent 76dd78a commit dcd3a0e

File tree

7 files changed

+152
-57
lines changed

7 files changed

+152
-57
lines changed

.github/workflows/build_book.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
- name: Install Python dependencies
7373
run: |
7474
python -m pip install --upgrade uv
75-
uv pip install --system jupyter-book jupytext beautifulsoup4 playwright
75+
uv pip install --system jupyter-book==1.0.4.post1 jupytext beautifulsoup4 playwright
7676
7777
- name: Install Playwright browsers
7878
run: playwright install --with-deps

environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ channels:
44
- conda-forge
55
dependencies:
66
- conda-forge::python==3.12
7-
- conda-forge::jupyter-book==1.0.4
7+
- conda-forge::jupyter-book==1.0.4.post1
88
- conda-forge::jupytext==1.16.7
99
- conda-forge::beautifulsoup4==4.13.3
1010
- conda-forge::playwright==1.50.1
1111
- conda-forge::sphinx==7.*
1212
- pip
1313
- pip:
14-
- lamindb[bionty,jupyter]
14+
- lamindb[bionty,jupyter,zarr]
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
This book uses [lamindb](https://github.com/laminlabs/lamindb) to store, share, and load datasets and notebooks using the [theislab/sc-best-practices instance](https://lamin.ai/theislab/sc-best-practices).
2+
We acknowledge free hosting from [Lamin Labs](https://lamin.ai/).
3+
4+
1. **Install lamindb**
5+
6+
- Install the lamindb Python package:
7+
8+
```bash
9+
pip install lamindb[bionty,jupyter,zarr]
10+
```
11+
12+
2. **Optionally create a lamin account**
13+
14+
- Sign up and log in following [the instructions](https://docs.lamin.ai/setup#sign-up-log-in)
15+
16+
3. **Connect to the [theislab/sc-best-practices instance](https://lamin.ai/theislab/sc-best-practices)**
17+
18+
- Run the `lamin connect` command:
19+
20+
```bash
21+
lamin connect theislab/sc-best-practices
22+
```
23+
24+
You should now see `→ connected lamindb: theislab/sc-best-practices`.
25+
26+
4. **Verify your setup**
27+
28+
- Run the `lamin connect` command:
29+
30+
```python
31+
import lamindb as ln
32+
33+
ln.Artifact.df()
34+
```
35+
36+
You should now see up to 100 of the stored datasets.
37+
38+
5. **Accessing datasets (Artifacts)**
39+
40+
- Search for the datasets on the [Artifacts page](https://lamin.ai/theislab/sc-best-practices/artifacts)
41+
- Load an Artifact and the corresponding object:
42+
43+
```python
44+
import lamindb as ln
45+
af = ln.Artifact.get(key="key_of_dataset", is_latest=True) # or ln.Artifact("SOMEID").get()
46+
obj = af.load()
47+
```
48+
49+
The object is now accessible in memory and is ready for analysis.
50+
Adapt the `ln.Artifact("SOMEID").get()` suffix to get older versions like `ln.Artifact("SOMEID0001").get()` to get the second uploaded version.
51+
52+
6. **Accessing notebooks (Transforms)**
53+
54+
- Search for the notebook on the [Transforms page](https://lamin.ai/theislab/sc-best-practices/transforms)
55+
- Load the notebook:
56+
57+
```bash
58+
lamin load <notebook url>
59+
```
60+
61+
which will download the notebook to the current working directory.
62+
Analogously to `Artifacts`, you can adapt the suffix ID to get older versions.
63+
64+
7. **On `ln.track()` and `ln.finish()`**
65+
66+
- These functions are currently only available for users with write access and may error. Please comment them out for now.

jupyter-book/trajectories/lineage_tracing.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ channels:
33
- defaults
44
- conda-forge
55
dependencies:
6-
- conda-forge::python=3.9.15
7-
- conda-forge::scanpy=1.9.1
8-
- conda-forge::jupyterlab=3.5.0
6+
- conda-forge::python=3.12.9
97
- pip:
108
- git+https://github.com/YosefLab/Cassiopeia@master#egg=cassiopeia-lineage
9+
- scanpy==1.11.0
1110
- session_info
11+
- lamindb[bionty,jupyter]

jupyter-book/trajectories/pseudotemporal.ipynb

Lines changed: 73 additions & 48 deletions
Large diffs are not rendered by default.

jupyter-book/trajectories/pseudotemporal.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: pseudotemporal
22
channels:
33
- conda-forge
44
dependencies:
5-
- conda-forge::python=3.9.16
6-
- conda-forge::scanpy=1.9.1
7-
- conda-forge::jupyterlab=3.5.3
5+
- conda-forge::python=3.12.9
6+
- pip
7+
- pip:
8+
- scanpy==1.11.0
9+
- lamindb[bionty,jupyter]

jupyter-book/trajectories/rna_velocity.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ dependencies:
66
- conda-forge::python=3.9.16
77
- conda-forge::jupyterlab=3.5.3
88
- bioconda::scvelo=0.2.5
9+
- pip:
10+
- lamindb[bionty,jupyter]

0 commit comments

Comments
 (0)