Communitygithub.com

lamindb

LaminDB(オープンソースの系譜対応レイクハウス)を使用して生体データセットやモデルを管理するためのスキルです。セットアップ、アーティファクト登録、クエリ/検索、系譜追跡、バリデーション、Biontyによるオントロジーベースのアノテーション、コレクション、ブランチ、ストレージ、ワークフロー統合をカバーします。

lamindb とは?

LaminDBは、生物学研究向けに設計されたオープンソースの系譜対応レイクハウスです。このスキルは、LaminDBの主要機能を包括的にサポートします。アーティファクトのバージョン管理、データの系譜追跡、フルテキスト検索やフィルタリングによるデータクエリ、スキーマバリデーション、Biontyを利用した生物学的オントロジー(遺伝子、細胞タイプ、疾患など)へのアノテーション、コレクションとブランチによる変更管理、クラウドストレージ(S3、GCS)やHugging Faceとの統合、NextflowやSnakemakeといったワークフローマネージャーとの連携を実現します。また、MLパイプライン(Weights & Biases、MLflowなど)との統合、ローカル開発から本番環境(PostgreSQL)への移行などもサポートしています。データ管理を効率化し、再現性を高め、FAIR原則に準拠したデータ共有を促進するための実践的なガイドを提供します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/K-Dense-AI/scientific-agent-skills/tree/main/skills/lamindb

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

lamindb は何をしますか?

概要

LaminDBは、生物学向けのオープンソース系譜対応レイクハウスです。データセットとモデルを検索可能、追跡可能、検証可能、再現可能、かつFAIR(Findable、Accessible、Interoperable、Reusable)にし、データをオープンフォーマットでローカルファイルシステム、S3、GCS、Hugging Face、SQLite、Postgresに保存します。

中核的な価値提案:

  • 検索可能性: アーティファクト、レコード、ラン、フィーチャー、スキーマ、コレクションを検索・フィルタリング
  • 追跡可能性: ノートブック、スクリプト、関数、パイプラインの入力、出力、パラメータ、ソースコード、環境を追跡
  • 検証: DataFrame、AnnData、SpatialData、TileDB-SOMA、Parquet、Zarr、その他の生物学的フォーマットをスキーマでキュレーション
  • FAIRコンプライアンス: Biontyベースのオントロジーとカスタムレジストリでアノテーションを標準化
  • 変更管理: プロジェクト、ブランチ、スペース、コレクション、保存されたノートや計画で作業を整理

このスキルを使用すべき場合

以下の場合にこのスキルを使用してください:

  • 生物学的データセットの管理: scRNA-seq、バルクRNA-seq、空間トランスクリプトミクス、フローサイトメトリー、マルチモーダルデータ、EHRデータ
  • 計算ワークフローの追跡: ノートブック、スクリプト、関数、シェルスクリプト、パイプライン実行(Nextflow、Snakemake、Redun)
  • データのキュレーションと検証: スキーマ検証、標準化、オントロジーベースのアノテーション
  • 生物学的オントロジーの操作: 遺伝子、タンパク質、細胞タイプ、組織、疾患、経路(Bionty経由)
  • データレイクハウスの構築: 複数のデータセットにわたる統合クエリインターフェース
  • 再現性の確保: 自動バージョン管理、系譜追跡、環境キャプチャ
  • MLパイプラインの統合: Weights & Biases、MLflow、Hugging Face、Lightning、scVI-toolsとの連携
  • データインフラのデプロイ: ローカルまたはクラウドベースのデータ管理システムのセットアップ
  • データセットの共同作業: 標準化されたメタデータでキュレーションされたアノテーション付きデータの共有

中核機能

LaminDBは6つの相互接続された機能領域を提供し、それぞれがreferencesフォルダに詳細に文書化されています。

1. 中核概念とデータ系譜

中核エンティティ:

  • アーティファクト: バージョン管理されたデータセット(DataFrame、AnnData、Parquet、Zarrなど)
  • レコードとULabel: 実験エンティティ、型付きレコード、単純なラベル
  • コレクション: バージョン管理された不変のアーティファクトセット
  • ランとトランスフォーム: 計算系譜の追跡(どのコードがどのデータを生成したか)
  • フィーチャー: アノテーションとクエリのための型付きメタデータフィールド
  • プロジェクト、ブランチ、スペース: プロジェクトグループ化、変更管理、アクセス境界

主要ワークフロー:

  • ファイルまたはPythonオブジェクトからのアーティファクトの作成とバージョン管理
  • ln.track() と ln.finish() によるノートブック/スクリプト実行の追跡
  • @ln.flow() と @ln.step() による関数ワークフローの追跡
  • レコード、ulabel、プロジェクト、型付きフィーチャーによるアーティファクトのアノテーション
  • artifact.view_lineage() によるデータ系譜グラフの可視化
  • 来歴によるクエリ(特定のコード/入力からのすべての出力を見つける)

リファレンス: references/core-concepts.md - アーティファクト、レコード、ラン、トランスフォーム、フィーチャー、バージョン管理、系譜追跡の詳細についてはこちらを参照してください。

2. データ管理とクエリ

クエリ機能:

  • 自動補完によるレジストリの探索とルックアップ
  • get()、one()、one_or_none() による単一レコードの取得
  • 比較演算子(__gt、__lte、__contains、__startswith)によるフィルタリング
  • Feature オブジェクトを使用した式スタイルのクエリを含むフィーチャーベースのクエリ
  • 二重アンダースコア構文によるレジストリ間のトラバーサル
  • レジストリ全体の全文検索
  • ln.Q オブジェクトを使用した高度な論理クエリ(AND、OR、NOT)
  • メモリにロードせずに大規模データセットをストリーミング

主要ワークフロー:

  • フィルターと順序付けによるアーティファクトのブラウズ
  • フィーチャー、作成日、作成者、サイズなどによるクエリ
  • 大きなファイルをチャンクまたは配列スライシングでストリーミング
  • 階層キーによるデータの整理
  • アーティファクトをコレクションにグループ化

リファレンス: references/data-management.md - 包括的なクエリパターン、フィルタリング例、ストリーミング戦略、データ整理のベストプラクティスについてはこちらを参照してください。

3. アノテーションと検証

キュレーションプロセス:

  1. 検証: データセットが目的のスキーマに一致することを確認
  2. 標準化: タイプミスの修正、同義語の正規用語へのマッピング
  3. アノテーション: データセットをメタデータエンティティにリンクして検索可能にする

スキーマタイプ:

  • フレキシブルスキーマ: 既知の列のみを検証し、追加のメタデータを許可
  • 最小必須スキーマ: 必須列を指定し、追加を許可
  • 厳格スキーマ: 構造と値を完全に制御

サポートされるデータタイプ:

  • DataFrame(Parquet、CSV)
  • AnnData(シングルセルゲノミクス)
  • MuData(マルチモーダル)
  • SpatialData(空間トランスクリプトミクス)
  • TileDB-SOMA(スケーラブル配列)

主要ワークフロー:

  • データ検証のためのフィーチャーとスキーマの定義
  • DataFrameCurator、AnnDataCurator、SpatialDataCurator、または TiledbsomaExperimentCurator を使用した検証
  • .cat.standardize() による値の標準化
  • .cat.add_ontology() によるオントロジーへのマッピング
  • スキーマリンケージを使用したキュレーションされたアーティファクトの保存
  • フィーチャーによる検証済みデータセットのクエリ

リファレンス: references/annotation-validation.md - 詳細なキュレーションワークフロー、スキーマデザインパターン、検証エラーの処理、ベストプラクティスについてはこちらを参照してください。

4. 生物学的オントロジー

利用可能なオントロジー(Bionty経由):

  • 遺伝子(Ensembl)、タンパク質(UniProt)
  • 細胞タイプ(CL)、細胞株(CLO)
  • 組織(Uberon)、疾患(Mondo、DOID)
  • 表現型(HPO)、経路(GO)
  • 実験因子(EFO)、発生段階
  • 生物(NCBItaxon)、薬物(DrugBank)

主要ワークフロー:

  • bt.CellType.import_source() によるパブリックオントロジーのインポート
  • キーワードまたは完全一致によるオントロジーの検索
  • 同義語マッピングを使用した用語の標準化
  • 階層関係(親、子、祖先)の探索
  • オントロジー用語に対するデータの検証
  • オントロジーレコードによるデータセットのアノテーション
  • カスタム用語と階層の作成
  • マルチ生物コンテキスト(ヒト、マウスなど)の処理

リファレンス: references/ontologies.md - 包括的なオントロジー操作、標準化戦略、階層ナビゲーション、アノテーションワークフローについてはこちらを参照してください。

5. 統合

ワークフローマネージャー:

  • Nextflow: パイプラインプロセスと出力の追跡
  • Snakemake: Snakemakeルールへの統合
  • Redun: Redunタスク追跡との組み合わせ
  • Lightning: チェックポイントとトレーニングメタデータの永続化

MLOpsプラットフォーム:

  • Weights & Biases: 実験とデータアーティファクトのリンク
  • MLflow: モデルと実験の追跡
  • Hugging Face: モデルファインチューニングの追跡
  • scVI-tools: シングルセル解析ワークフロー

ストレージシステム:

  • ローカルファイルシステム、AWS S3、Google Cloud Storage
  • S3互換(MinIO、Cloudflare R2)
  • HTTP/HTTPSエンドポイント(読み取り専用)
  • HuggingFace datasets

配列ストア:

  • TileDB-SOMA(cellxgeneサポート付き)
  • Parquetファイルに対するSQLクエリ用DuckDB

可視化:

  • Vitessce: インタラクティブな空間・シングルセル可視化

バージョン管理:

  • Git統合: ソースコード追跡

リファレンス: references/integrations.md - 統合パターン、コード例、サードパーティシステムのトラブルシューティングについてはこちらを参照してください。

6. セットアップとデプロイ

インストール:

  • 現在の安定ベースライン: lamindb==2.5.1(2026-06-01リリース; Python >=3.10、<=3.14)
  • 基本: uv pip install 'lamindb==2.5.1'
  • 拡張機能付き: uv pip install 'lamindb[gcp,zarr-v2,fcs]==2.5.1'
  • 最小限の名前空間のみ: uv pip install 'lamindb-core==2.5.1'
  • Biontyモジュール: LaminDBドキュメントに含まれており、uv pip install 'bionty==2.4.0' で利用可能
  • オプションモジュール: 最新の浮動バージョンをインストールするのではなく、wetlabまたは臨床スキーマモジュールにはレビュー済みのリリースを固定

インスタンスタイプ:

  • ローカルSQLite(開発)
  • クラウドストレージ + SQLite(小規模チーム)
  • クラウドストレージ + PostgreSQL(本番環境)

ストレージオプション:

  • ローカルファイルシステム
  • 構成可能なリージョンと権限を持つAWS S3
  • Google Cloud Storage
  • S3互換エンドポイント(MinIO、Cloudflare R2)

設定:

  • クラウドファイルのキャッシュ管理
  • マルチユーザーシステム設定
  • Gitリポジトリ同期
  • 資格情報と接続URLのための名前付き環境変数

デプロイパターン:

  • ローカル開発 → クラウド本番環境への移行
  • マルチリージョンデプロイ
  • 個人インスタンスによる共有ストレージ

リファレンス: references/setup-deployment.md - 詳細なインストール、設定、ストレージセットアップ、データベース管理、セキュリティのベストプラクティス、トラブルシューティングについてはこちらを参照してください。

安全性とセキュリティのデフォルト

LaminDBのセットアップや統合を支援する場合:

  • APIキー、クラウド資格情報、データベースパスワード、シークレットを含む完全な接続文字列を表示、ログ記録、または送信しないでください。
  • IAMロール、ワークロードアイデンティティ、シークレットマネージャー、LAMIN_DB_URL、AWS_ACCESS_KEY_ID、AWS_SECRET_ACCESS_KEY、GOOGLE_APPLICATION_CREDENTIALS などの名前付き環境変数を優先し、名前付き変数が存在するかどうかのみを確認し、その値を確認しないでください。
  • REST API、外部データベース、またはユーザー提供ファイルからコンテンツを保存する前に、明示的なスキーマまたはキュレーターでコンテンツを検証およびサニタイズしてください。
  • 再現可能なインストールのために、パッケージバージョンを固定するか、ロックファイルを使用してください。ユーザーが最新のアップストリームリリースを明示的に希望する場合にのみ、浮動インストールは許容されます。

一般的なユースケースワークフロー

ユースケース1: オントロジー検証によるシングルセルRNA-seq解析

import lamindb as ln
import bionty as bt
import anndata as ad

# ノートブック/スクリプト実行の追跡を開始
ln.track(params={"analysis": "scRNA-seq QC and annotation"})

# 細胞タイプオントロジーのインポート
bt.CellType.import_source()

# データのロード
adata = ad.read_h5ad("raw_counts.h5ad")

# 細胞タイプの検証と標準化
adata.obs["cell_type"] = bt.CellType.standardize(adata.obs["cell_type"])

# スキーマを使用したキュレーション
curator = ln.curators.AnnDataCurator(adata, schema)
curator.validate()
artifact = curator.save_artifact(key="scrna/validated.h5ad")

# 検索可能性のためにオントロジーベースのアノテーションをリンク
cell_types = bt.CellType.from_values(adata.obs["cell_type"])
artifact.cell_types.add(*cell_types)

ln.finish()

ユースケース2: 検索可能なデータレイクハウスの構築

import lamindb as ln

# 複数の実験を登録
for i, file in enumerate(data_files):
    artifact = ln.Artifact.from_anndata(
        ad.read_h5ad(file),
        key=f"scrna/batch_{i}.h5ad",
        description=f"scRNA-seq batch {i}"
    ).save()

    # フィーチャーでアノテーション
    artifact.features.set_values({
        "batch": i,
        "tissue": tissues[i],
        "condition": conditions[i]
    })

# アノテーションされたフィーチャーですべての実験を横断してクエリ
immune_datasets = ln.Artifact.filter(
    key__startswith="scrna/",
    tissue="PBMC",
    condition="treated"
).to_dataframe()

# 特定のデータセットをロード
for artifact in immune_datasets:
    adata = artifact.load()
    # 解析

ユースケース3: W&B統合によるMLパイプライン

import lamindb as ln
import wandb

# 両方のシステムを初期化
wandb.init(project="drug-response", name="exp-42")
ln.track(params={"model": "random_forest", "n_estimators": 100})

# LaminDBからトレーニングデータをロード
train_artifact = ln.Artifact.get(key="datasets/train.parquet")
train_data = train_artifact.load()

# モデルをトレーニング
model = train_model(train_data)

# W&Bにログ
wandb.log({"accuracy": 0.95})

# W&BリンケージでLaminDBにモデルを保存
import joblib
joblib.dump(model, "model.pkl")
model_artifact = ln.Artifact("model.pkl", key="models/exp-42.pkl").save()
model_artifact.features.set_values({"wandb_run_id": wandb.run.id})

ln.finish()
wandb.finish()

ユースケース4: Nextflowパイプライン統合

# Nextflowプロセススクリプト内
import lamindb as ln

ln.track()

# 入力アーティファクトをロード
input_artifact = ln.Artifact.get(key="raw/batch_${batch_id}.fastq.gz")
input_path = input_artifact.cache()

# 処理(アラインメント、定量化など)
# ... Nextflowプロセスロジック ...

# 出力を保存
output_artifact = ln.Artifact(
    "counts.csv",
    key="processed/batch_${batch_id}_counts.csv"
).save()

ln.finish()

ネイティブNextflowプロジェクトの場合は、nf-laminプラグインと現在のnextflow.configパターンを優先してください。小規模またはカスタムパイプラインステップには、インラインPython追跡を使用してください。

はじめにのチェックリスト

LaminDBを効果的に使い始めるには:

  1. インストールと設定(references/setup-deployment.md)

    • 固定されたLaminDBと必要な拡張機能をインストール
    • lamin login で認証
    • lamin init --storage ... でインスタンスを初期化
  2. 中核概念を学ぶ(references/core-concepts.md)

    • アーティファクト、レコード、ラン、トランスフォームを理解
    • アーティファクトの作成と取得を練習
    • ワークフローで ln.track()/ln.finish() または @ln.flow()/@ln.step() を実装
  3. クエリをマスターする(references/data-management.md)

    • レジストリのフィルタリングと検索を練習
    • フィーチャーベースのクエリと式スタイルのフィルターを学ぶ
    • 大きなファイルのストリーミングを試す
  4. 検証を設定する(references/annotation-validation.md)

    • 研究ドメインに関連するフィーチャーを定義
    • データタイプのスキーマを作成
    • キュレーションワークフローを練習
  5. オントロジーを統合する(references/ontologies.md)

    • 関連する生物学的オントロジー(遺伝子、細胞タイプなど)をインポート
    • 既存のアノテーションを検証
    • オントロジー用語でメタデータを標準化
  6. ツールを接続する(references/integrations.md)

    • 既存のワークフローマネージャーと統合
    • 実験追跡のためにMLプラットフォームをリンク
    • クラウドストレージとコンピューティングを設定

主要原則

LaminDBを操作する際は、以下の原則に従ってください:

  1. すべてを追跡: 自動系譜キャプチャのために、すべての解析の開始時に ln.track() を使用

  2. 早期に検証: 広範な解析の前にスキーマを定義し、データを検証

  3. オントロジーを使用: 標準化されたアノテーションのためにパブリック生物学的オントロジーを活用

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

adaptyv

How to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.

aeon

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

alphagenome

Look up precomputed AlphaGenome Atlas effects for any GRCh38 single-nucleotide variant (AVI score with Phred and 18 SHAP feature attributions, plus raw and quantile scores for RNA-seq, DNase, ATAC, ChIP-TF, ChIP-histone, CAGE, PRO-cap, splicing, polyadenylation and contact-map tracks), score variants or scan windows on demand with the AlphaGenome model for human and mouse (variant scoring, in silico mutagenesis, REF-versus-ALT track prediction), and build Atlas website deep links. Use when the user mentions AlphaGenome, AlphaGenome Atlas, AVI or AlphaGenome Variant Impact, DeepMind variant effect prediction, or wants to prioritise or mechanistically interpret non-coding, regulatory, splicing, enhancer, promoter, or chromatin-accessibility effects of SNVs from a VCF, credible set, or region. Research use only; not a clinical tool.

analytical-method-validation

Plan, execute, and document validation, verification, and transfer of analytical procedures under the governing framework - ICH Q2(R2) and Q14, USP <1220>/<1225>/<1226>, ICH M10 bioanalytical, CLSI EP, or ISO/IEC 17025. Use for HPLC, LC-MS/MS, GC, CE, ICP-MS, dissolution, qNMR, qPCR, NIR, and ligand binding or cell-based assays whenever the question is whether a procedure is fit for its intended purpose. Triggers include

anndata

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

arbor

Autonomously improve a real artifact (code, training recipe, agent harness, data pipeline, prompt) against an objective and an evaluator, using Hypothesis Tree Refinement (HTR) from the Arbor paper. Use this whenever someone wants to iteratively optimize something over many experiments without overfitting — e.g.

arboreto

Infer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.

astropy

Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.

autoskill

Observe the user

benchling-integration

Benchling Python SDK and REST API integration for registry entities, inventory, ELN entries, workflows, Benchling Apps, and Data Warehouse queries. Use when automating lab data with benchling-sdk or the v2 API.

bgpt-paper-search

Search scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server. Returns 25+ fields per paper including methods, results, sample sizes, quality scores, and conclusions. Use for literature reviews, evidence synthesis, and finding experimental details not available in abstracts alone.

bids

>

biopython

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

bioservices

Unified Python interface to 40+ bioinformatics services. Use when querying multiple databases (UniProt, KEGG, ChEMBL, Reactome) in a single workflow with consistent API. Best for cross-database analysis, ID mapping across services. For quick single-database lookups use gget; for sequence/file manipulation use biopython.

bulk-rnaseq

End-to-end bulk RNA-seq orchestrator — takes raw FASTQ reads through QC and trimming (FastQC, fastp/Trim Galore), alignment and quantification (STAR, Salmon, featureCounts), assembles a gene-level counts matrix, then hands off to differential expression (pydeseq2), pathway/GSEA enrichment (pathway-enrichment), and publication figures (scientific-visualization). Use whenever the user has bulk RNA-seq reads or quant output and wants a complete, reproducible differential-expression workflow — e.g.

cellxgene-census

Query the CZ CELLxGENE Census programmatically for versioned public single-cell and spatial transcriptomics data. Use when you need population-scale cell metadata, gene expression slices, Census summary counts, source H5AD URIs/downloads, embeddings, spatial Census data, or reference atlas comparisons across organisms, tissues, diseases, assays, and cell types. For analyzing your own local single-cell data use scanpy, anndata, or scvi-tools.

cirq

Google quantum computing framework. Use when targeting Google Quantum AI hardware, designing noise-aware circuits, or running quantum characterization experiments. Best for Google hardware, noise modeling, and low-level circuit design. For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for physics simulations use qutip.

citation-management

Comprehensive citation management for academic research. Search OpenAlex, PubMed, and Google Scholar for papers, extract accurate metadata, validate citations, and generate properly formatted BibTeX entries. This skill should be used when you need to find papers, verify citation information, convert DOIs to BibTeX, or ensure reference accuracy in scientific writing.

clinical-decision-support

Prepare and validate research-only clinical decision-support evaluation, evidence-profile, cohort, survival, biomarker/model, privacy, and governance artifacts. Use for aggregate or synthetic research documentation and traceability—not patient care or live clinical operation.

clinical-reports

Create safety-bounded draft structures and run local deterministic checks for clinical case, diagnostic, trial, safety, and aggregate research reports. Use only with synthetic, de-identified, or aggregate inputs and verified source-fact manifests; every output requires qualified review.

関連スキル