LaminDB: Manage R&D data & analyses.
Project description
LaminDB: Manage R&D data & analyses
Curate, store, track, query, integrate, and learn from biological data.
LaminDB provides distributed data management in which users collaborate on LaminDB instances.
Each LaminDB instance is a data lake that manages indexed object storage (local directories, S3, GCP) with a mapped SQL database (SQLite, Postgres, and soon, BigQuery).
Public beta: Currently only recommended for collaborators as we still make breaking changes.
Installation
LaminDB is a python package available for Python versions 3.8+.
pip install lamindb
Import
In your python script, import LaminDB as:
import lamindb as ln
Quick setup
Quick setup on the command line:
- Sign up via
lamin signup <email>
- Log in via
lamin login <handle>
- Set up an instance via
lamin init --storage <storage> --schema <schema_modules>
:::{dropdown} Example code
lamin signup testuser1@lamin.ai
lamin login testuser1
lamin init --storage ./mydata --schema bionty,wetlab
:::
See {doc}/guide/setup
for more.
Track & query data
Track data source & data
::::{tab-set} :::{tab-item} Within a notebook
ln.nb.header() # data source is created and linked
df = pd.DataFrame({"a": [1, 2], "b": [3, 4]})
# create a data object with SQL metadata record
dobject = ln.DObject(df, name="My dataframe")
# upload the data file to the configured storage
# and commit a DObject record to the SQL database
ln.add(dobject)
::: :::{tab-item} Within a pipeline
# create a pipeline record
pipeline = lns.Pipeline(name="my pipeline", version="1")
# create a run from the above pipeline as the data source
run = lns.Run(pipeline=pipeline, name="my run")
df = pd.DataFrame({"a": [1, 2], "b": [3, 4]})
# create a data object with SQL metadata record
dobject = ln.DObject(df, name="My dataframe", source=run)
# upload the data file to the configured storage
# and commit a DObject record to the SQL database
ln.add(dobject)
::: ::::
Query & load data
dobject = ln.select(ln.DObject, name="My dataframe").one()
df = dobject.load()
See {doc}/guide/ingest
for more.
Track features
# Bionty extends lamindb to track biological entities
import bionty as bt
# An example single cell RNA-seq dataset
adata = ln.dev.datasets.anndata_mouse_sc_lymph_node()
# Instantiate a gene table
# with ensembl id as the standardized id
# with mouse as the species
reference = bt.Gene(id=bt.gene_id.ensembl_gene_id, species=bt.Species().lookup.mouse)
# Create a data object with features
dobject = ln.DObject(adata, name="Mouse Lymph Node scRNA-seq", features_ref=reference)
# upload the data file to the configured storage
# and commit a DObject record to the sql database
ln.add(dobject)
See {doc}/guide/link-features
for more.
- Each page in this guide is a Jupyter Notebook, which you can download [here](https://github.com/laminlabs/lamindb/tree/main/docs/guide).
- You can run these notebooks in hosted versions of JupyterLab, e.g., [Saturn Cloud](https://github.com/laminlabs/run-lamin-on-saturn), Google Vertex AI, and others.
- We recommend using [JupyterLab](https://jupyterlab.readthedocs.io/) for best notebook tracking experience.
📬 Reach out to report issues, learn about data modules that connect your assays, pipelines & workflows within our data platform enterprise plan.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file lamindb-0.31.0.tar.gz
.
File metadata
- Download URL: lamindb-0.31.0.tar.gz
- Upload date:
- Size: 85.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6597be07e8e254ed339a532e391d39b48bb9fbd869d68058276598336f10bc0f |
|
MD5 | c0dcad15071318589de882ec05caaba0 |
|
BLAKE2b-256 | a3db255c1e551c96d6e1dea38038e8b8a42ff0738d1bb68bde77bd34db170564 |
Provenance
File details
Details for the file lamindb-0.31.0-py2.py3-none-any.whl
.
File metadata
- Download URL: lamindb-0.31.0-py2.py3-none-any.whl
- Upload date:
- Size: 47.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a862ad5fe96eab8b1de117be069bf7e0abbacb41403c24802f5c2796c037cf5 |
|
MD5 | 2f78b299dc4da69163425b3385bd2c27 |
|
BLAKE2b-256 | 25000ed7642cda796419c77be04cf2a3be58b5ca9e39471b03b6c4f1e2e6b551 |