Chuyển đến nội dung
Skillpedia
Học máy51k · #3485

lamindb

Skill này làm gì

LaminDB giúp sắp xếp và theo dõi dữ liệu sinh học cùng các quy trình phân tích. Nó cho phép bạn đăng ký tập dữ liệu, gắn chú thích siêu dữ liệu và đảm bảo kết quả có thể tái tạo.

Khi nào nên dùng

  • ✓Đăng ký các tập dữ liệu sinh học.
  • ✓Chú thích siêu dữ liệu cho DataFrame hoặc AnnData.
  • ✓Theo dõi các tập lệnh hoặc quy trình khoa học.

Liên kết skill

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/lamindb/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/lamindb/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Sắp xếp dữ liệu thí nghiệm gen của tôi và theo dõi các phân tích tôi đã thực hiện.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn định nghĩa cách dữ liệu nên được cấu trúc (lược đồ) và thông tin nào là quan trọng (đặc trưng). Sau đó, bạn đăng ký tệp và tập lệnh của mình, đảm bảo mọi thứ có thể được tìm lại và tái tạo.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

LaminDB

When to use

Use for registering biological datasets, curating DataFrame/AnnData metadata, querying annotated artifacts, and tracking scientific scripts or workflows. LaminDB stores metadata in SQLite/PostgreSQL and files in configured storage; registration alone does not establish scientific validity or FAIR compliance.

This skill targets LaminDB 2.10.0 and Bionty 2.5.0. The local examples were executed on Python 3.12, pandas 3.0.6, and AnnData 0.13.2. The LaminDB release caps AnnData at 0.13.2; preserve its dependency constraints. Install IPython for registry synonym helpers (add_synonym() imports it in this release).

Workflow

  1. Confirm the intended instance, storage, and write scope with lamin info. Use a new local development directory for experiments. See setup and deployment.
  2. Define typed Feature records and a Schema for the biological data. Use registry-backed categorical dtypes for controlled vocabularies; dtype=str only checks strings. See annotation and validation.
  3. Review the ontology source/version and organism. Standardize only reviewed synonyms and preserve unresolved annotations. See Bionty ontologies.
  4. In a script or notebook, start ln.track(), load registered inputs, validate, and save outputs. curator.validate() returns None on success and raises ln.errors.ValidationError on failure. Repair, then validate again.
  5. Save through the curator or a schema-aware artifact constructor. Check the stored schema and round-trip content; finish a successful run with ln.finish().
  6. Query metadata before loading content. Record artifact UIDs and schema/source provenance for reproducibility; a key can resolve to a newer version later. See queries and streaming.

Local worked example

Run in a dedicated environment and an empty project directory:

uv venv --python 3.12
uv pip install 'lamindb==2.10.0' 'bionty==2.5.0' 'ipython==9.17.1'
source .venv/bin/activate
lamin init --storage ./storage --name biology-demo --modules bionty

Save the following as curate_qc.py, then run python curate_qc.py:

import pandas as pd
import lamindb as ln

ln.track(params={"analysis": "QC metadata curation"})
count = ln.Feature(name="gene_count", dtype=int).save()
condition = ln.Feature(name="condition", dtype=str).save()
schema = ln.Schema(
    name="qc_metadata",
    features=[count, condition],
    maximal_set=True,  # reject extra columns
).save()
df = pd.DataFrame({
    "gene_count": [120, 130],
    "condition": ["control", "treated"],
})
curator = ln.curators.DataFrameCurator(df, schema)
curator.validate()  # raises on invalid data; do not use as an if condition
artifact = curator.save_artifact(key="experiments/qc.parquet")
assert artifact.schema == schema
pd.testing.assert_frame_equal(artifact.load(), df)
ln.finish()

This validates table structure/types, not whether the counts satisfy assay QC. Add assay-specific checks (units, allowed ranges, missingness, duplicate sample IDs, batch balance) before publication or downstream analysis.

Core objects and contracts

Object Purpose and important constraint
Artifact A file/folder or serialized dataset; cache() gets a local path, load() materializes content, open() returns a format-specific accessor.
Feature A typed metadata field; save its definition before artifact.features.set_values(...).
Schema Validation rules and feature membership; maximal_set=True rejects extras. flexible=False alone does not.
Record, ULabel Experimental entities and simple labels. A custom term is not an ontology assertion.
Run, Transform An execution and its code definition. Inputs are run.input_artifacts; outputs are run.output_artifacts.
Collection A versioned group of artifacts; iterate collection.artifacts.all().
Project, Branch, Space Grouping, change organization, and access scope; branches do not replace permissions.

Use @ln.flow() for a workflow entry point and @ln.step() within it. Lineage captures tracked accesses, not arbitrary reads outside LaminDB. Review core concepts for tracking, labels, and revisions.

Failure patterns to avoid

…

Câu hỏi thường gặp

“Artifact” là gì?

Artifact là một tệp hoặc thư mục bạn đăng ký, như bộ dữ liệu hoặc tập lệnh. LaminDB theo dõi các artifact này.

LaminDB đảm bảo khả năng tái tạo như thế nào?

Nó theo dõi dữ liệu đầu vào, tập lệnh đã dùng và các tham số phân tích, tạo ra một lịch sử đầy đủ để bạn có thể làm lại công việc.

“Lược đồ” và “đặc trưng” là gì?

Lược đồ định nghĩa cấu trúc dự kiến của dữ liệu (cột và kiểu dữ liệu), còn đặc trưng là từng trường riêng lẻ trong cấu trúc đó, chẳng hạn “số lượng gen” hoặc “điều kiện thí nghiệm”.

Chi tiết

Mô tả gốc của tác giả

Manages biological datasets and models with LaminDB, including artifact registration, lineage tracking, schema validation, Bionty ontology annotation, query/search, collections, branches, storage, and workflow integrations. Use for reproducible biological data curation or a LaminDB lakehouse.

repo: K-Dense-AI/scientific-agent-skills

Độ phổ biến

Sao GitHub
51k
Vị trí xếp hạng
#3485
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự