lamindb-2.2.1
2.2.1
2.2.0
2.1.2
2.1.1
2.1.0
2.0a2
2.0.1
2.0.0
1.9.1
1.9.0
1.8.0
1.7a1
1.7.1
1.7.0
1.6a2
1.6.2
1.6.1
1.6.0
1.5.3
1.5.2
1.5.1
1.5.0
1.4.0
1.3.2
1.3.1
1.3.0
1.2a2
1.2.0
1.17.0
1.16.2
1.16.1
1.16.0
1.15.2
1.15.1
1.15.0
1.14.0
1.13.1
1.13.0
1.12.1
1.12.0
1.11a1
1.11.3
1.11.2
1.11.1
1.11.0
1.10.2
1.10.1
1.10.0
1.1.1
1.1.0
1.0rc1
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
0.9.6
0.9.4
0.9.3
0.9.2
0.9.1
0.9.0
0.8.3
0.8.2
0.8.1
0.8.0
0.77.4
0.77.3
0.77.2
0.77.0
0.76.9
0.76.8
0.76.7
0.76.6
0.76.5
0.76.4
0.76.3
0.76.2
0.76.16
0.76.15
0.76.14
0.76.13
0.76.12
0.76.11
0.76.10
0.76.1
0.76.0
0.75.1
0.75.0
0.74.3
0.74.2
0.74.1
0.74.0
0.73.2
0.73.1
0.73.0
0.72.1
0.72.0
0.71.3
0.71.2
0.71.1
0.71.0
0.70.4
0.70.3
0.70.2
0.70.1
0.70.0
0.7.2
0.7.1
0.7.0
0.69.9
0.69.8
0.69.7
0.69.6
0.69.5
0.69.4
0.69.3
0.69.2
0.69.10
0.69.1
0.69.0
0.68.2
0.68.1
0.68.0
0.67.3
0.67.2
0.67.1
0.67.0
0.66.1
0.66.0
0.65.1
0.65.0
0.64.2
0.64.1
0.64.0
0.63.5
0.63.4
0.63.3
0.63.2
0.63.1
0.63.0
0.62.0
0.61.0
0.60.3
0.60.2
0.60.1
0.60.0
0.6.0
0.59.5
0.59.4
0.59.3
0.59.2
0.59.1
0.59.0
0.58.2
0.58.1
0.58.0
0.57.2
0.57.1
0.57.0
0.56a1
0.56.2
0.56.1
0.56.0
0.55.2
0.55.1
0.55.0
0.54.4
0.54.3
0.54.2
0.54.1
0.54.0
0.53.0
0.52.2
0.52.1
0.52.0
0.51a1
0.51.3
0.51.2
0.51.1
0.51.0
0.50.7
0.50.6
0.50.5
0.50.4
0.50.3
0.50.2
0.50.1
0.50.0
0.5.0
0.49.3
0.49.2
0.49.1
0.49.0
0.48a3
0.48a2
0.48a1
0.48.1
0.48.0
0.47.0
0.46a3
0.46a2
0.46a1
0.46.3
0.46.2
0.46.1
0.46.0
0.45a1
0.45.0
0.44.2
0.44.1
0.44.0
0.43.0
0.42a9
0.42a8
0.42a7
0.42a6
0.42a5
0.42a4
0.42a3
0.42a2
0.42a1
0.42.0
0.41a6
0.41a5
0.41a4
0.41a3
0.41a2
0.41a1
0.41.2
0.41.1
0.41.0
0.40.7
0.40.6
0.40.5
0.40.4
0.40.3
0.40.2
0.40.1
0.40.0
0.4.1
0.4.0
0.39rc1
0.39.8
0.39.7
0.39.6
0.39.5
0.39.4
0.39.3
0.39.2
0.39.1
0.39.0
0.38.3
0.38.2
0.38.1
0.38.0
0.37.2
0.37.1
0.37.0
0.36.4
0.36.3
0.36.2
0.36.1
0.36.0
0.35rc3
0.35rc2
0.35rc1
0.35.6
0.35.5
0.35.4
0.35.3
0.35.2
0.35.1
0.35.0
0.34.2
0.34.1
0.34.0
0.33.4
0.33.3
0.33.2
0.33.1rc1
0.33.1
0.33.0
0.32.0rc1
0.32.0
0.31rc1
0.31.1
0.31.0
0.30.3
0.30.2
0.30.1
0.30.0
0.3.9
0.3.8
0.3.7
0.3.6
0.3.5
0.3.4
0.3.3
0.3.2
0.3.11
0.3.10
0.3.1
0.3.0
0.29.1
0.29.0
0.28rc1
0.28.5
0.28.4
0.28.3
0.28.2
0.28.1
0.28.0
0.27.2
0.27.1
0.27.0
0.26.1
0.26.0
0.25.8
0.25.7
0.25.6
0.25.5
0.25.4
0.25.3
0.25.2
0.25.1
0.25.0
0.24.6
0.24.5
0.24.4
0.24.3
0.24.2
0.24.1
0.24.0
0.23.0
0.22.5
0.22.4
0.22.3
0.22.2
0.22.1
0.22.0
0.21.5
0.21.4
0.21.3
0.21.2
0.21.1
0.21.0
0.20.0
0.19.4
0.19.3
0.19.2
0.19.1
0.19.0
0.18.9
0.18.8
0.18.7
0.18.6
0.18.5
0.18.4
0.18.3
0.18.2
0.18.1
0.18.0
0.17.0
0.16.0
0.15.0
0.14.0
0.13.0
0.12.1
0.12.0
0.11.0
0.0.1
2.2.1
2.2.0
2.1.2
2.1.1
2.1.0
2.0a2
2.0.1
2.0.0
1.9.1
1.9.0
1.8.0
1.7a1
1.7.1
1.7.0
1.6a2
1.6.2
1.6.1
1.6.0
1.5.3
1.5.2
1.5.1
1.5.0
1.4.0
1.3.2
1.3.1
1.3.0
1.2a2
1.2.0
1.17.0
1.16.2
1.16.1
1.16.0
1.15.2
1.15.1
1.15.0
1.14.0
1.13.1
1.13.0
1.12.1
1.12.0
1.11a1
1.11.3
1.11.2
1.11.1
1.11.0
1.10.2
1.10.1
1.10.0
1.1.1
1.1.0
1.0rc1
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
0.9.6
0.9.4
0.9.3
0.9.2
0.9.1
0.9.0
0.8.3
0.8.2
0.8.1
0.8.0
0.77.4
0.77.3
0.77.2
0.77.0
0.76.9
0.76.8
0.76.7
0.76.6
0.76.5
0.76.4
0.76.3
0.76.2
0.76.16
0.76.15
0.76.14
0.76.13
0.76.12
0.76.11
0.76.10
0.76.1
0.76.0
0.75.1
0.75.0
0.74.3
0.74.2
0.74.1
0.74.0
0.73.2
0.73.1
0.73.0
0.72.1
0.72.0
0.71.3
0.71.2
0.71.1
0.71.0
0.70.4
0.70.3
0.70.2
0.70.1
0.70.0
0.7.2
0.7.1
0.7.0
0.69.9
0.69.8
0.69.7
0.69.6
0.69.5
0.69.4
0.69.3
0.69.2
0.69.10
0.69.1
0.69.0
0.68.2
0.68.1
0.68.0
0.67.3
0.67.2
0.67.1
0.67.0
0.66.1
0.66.0
0.65.1
0.65.0
0.64.2
0.64.1
0.64.0
0.63.5
0.63.4
0.63.3
0.63.2
0.63.1
0.63.0
0.62.0
0.61.0
0.60.3
0.60.2
0.60.1
0.60.0
0.6.0
0.59.5
0.59.4
0.59.3
0.59.2
0.59.1
0.59.0
0.58.2
0.58.1
0.58.0
0.57.2
0.57.1
0.57.0
0.56a1
0.56.2
0.56.1
0.56.0
0.55.2
0.55.1
0.55.0
0.54.4
0.54.3
0.54.2
0.54.1
0.54.0
0.53.0
0.52.2
0.52.1
0.52.0
0.51a1
0.51.3
0.51.2
0.51.1
0.51.0
0.50.7
0.50.6
0.50.5
0.50.4
0.50.3
0.50.2
0.50.1
0.50.0
0.5.0
0.49.3
0.49.2
0.49.1
0.49.0
0.48a3
0.48a2
0.48a1
0.48.1
0.48.0
0.47.0
0.46a3
0.46a2
0.46a1
0.46.3
0.46.2
0.46.1
0.46.0
0.45a1
0.45.0
0.44.2
0.44.1
0.44.0
0.43.0
0.42a9
0.42a8
0.42a7
0.42a6
0.42a5
0.42a4
0.42a3
0.42a2
0.42a1
0.42.0
0.41a6
0.41a5
0.41a4
0.41a3
0.41a2
0.41a1
0.41.2
0.41.1
0.41.0
0.40.7
0.40.6
0.40.5
0.40.4
0.40.3
0.40.2
0.40.1
0.40.0
0.4.1
0.4.0
0.39rc1
0.39.8
0.39.7
0.39.6
0.39.5
0.39.4
0.39.3
0.39.2
0.39.1
0.39.0
0.38.3
0.38.2
0.38.1
0.38.0
0.37.2
0.37.1
0.37.0
0.36.4
0.36.3
0.36.2
0.36.1
0.36.0
0.35rc3
0.35rc2
0.35rc1
0.35.6
0.35.5
0.35.4
0.35.3
0.35.2
0.35.1
0.35.0
0.34.2
0.34.1
0.34.0
0.33.4
0.33.3
0.33.2
0.33.1rc1
0.33.1
0.33.0
0.32.0rc1
0.32.0
0.31rc1
0.31.1
0.31.0
0.30.3
0.30.2
0.30.1
0.30.0
0.3.9
0.3.8
0.3.7
0.3.6
0.3.5
0.3.4
0.3.3
0.3.2
0.3.11
0.3.10
0.3.1
0.3.0
0.29.1
0.29.0
0.28rc1
0.28.5
0.28.4
0.28.3
0.28.2
0.28.1
0.28.0
0.27.2
0.27.1
0.27.0
0.26.1
0.26.0
0.25.8
0.25.7
0.25.6
0.25.5
0.25.4
0.25.3
0.25.2
0.25.1
0.25.0
0.24.6
0.24.5
0.24.4
0.24.3
0.24.2
0.24.1
0.24.0
0.23.0
0.22.5
0.22.4
0.22.3
0.22.2
0.22.1
0.22.0
0.21.5
0.21.4
0.21.3
0.21.2
0.21.1
0.21.0
0.20.0
0.19.4
0.19.3
0.19.2
0.19.1
0.19.0
0.18.9
0.18.8
0.18.7
0.18.6
0.18.5
0.18.4
0.18.3
0.18.2
0.18.1
0.18.0
0.17.0
0.16.0
0.15.0
0.14.0
0.13.0
0.12.1
0.12.0
0.11.0
0.0.1
توضیحات
A data framework for biology.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | lamindb-2.2.1 |
| نام | lamindb |
| نسخه کتابخانه | 2.2.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | Lamin Labs <open-source@lamin.ai> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/lamindb/ |
| مجوز | - |
# LaminDB [](https://docs.lamin.ai) [](https://docs.lamin.ai/llms.txt) [](https://codecov.io/gh/laminlabs/lamindb) [](https://pypi.org/project/lamindb) [](https://cran.r-project.org/package=laminr) [](https://github.com/laminlabs/lamindb) [](https://pepy.tech/project/lamindb)
LaminDB is an open-source data framework for biology to query, trace, and validate datasets and models at scale.
You get context & memory through a lineage-native lakehouse that supports bio-formats, registries & ontologies.
<details>
<summary>Why?</summary>
(1) Reproducing, tracing & understanding how datasets, models & results are created is critical to quality R&D.
Without context, humans & agents make mistakes and cannot close feedback loops across data generation & analysis.
Without memory, compute & intelligence are wasted on fragmented, non-compounding tasks — LLM context windows are small.
(2) Training & fine-tuning models with thousands of datasets — across LIMS, ELNs, orthogonal assays — is now a primary path to scaling R&D.
But without queryable & validated data or with data locked in organizational & infrastructure siloes, it leads to garbage in, garbage out or is quite simply impossible.
Imagine building software without git or pull requests: an agent's quality would be impossible to verify.
While code has git and tables have dbt/warehouses, biological data has lacked a framework for managing its unique complexity.
LaminDB fills the gap.
It is a lineage-native lakehouse that understands bio-registries and formats (`AnnData`, `.zarr`, …) based on the established open data stack:
Postgres/SQLite for metadata and cross-platform storage for datasets.
By offering queries, tracing & validation in a single API, LaminDB provides the context & memory to turn messy, agentic biological R&D into a scalable process.
</details>
<img width="800px" src="https://lamin-site-assets.s3.amazonaws.com/.lamindb/BunYmHkyFLITlM5M000C.svg">
How?
- **lineage** → track inputs & outputs of notebooks, scripts, functions & pipelines with a single line of code
- **lakehouse** → manage, monitor & validate schemas for standard and bio formats; query across many datasets
- **FAIR datasets** → validate & annotate `DataFrame`, `AnnData`, `SpatialData`, `parquet`, `zarr`, …
- **LIMS & ELN** → programmatic experimental design with bio-registries, ontologies & markdown notes
- **unified access** → storage locations (local, S3, GCP, …), SQL databases (Postgres, SQLite) & ontologies
- **reproducible** → auto-track source code & compute environments with data & code versioning
- **change management** → branching & merging similar to git, plan management for agents
- **zero lock-in** → runs anywhere on open standards (Postgres, SQLite, `parquet`, `zarr`, etc.)
- **scalable** → you hit storage & database directly through your `pydata` or R stack, no REST API involved
- **simple** → just `pip install` from PyPI or `install.packages('laminr')` from CRAN
- **distributed** → zero-copy & lineage-aware data sharing across infrastructure (databases & storage locations)
- **integrations** → [git](https://docs.lamin.ai/track#sync-code-with-git), [nextflow](https://docs.lamin.ai/nextflow), [vitessce](https://docs.lamin.ai/vitessce), [redun](https://docs.lamin.ai/redun), and [more](https://docs.lamin.ai/integrations)
- **extensible** → create custom plug-ins based on the Django ORM, the basis for LaminDB's registries
GUI, permissions, audit logs? [LaminHub](https://lamin.ai) is a collaboration hub built on LaminDB similar to how GitHub is built on git.
<details>
<summary>Who?</summary>
Scientists and engineers at leading research institutions and biotech companies, including:
- **Industry** → Pfizer, Altos Labs, Ensocell Therapeutics, ...
- **Academia & Research** → scverse, DZNE (National Research Center for Neuro-Degenerative Diseases), Helmholtz Munich (National Research Center for Environmental Health), ...
- **Research Hospitals** → Global Immunological Swarm Learning Network: Harvard, MIT, Stanford, ETH Zürich, Charité, U Bonn, Mount Sinai, ...
From personal research projects to pharma-scale deployments managing petabytes of data across:
entities | OOMs
--- | ---
observations & datasets | 10¹² & 10⁶
runs & transforms| 10⁹ & 10⁵
proteins & genes | 10⁹ & 10⁶
biosamples & species | 10⁵ & 10²
... | ...
</details>
## Docs
Point an agent to [llms.txt](https://docs.lamin.ai/llms.txt) and let them do the work or read the [docs](https://docs.lamin.ai).
## Quickstart
Install the Python package:
```shell
pip install lamindb
```
### Query databases
You can browse public databases at [lamin.ai/explore](https://lamin.ai/explore). To query [laminlabs/cellxgene](https://lamin.ai/laminlabs/cellxgene), run:
```python
import lamindb as ln
db = ln.DB("laminlabs/cellxgene") # a database object for queries
df = db.Artifact.to_dataframe() # a dataframe listing datasets & models
```
To get a [specific dataset](https://lamin.ai/laminlabs/cellxgene/artifact/BnMwC3KZz0BuKftR), run:
```python
artifact = db.Artifact.get("BnMwC3KZz0BuKftR") # a metadata object for a dataset
artifact.describe() # describe the context of the dataset
```
<details>
<summary>See the output.</summary>
<img src="https://lamin-site-assets.s3.amazonaws.com/.lamindb/mxlUQiRLMU4Zos6k0001.png" width="550">
</details>
Access the content of the dataset via:
```python
local_path = artifact.cache() # return a local path from a cache
adata = artifact.load() # load object into memory
accessor = artifact.open() # return a streaming accessor
```
You can query by biological entities like `Disease` through plug-in `bionty`:
```python
alzheimers = db.bionty.Disease.get(name="Alzheimer disease")
df = db.Artifact.filter(diseases=alzheimers).to_dataframe()
```
### Configure your database
You can create a LaminDB instance at [lamin.ai](https://lamin.ai) and invite collaborators.
To connect to a remote instance, run:
```shell
lamin login
lamin connect account/name
```
If you prefer to work with a local SQLite database (no login required), run this instead:
```shell
lamin init --storage ./quickstart-data --modules bionty
```
On the terminal and in a Python session, LaminDB will now auto-connect.
### CLI
To save a file or folder from the command line, run:
```shell
lamin save myfile.txt --key examples/myfile.txt
```
To sync a file into a local cache (artifacts) or development directory (transforms), run:
```shell
lamin load --key examples/myfile.txt
```
Read more: [docs.lamin.ai/cli](https://docs.lamin.ai/cli).
### Change management
To create a contribution branch and switch to it, run:
```shell
lamin switch -c my_branch
```
To merge a contribution branch into `main`, run:
```shell
lamin switch main # switch to the main branch
lamin merge my_branch # merge contribution branch into main
```
Read more: [docs.lamin.ai/lamindb.branch](https://docs.lamin.ai/lamindb.branch).
### Lineage: scripts & notebooks
To create a dataset while tracking source code, inputs, outputs, logs, and environment:
```python
import lamindb as ln
# → connected lamindb: account/instance
ln.track() # track code execution
open("sample.fasta", "w").write(">seq1\nACGT\n") # create dataset
ln.Artifact("sample.fasta", key="sample.fasta").save() # save dataset
ln.finish() # mark run as finished
```
Running this snippet as a script (`python create-fasta.py`) produces the following data lineage:
```python
artifact = ln.Artifact.get(key="sample.fasta") # get artifact by key
artifact.describe() # context of the artifact
artifact.view_lineage() # fine-grained lineage
```
<img src="https://lamin-site-assets.s3.amazonaws.com/.lamindb/BOTCBgHDAvwglN3U0004.png" width="550"> <img src="https://lamin-site-assets.s3.amazonaws.com/.lamindb/EkQATsQL5wqC95Wj0006.png" width="140">
<details>
<summary>Access run & transform.</summary>
```python
run = artifact.run # get the run object
transform = artifact.transform # get the transform object
run.describe() # context of the run
```
<img src="https://lamin-site-assets.s3.amazonaws.com/.lamindb/rJrHr3XaITVS4wVJ0000.png" width="550" />
```python
transform.describe() # context of the transform
```
<img src="https://lamin-site-assets.s3.amazonaws.com/.lamindb/JYwmHBbgf2MRCfgL0000.png" width="550" />
</details>
<details>
<summary>15 sec video.</summary>
[15 sec video](https://lamin-site-assets.s3.amazonaws.com/.lamindb/Xdiikc2c1tPtHcvF0000.mp4)
</details>
### Lineage: functions & workflows
You can achieve the same traceability for functions & workflows:
<!-- #skip_laminr -->
```python
import lamindb as ln
@ln.flow()
def create_fasta(fasta_file: str = "sample.fasta"):
open(fasta_file, "w").write(">seq1\nACGT\n") # create dataset
ln.Artifact(fasta_file, key=fasta_file).save() # save dataset
if __name__ == "__main__":
create_fasta()
```
<!-- #end_skip_laminr -->
Beyond what you get for scripts & notebooks, this automatically tracks function & CLI params and integrates well with established Python workflow managers: [docs.lamin.ai/track](https://docs.lamin.ai/track). To integrate advanced bioinformatics pipeline managers like Nextflow, see [docs.lamin.ai/pipelines](https://docs.lamin.ai/pipelines).
<details>
<summary>A richer example.</summary>
Here is a an automatically generated re-construction of the project of [Schmidt _el al._ (Science, 2022)](https://pubmed.ncbi.nlm.nih.gov/35113687/):
<img src="https://lamin-site-assets.s3.amazonaws.com/.lamindb/KQmzmmLOeBN0C8Yk0004.png" width="850">
A phenotypic CRISPRa screening result is integrated with scRNA-seq data. Here is the result of the screen input:
<img src="https://lamin-site-assets.s3.amazonaws.com/.lamindb/JvLaK9Icj11eswQn0000.png" width="850">
You can explore it [here](https://lamin.ai/laminlabs/lamindata/artifact/W1AiST5wLrbNEyVq) on LaminHub or [here](https://github.com/laminlabs/schmidt22) on GitHub.
</details>
### Labeling & queries by fields
You can label an artifact by running:
```python
my_label = ln.ULabel(name="My label").save() # a universal label
project = ln.Project(name="My project").save() # a project label
artifact.ulabels.add(my_label)
artifact.projects.add(project)
```
Query for it:
```python
ln.Artifact.filter(ulabels=my_label, projects=project).to_dataframe()
```
You can also query by the metadata that lamindb automatically collects:
```python
ln.Artifact.filter(run=run).to_dataframe() # by creating run
ln.Artifact.filter(transform=transform).to_dataframe() # by creating transform
ln.Artifact.filter(size__gt=1e6).to_dataframe() # size greater than 1MB
```
If you want to include more information into the resulting dataframe, pass `include`.
```python
ln.Artifact.to_dataframe(include=["created_by__name", "storage__root"]) # include fields from related registries
```
Note: The query syntax for `DB` objects and for your default database is the same.
### Queries by features
You can annotate datasets and samples with features. Let's define some:
```python
from datetime import date
ln.Feature(name="gc_content", dtype=float).save()
ln.Feature(name="experiment_note", dtype=str).save()
ln.Feature(name="experiment_date", dtype=date, coerce=True).save() # accept date strings
```
During annotation, feature names and data types are validated against these definitions:
```python
artifact.features.add_values({
"gc_content": 0.55,
"experiment_note": "Looks great",
"experiment_date": "2025-10-24",
})
```
Query for it:
```python
ln.Artifact.filter(experiment_date="2025-10-24").to_dataframe() # query all artifacts annotated with `experiment_date`
```
If you want to include the feature values into the dataframe, pass `include`.
```python
ln.Artifact.to_dataframe(include="features") # include the feature annotations
```
### Lake ♾️ LIMS ♾️ Sheets
You can create records for the entities underlying your experiments: samples, perturbations, instruments, etc., for example:
```python
sample = ln.Record(name="Sample", is_type=True).save() # create entity type: Sample
ln.Record(name="P53mutant1", type=sample).save() # sample 1
ln.Record(name="P53mutant2", type=sample).save() # sample 2
```
Define features and annotate an artifact with a sample:
```python
ln.Feature(name="design_sample", dtype=sample).save()
artifact.features.add_values({"design_sample": "P53mutant1"})
```
You can query & search the `Record` registry in the same way as `Artifact` or `Run`.
```python
ln.Record.search("p53").to_dataframe()
```
<details>
<summary>You can create relationships of entities and edit them like Excel sheets on LaminHub.</summary>
<img width="800px" src="https://lamin-site-assets.s3.amazonaws.com/.lamindb/XSzhWUb0EoHOejiw0001.png">
</details>
### Data versioning
If you change source code or datasets, LaminDB manages versioning for you.
Assume you run a new version of our `create-fasta.py` script to create a new version of `sample.fasta`.
```python
import lamindb as ln
ln.track()
open("sample.fasta", "w").write(">seq1\nTGCA\n") # a new sequence
ln.Artifact("sample.fasta", key="sample.fasta", features={"design_sample": "P53mutant1"}).save() # annotate with the new sample
ln.finish()
```
If you now query by `key`, you'll get the latest version of this artifact with the latest version of the source code linked with previous versions of artifact and source code are easily queryable:
```python
artifact = ln.Artifact.get(key="sample.fasta") # get artifact by key
artifact.versions.to_dataframe() # see all versions of that artifact
```
### Lakehouse ♾️ feature store
Here is how you ingest a `DataFrame`:
```python
import pandas as pd
df = pd.DataFrame({
"sequence_str": ["ACGT", "TGCA"],
"gc_content": [0.55, 0.54],
"experiment_note": ["Looks great", "Ok"],
"experiment_date": [date(2025, 10, 24), date(2025, 10, 25)],
})
ln.Artifact.from_dataframe(df, key="my_datasets/sequences.parquet").save() # no validation
```
To validate & annotate the content of the dataframe, use the built-in schema `valid_features`:
```python
ln.Feature(name="sequence_str", dtype=str).save() # define a remaining feature
artifact = ln.Artifact.from_dataframe(
df,
key="my_datasets/sequences.parquet",
schema="valid_features" # validate columns against features
).save()
artifact.describe()
```
<details>
<summary>30 sec video.</summary>
[30 sec video](https://lamin-site-assets.s3.amazonaws.com/.lamindb/lJBlG7wEbNgkl2Cy0000.mp4)
</details>
You can filter for datasets by schema and then launch distributed queries and batch loading.
### Lakehouse beyond tables
To validate an `AnnData` with built-in schema `ensembl_gene_ids_and_valid_features_in_obs`, call:
```python
import anndata as ad
import numpy as np
adata = ad.AnnData(
X=pd.DataFrame([[1]*10]*21).values,
obs=pd.DataFrame({'cell_type_by_model': ['T cell', 'B cell', 'NK cell'] * 7}),
var=pd.DataFrame(index=[f'ENSG{i:011d}' for i in range(10)])
)
artifact = ln.Artifact.from_anndata(
adata,
key="my_datasets/scrna.h5ad",
schema="ensembl_gene_ids_and_valid_features_in_obs"
)
artifact.describe()
```
To validate a `spatialdata` or any other array-like dataset, you need to construct a `Schema`. You can do this by composing simple `pandera`-style schemas: [docs.lamin.ai/curate](https://docs.lamin.ai/curate).
### Ontologies
Plugin `bionty` gives you >20 public ontologies as `SQLRecord` registries. This was used to validate the `ENSG` ids in the `adata` just before.
```python
import bionty as bt
bt.CellType.import_source() # import the default ontology
bt.CellType.to_dataframe() # your extendable cell type ontology in a simple registry
```
Read more: [docs.lamin.ai/manage-ontologies](https://docs.lamin.ai/manage-ontologies).
<details>
<summary>30 sec video.</summary>
[30 sec video](https://lamin-site-assets.s3.amazonaws.com/.lamindb/nUSeIxsaPcBKVuvK0000.mp4)
</details>
نیازمندی
| مقدار | نام |
|---|---|
| - | lamin_utils==0.16.3 |
| - | lamin_cli==1.14.1 |
| - | lamindb_setup[aws]==1.22.0 |
| - | bionty==2.2.1 |
| - | pertdb==2.1.1 |
| - | wetlab<2.1.0,>=2.0.0 |
| - | jupytext |
| - | nbconvert>=7.2.1 |
| - | nbproject==0.11.1 |
| - | pyyaml |
| - | pyarrow |
| - | pandera>=0.24.0 |
| - | typing_extensions!=4.6.0 |
| - | python-dateutil |
| - | pandas<3.0.0,>=2.0.0 |
| - | anndata<=0.12.10,>=0.10.0 |
| - | scipy<1.17.0 |
| - | fsspec |
| - | graphviz |
| - | psycopg2-binary |
| xtr | tomlkit; |
| xtr | line_profiler; |
| xtr | pre-commit; |
| xtr | nox; |
| xtr | laminci>=0.3; |
| xtr | pytest>=6.0; |
| xtr | coverage; |
| xtr | pytest-cov<7.0.0; |
| xtr | mudata; |
| xtr | nbproject_test>=0.6.0; |
| xtr | faker-biology; |
| xtr | pronto; |
| xtr | readfcs>=2.0.1; |
| xtr | lamindb_setup[gcp]; |
| xtr | numcodecs<0.16.0; |
| xtr | zarr<3.0.0a0,>=2.16.0; |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| <3.14,>=3.10 | Python |
نحوه نصب
نصب پکیج whl lamindb-2.2.1:
pip install lamindb-2.2.1.whl
نصب پکیج tar.gz lamindb-2.2.1:
pip install lamindb-2.2.1.tar.gz