🛠️ Tiledbvcf
遺伝子変異データを効率的に保存・検索するためのSkill
📺 まず動画で見る(YouTube)
▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗
※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。
📜 元の英語説明(参考)
Efficient storage and retrieval of genomic variant data using TileDB. Scalable VCF/BCF ingestion, incremental sample addition, compressed storage, parallel queries, and export capabilities for population genomics.
🇯🇵 日本人クリエイター向け解説
遺伝子変異データを効率的に保存・検索するためのSkill
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o tiledbvcf.zip https://jpskill.com/download/4249.zip && unzip -o tiledbvcf.zip && rm tiledbvcf.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/4249.zip -OutFile "$d\tiledbvcf.zip"; Expand-Archive "$d\tiledbvcf.zip" -DestinationPath $d -Force; ri "$d\tiledbvcf.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
tiledbvcf.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
tiledbvcfフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
💬 こう話しかけるだけ — サンプルプロンプト
- › Tiledbvcf を使って、最小構成のサンプルコードを示して
- › Tiledbvcf の主な使い方と注意点を教えて
- › Tiledbvcf を既存プロジェクトに組み込む方法を教えて
これをClaude Code に貼るだけで、このSkillが自動発動します。
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
TileDB-VCF
概要
TileDB-VCF は、ゲノムのバリアントコールデータを効率的に保存および取得するための、Python および CLI インターフェースを備えた高性能な C++ ライブラリです。TileDB のスパースアレイ技術に基づいて構築されており、VCF/BCF ファイルのスケーラブルな取り込み、高価なマージ操作なしでのインクリメンタルなサンプル追加、ローカルまたはクラウドに保存されたバリアントデータの効率的な並列クエリを可能にします。
このスキルを使用するタイミング
このスキルは、次の場合に使用してください。
- TileDB-VCF の概念とワークフローを学習する場合
- ゲノミクス解析とパイプラインのプロトタイプを作成する場合
- 小規模から中規模のデータセット(1000 サンプル未満)を扱う場合
- 既存のデータセットに新しいサンプルをインクリメンタルに追加する必要がある場合
- 多くのサンプルにわたる特定のゲノム領域を効率的にクエリする必要がある場合
- クラウドに保存されたバリアントデータ(S3、Azure、GCS)を扱う場合
- 大規模な VCF データセットのサブセットをエクスポートする必要がある場合
- コホート研究のためのバリアントデータベースを構築する場合
- 教育プロジェクトや手法開発の場合
- バリアントデータ操作においてパフォーマンスが重要である場合
クイックスタート
インストール
推奨される方法: Conda/Mamba
# M1 Mac をお使いの場合は、以下の2行を入力してください
CONDA_SUBDIR=osx-64
conda config --env --set subdir osx-64
# conda 環境を作成します
conda create -n tiledb-vcf "python<3.10"
conda activate tiledb-vcf
# Mamba は conda のより高速で信頼性の高い代替手段です
conda install -c conda-forge mamba
# TileDB-Py と TileDB-VCF をインストールし、他の便利なライブラリと連携させます
mamba install -y -c conda-forge -c bioconda -c tiledb tiledb-py tiledbvcf-py pandas pyarrow numpy
代替: Docker イメージ
docker pull tiledb/tiledbvcf-py # Python インターフェース
docker pull tiledb/tiledbvcf-cli # コマンドラインインターフェース
基本的な例
データセットの作成と投入:
import tiledbvcf
# 新しいデータセットを作成します
ds = tiledbvcf.Dataset(uri="my_dataset", mode="w",
cfg=tiledbvcf.ReadConfig(memory_budget=1024))
# VCF ファイルを取り込みます(単一サンプルでインデックス付きである必要があります)
# 要件:
# - VCF は単一サンプルである必要があります(複数サンプルではない)
# - インデックスが必要です: .csi (bcftools) または .tbi (tabix)
ds.ingest_samples(["sample1.vcf.gz", "sample2.vcf.gz"])
バリアントデータのクエリ:
# 読み取り用に既存のデータセットを開きます
ds = tiledbvcf.Dataset(uri="my_dataset", mode="r")
# 特定の領域とサンプルをクエリします
df = ds.read(
attrs=["sample_name", "pos_start", "pos_end", "alleles", "fmt_GT"],
regions=["chr1:1000000-2000000", "chr2:500000-1500000"],
samples=["sample1", "sample2", "sample3"]
)
print(df.head())
VCF へのエクスポート:
import os
# 2つの VCF サンプルをエクスポートします
ds.export(
regions=["chr21:8220186-8405573"],
samples=["HG00101", "HG00097"],
output_format="v",
output_dir=os.path.expanduser("~"),
)
コア機能
1. データセットの作成と取り込み
TileDB-VCF データセットを作成し、複数の VCF/BCF ファイルからバリアントデータをインクリメンタルに取り込みます。これは、集団ゲノミクスデータベースやコホート研究の構築に適しています。
要件:
- 単一サンプル VCF のみ: 複数サンプル VCF はサポートされていません
- インデックスファイルが必要: VCF/BCF ファイルにはインデックス(.csi または .tbi)が必要です
一般的な操作:
- 最適化されたアレイスキーマで新しいデータセットを作成します
- 単一または複数の VCF/BCF ファイルを並行して取り込みます
- 既存のデータを再処理することなく、新しいサンプルをインクリメンタルに追加します
- メモリ使用量と圧縮設定を構成します
- さまざまな VCF 形式と INFO/FORMAT フィールドを処理します
- 中断された取り込みプロセスを再開します
- 取り込み中にデータ整合性を検証します
2. 効率的なクエリとフィルタリング
ゲノム領域、サンプル、およびバリアント属性にわたって、高性能でバリアントデータをクエリします。これは、関連研究、バリアント発見、および集団解析に適しています。
一般的な操作:
- 特定のゲノム領域(単一または複数)をクエリします
- サンプル名またはサンプルグループでフィルタリングします
- 特定のバリアント属性(位置、アレル、遺伝子型、品質)を抽出します
- INFO および FORMAT フィールドに効率的にアクセスします
- 空間ベースと属性ベースのフィルタリングを組み合わせます
- 大規模なクエリ結果をストリーミングします
- サンプルまたは領域にわたる集計を実行します
3. データのエクスポートと相互運用性
ダウンストリーム解析や他のゲノミクスツールとの統合のために、さまざまな形式でデータをエクスポートします。これは、データセットの共有、解析サブセットの作成、または他のパイプラインへの供給に適しています。
一般的な操作:
- 標準の VCF/BCF 形式にエクスポートします
- 選択したフィールドを含む TSV ファイルを生成します
- サンプル/領域固有のサブセットを作成します
- データ来歴とメタデータを維持します
- すべてのアノテーションを保持するロスレスデータエクスポート
- 圧縮された出力形式
- 大規模データセットのストリーミングエクスポート
4. 集団ゲノミクスワークフロー
TileDB-VCF は、多くのサンプルとゲノム領域にわたるバリアントデータへの効率的なアクセスを必要とする大規模な集団ゲノミクス解析に優れています。
一般的なワークフロー:
- ゲノムワイド関連解析(GWAS)データ準備
- 稀少バリアント負担テスト
- 集団層別化解析
- 集団にわたるアレル頻度計算
- 大規模コホートにわたる品質管理
- バリアントアノテーションとフィルタリング
- 集団間比較解析
主要な概念
アレイスキーマとデータモデル
TileDB-VCF データモデル:
- ゲノム座標を次元とするスパースアレイとして保存されるバリアント
- 効率的なサンプル固有のクエリを可能にする属性として保存されるサンプル
- 元のデータ型を保持して保存される INFO および FORMAT フィールド
- 最適なストレージのための自動圧縮とチャンキング
スキーマ構成:
# 特定のタイル範囲を持つカスタムスキーマ
config = tiledbvcf.ReadConfig(
memory_budget=2048, # MB
region_partition=(0, 3095677412), # 全ゲノム
sample_partition=(0, 10000) # 最大 1万サンプル
)
座標系と領域
重要: TileDB-VCF は VCF 標準に従って1ベースのゲノム座標を使用します。
- 位置は1ベースです(最初の塩基は位置1です)
- 範囲は包括的です
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
TileDB-VCF
Overview
TileDB-VCF is a high-performance C++ library with Python and CLI interfaces for efficient storage and retrieval of genomic variant-call data. Built on TileDB's sparse array technology, it enables scalable ingestion of VCF/BCF files, incremental sample addition without expensive merging operations, and efficient parallel queries of variant data stored locally or in the cloud.
When to Use This Skill
This skill should be used when:
- Learning TileDB-VCF concepts and workflows
- Prototyping genomics analyses and pipelines
- Working with small-to-medium datasets (< 1000 samples)
- Need incremental addition of new samples to existing datasets
- Require efficient querying of specific genomic regions across many samples
- Working with cloud-stored variant data (S3, Azure, GCS)
- Need to export subsets of large VCF datasets
- Building variant databases for cohort studies
- Educational projects and method development
- Performance is critical for variant data operations
Quick Start
Installation
Preferred Method: Conda/Mamba
# Enter the following two lines if you are on a M1 Mac
CONDA_SUBDIR=osx-64
conda config --env --set subdir osx-64
# Create the conda environment
conda create -n tiledb-vcf "python<3.10"
conda activate tiledb-vcf
# Mamba is a faster and more reliable alternative to conda
conda install -c conda-forge mamba
# Install TileDB-Py and TileDB-VCF, align with other useful libraries
mamba install -y -c conda-forge -c bioconda -c tiledb tiledb-py tiledbvcf-py pandas pyarrow numpy
Alternative: Docker Images
docker pull tiledb/tiledbvcf-py # Python interface
docker pull tiledb/tiledbvcf-cli # Command-line interface
Basic Examples
Create and populate a dataset:
import tiledbvcf
# Create a new dataset
ds = tiledbvcf.Dataset(uri="my_dataset", mode="w",
cfg=tiledbvcf.ReadConfig(memory_budget=1024))
# Ingest VCF files (must be single-sample with indexes)
# Requirements:
# - VCFs must be single-sample (not multi-sample)
# - Must have indexes: .csi (bcftools) or .tbi (tabix)
ds.ingest_samples(["sample1.vcf.gz", "sample2.vcf.gz"])
Query variant data:
# Open existing dataset for reading
ds = tiledbvcf.Dataset(uri="my_dataset", mode="r")
# Query specific regions and samples
df = ds.read(
attrs=["sample_name", "pos_start", "pos_end", "alleles", "fmt_GT"],
regions=["chr1:1000000-2000000", "chr2:500000-1500000"],
samples=["sample1", "sample2", "sample3"]
)
print(df.head())
Export to VCF:
import os
# Export two VCF samples
ds.export(
regions=["chr21:8220186-8405573"],
samples=["HG00101", "HG00097"],
output_format="v",
output_dir=os.path.expanduser("~"),
)
Core Capabilities
1. Dataset Creation and Ingestion
Create TileDB-VCF datasets and incrementally ingest variant data from multiple VCF/BCF files. This is appropriate for building population genomics databases and cohort studies.
Requirements:
- Single-sample VCFs only: Multi-sample VCFs are not supported
- Index files required: VCF/BCF files must have indexes (.csi or .tbi)
Common operations:
- Create new datasets with optimized array schemas
- Ingest single or multiple VCF/BCF files in parallel
- Add new samples incrementally without re-processing existing data
- Configure memory usage and compression settings
- Handle various VCF formats and INFO/FORMAT fields
- Resume interrupted ingestion processes
- Validate data integrity during ingestion
2. Efficient Querying and Filtering
Query variant data with high performance across genomic regions, samples, and variant attributes. This is appropriate for association studies, variant discovery, and population analysis.
Common operations:
- Query specific genomic regions (single or multiple)
- Filter by sample names or sample groups
- Extract specific variant attributes (position, alleles, genotypes, quality)
- Access INFO and FORMAT fields efficiently
- Combine spatial and attribute-based filtering
- Stream large query results
- Perform aggregations across samples or regions
3. Data Export and Interoperability
Export data in various formats for downstream analysis or integration with other genomics tools. This is appropriate for sharing datasets, creating analysis subsets, or feeding other pipelines.
Common operations:
- Export to standard VCF/BCF formats
- Generate TSV files with selected fields
- Create sample/region-specific subsets
- Maintain data provenance and metadata
- Lossless data export preserving all annotations
- Compressed output formats
- Streaming exports for large datasets
4. Population Genomics Workflows
TileDB-VCF excels at large-scale population genomics analyses requiring efficient access to variant data across many samples and genomic regions.
Common workflows:
- Genome-wide association studies (GWAS) data preparation
- Rare variant burden testing
- Population stratification analysis
- Allele frequency calculations across populations
- Quality control across large cohorts
- Variant annotation and filtering
- Cross-population comparative analysis
Key Concepts
Array Schema and Data Model
TileDB-VCF Data Model:
- Variants stored as sparse arrays with genomic coordinates as dimensions
- Samples stored as attributes allowing efficient sample-specific queries
- INFO and FORMAT fields preserved with original data types
- Automatic compression and chunking for optimal storage
Schema Configuration:
# Custom schema with specific tile extents
config = tiledbvcf.ReadConfig(
memory_budget=2048, # MB
region_partition=(0, 3095677412), # Full genome
sample_partition=(0, 10000) # Up to 10k samples
)
Coordinate Systems and Regions
Critical: TileDB-VCF uses 1-based genomic coordinates following VCF standard:
- Positions are 1-based (first base is position 1)
- Ranges are inclusive on both ends
- Region "chr1:1000-2000" includes positions 1000-2000 (1001 bases total)
Region specification formats:
# Single region
regions = ["chr1:1000000-2000000"]
# Multiple regions
regions = ["chr1:1000000-2000000", "chr2:500000-1500000"]
# Whole chromosome
regions = ["chr1"]
# BED-style (0-based, half-open converted internally)
regions = ["chr1:999999-2000000"] # Equivalent to 1-based chr1:1000000-2000000
Memory Management
Performance considerations:
- Set appropriate memory budget based on available system memory
- Use streaming queries for very large result sets
- Partition large ingestions to avoid memory exhaustion
- Configure tile cache for repeated region access
- Use parallel ingestion for multiple files
- Optimize region queries by combining nearby regions
Cloud Storage Integration
TileDB-VCF seamlessly works with cloud storage:
# S3 dataset
ds = tiledbvcf.Dataset(uri="s3://bucket/dataset", mode="r")
# Azure Blob Storage
ds = tiledbvcf.Dataset(uri="azure://container/dataset", mode="r")
# Google Cloud Storage
ds = tiledbvcf.Dataset(uri="gcs://bucket/dataset", mode="r")
Common Pitfalls
- Memory exhaustion during ingestion: Use appropriate memory budget and batch processing for large VCF files
- Inefficient region queries: Combine nearby regions instead of many separate queries
- Missing sample names: Ensure sample names in VCF headers match query sample specifications
- Coordinate system confusion: Remember TileDB-VCF uses 1-based coordinates like VCF standard
- Large result sets: Use streaming or pagination for queries returning millions of variants
- Cloud permissions: Ensure proper authentication for cloud storage access
- Concurrent access: Multiple writers to the same dataset can cause corruption—use appropriate locking
CLI Usage
TileDB-VCF provides a command-line interface with the following subcommands:
Available Subcommands:
create- Creates an empty TileDB-VCF datasetstore- Ingests samples into a TileDB-VCF datasetexport- Exports data from a TileDB-VCF datasetlist- Lists all sample names present in a TileDB-VCF datasetstat- Prints high-level statistics about a TileDB-VCF datasetutils- Utils for working with a TileDB-VCF datasetversion- Print the version information and exit
# Create empty dataset
tiledbvcf create --uri my_dataset
# Ingest samples (requires single-sample VCFs with indexes)
tiledbvcf store --uri my_dataset --samples sample1.vcf.gz,sample2.vcf.gz
# Export data
tiledbvcf export --uri my_dataset \
--regions "chr1:1000000-2000000" \
--sample-names "sample1,sample2"
# List all samples
tiledbvcf list --uri my_dataset
# Show dataset statistics
tiledbvcf stat --uri my_dataset
Advanced Features
Allele Frequency Analysis
# Calculate allele frequencies
af_df = tiledbvcf.read_allele_frequency(
uri="my_dataset",
regions=["chr1:1000000-2000000"],
samples=["sample1", "sample2", "sample3"]
)
Sample Quality Control
# Perform sample QC
qc_results = tiledbvcf.sample_qc(
uri="my_dataset",
samples=["sample1", "sample2"]
)
Custom Configurations
# Advanced configuration
config = tiledbvcf.ReadConfig(
memory_budget=4096,
tiledb_config={
"sm.tile_cache_size": "1000000000",
"vfs.s3.region": "us-east-1"
}
)
Resources
Getting Help
Open Source TileDB-VCF Resources
Open Source Documentation:
- TileDB Academy: https://cloud.tiledb.com/academy/
- Population Genomics Guide: https://cloud.tiledb.com/academy/structure/life-sciences/population-genomics/
- TileDB-VCF GitHub: https://github.com/TileDB-Inc/TileDB-VCF
TileDB-Cloud Resources
For Large-Scale/Production Genomics:
- TileDB-Cloud Platform: https://cloud.tiledb.com
- TileDB Academy (All Documentation): https://cloud.tiledb.com/academy/
Getting Started:
- Free account signup: https://cloud.tiledb.com
- Contact: sales@tiledb.com for enterprise needs
Scaling to TileDB-Cloud
When your genomics workloads outgrow single-node processing, TileDB-Cloud provides enterprise-scale capabilities for production genomics pipelines.
Note: This section covers TileDB-Cloud capabilities based on available documentation. For complete API details and current functionality, consult the official TileDB-Cloud documentation and API reference.
Setting Up TileDB-Cloud
1. Create Account and Get API Token
# Sign up at https://cloud.tiledb.com
# Generate API token in your account settings
2. Install TileDB-Cloud Python Client
# Base installation
pip install tiledb-cloud
# With genomics-specific functionality
pip install tiledb-cloud[life-sciences]
3. Configure Authentication
# Set environment variable with your API token
export TILEDB_REST_TOKEN="your_api_token"
import tiledb.cloud
# Authentication is automatic via TILEDB_REST_TOKEN
# No explicit login required in code
Migrating from Open Source to TileDB-Cloud
Large-Scale Ingestion
# TileDB-Cloud: Distributed VCF ingestion
import tiledb.cloud.vcf
# Use specialized VCF ingestion module
# Note: Exact API requires TileDB-Cloud documentation
# This represents the available functionality structure
tiledb.cloud.vcf.ingestion.ingest_vcf_dataset(
source="s3://my-bucket/vcf-files/",
output="tiledb://my-namespace/large-dataset",
namespace="my-namespace",
acn="my-s3-credentials",
ingest_resources={"cpu": "16", "memory": "64Gi"}
)
Distributed Query Processing
# TileDB-Cloud: VCF querying across distributed storage
import tiledb.cloud.vcf
import tiledbvcf
# Define the dataset URI
dataset_uri = "tiledb://TileDB-Inc/gvcf-1kg-dragen-v376"
# Get all samples from the dataset
ds = tiledbvcf.Dataset(dataset_uri, tiledb_config=cfg)
samples = ds.samples()
# Define attributes and ranges to query on
attrs = ["sample_name", "fmt_GT", "fmt_AD", "fmt_DP"]
regions = ["chr13:32396898-32397044", "chr13:32398162-32400268"]
# Perform the read, which is executed in a distributed fashion
df = tiledb.cloud.vcf.read(
dataset_uri=dataset_uri,
regions=regions,
samples=samples,
attrs=attrs,
namespace="my-namespace", # specifies which account to charge
)
df.to_pandas()
Enterprise Features
Data Sharing and Collaboration
# TileDB-Cloud provides enterprise data sharing capabilities
# through namespace-based permissions and group management
# Access shared datasets via TileDB-Cloud URIs
dataset_uri = "tiledb://shared-namespace/population-study"
# Collaborate through shared notebooks and compute resources
# (Specific API requires TileDB-Cloud documentation)
Cost Optimization
- Serverless Compute: Pay only for actual compute time
- Auto-scaling: Automatically scale up/down based on workload
- Spot Instances: Use cost-optimized compute for batch jobs
- Data Tiering: Automatic hot/cold storage management
Security and Compliance
- End-to-end Encryption: Data encrypted in transit and at rest
- Access Controls: Fine-grained permissions and audit logs
- HIPAA/SOC2 Compliance: Enterprise security standards
- VPC Support: Deploy in private cloud environments
When to Migrate Checklist
✅ Migrate to TileDB-Cloud if you have:
- [ ] Datasets > 1000 samples
- [ ] Need to process > 100GB of VCF data
- [ ] Require distributed computing
- [ ] Multiple team members need access
- [ ] Need enterprise security/compliance
- [ ] Want cost-optimized serverless compute
- [ ] Require 24/7 production uptime
Getting Started with TileDB-Cloud
- Start Free: TileDB-Cloud offers free tier for evaluation
- Migration Support: TileDB team provides migration assistance
- Training: Access to genomics-specific tutorials and examples
- Professional Services: Custom deployment and optimization
Next Steps:
- Visit https://cloud.tiledb.com to create account
- Review documentation at https://cloud.tiledb.com/academy/
- Contact sales@tiledb.com for enterprise needs