|
| 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. |
0 commit comments