Best for
- Query JGI genomics metadata (GOLD, IMG, Mycocosm, Phytozome)
- Find genomes and/or metagenomes by taxonomy, ecosystem, or phenotype.
- Download microbial genomes with IMG taxon OIDs
fmschulz/omics-skills/skills/jgi-lakehouse/SKILL.md
Query JGI Lakehouse metadata and retrieve JGI genome or read files. Use when linking GOLD, IMG, MycoCosm, Phytozome, PMO, or JAMO identifiers and datasets.
Decision brief
Query JGI Lakehouse metadata and retrieve JGI genome or read files.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/fmschulz/omics-skills --skill "skills/jgi-lakehouse"Inspect the Agent Skill "jgi-lakehouse" from https://github.com/fmschulz/omics-skills/blob/2703ad88739298766b597d097f77970b6066b536/skills/jgi-lakehouse/SKILL.md at commit 2703ad88739298766b597d097f77970b6066b536. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What is it? JGI's unified data warehouse (651 tables) + filesystem access to genome files.
1. Decide whether the task needs metadata, files, or read recovery. 2. Use Lakehouse SQL for metadata/annotations and the JGI filesystem or JAMO for sequence files. 3. Inspect schemas with a small LIMIT; remove LIMIT for complete results. 4. Record source, table, fields, filters…
Use NUMG when the task is metagenome protein sequence/domain analysis.
Query JGI genomics metadata (GOLD, IMG, Mycocosm, Phytozome)
Review the “Quick Reference” section in the pinned source before continuing.
Permission review
The documentation asks the agent to read local files, directories, or repositories.
Provenance covering database, tables, filters, access route, and file paths.The documentation asks the agent to read local files, directories, or repositories.
### 6. Inspect and fetch the actual fileThe documentation includes network, browsing, or remote request actions.
-with "dremio-flight @ https://github.com/dremio-hub/arrow-flight-client-examples/releases/download/dremio-flight-python-v1.1.0/dremio_flight-1.1.0-py3-none-any.whl" \Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 7 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
What is it? JGI's unified data warehouse (651 tables) + filesystem access to genome files.
Two data access methods:
SQL Dialect: ANSI SQL (not PostgreSQL)
CAST(x AS type) not ::REGEXP_LIKE() not ~"gold-db-2 postgresql"-- Quick test
SELECT gold_id, project_name FROM "gold-db-2 postgresql".gold.project
WHERE is_public = 'Yes' LIMIT 5;
LIMIT; remove LIMIT for complete results.| Task | Action |
|---|---|
| Test Lakehouse | Query "gold-db-2 postgresql".gold.project |
| Query IMG metadata | Use "img-db-2 postgresql".img_core_v400.* tables |
| Query NUMG proteins | Join faa and gene2pfam on both oid and gene_oid |
| Download IMG genome | Copy {taxon_oid}.tar.gz from /clusterfs/jgi/img_merfs-ro/img_web/img_web_data/download/ |
| Link reads | Start with jamo info all pmoid <img_jgi_project_id> |
DREMIO_PAT for SQL; filesystem/JAMO access for files or reads.DREMIO_REQUEST_TIMEOUT (per request, default 60 seconds), DREMIO_JOB_TIMEOUT (whole query, default 300 seconds), IMG_DOWNLOAD_DIR, and IMG_DATA_DIR.REQUESTS_CA_BUNDLE for the Python clients or DREMIO_CA_BUNDLE for the token helper when the internal endpoint requires a local CA certificate.LIMIT clauses.oid + gene_oid for NUMG.See examples/04-download-img-genomes.md and examples/05-query-numg-metagenome-proteins.md.
Issue: Metadata query returns no sequence files. Solution: Use filesystem, portal downloadRequestFiles, or JAMO.
Issue: Final answer is based on 50 or 100 rows. Solution: Remove exploratory limits or use aggregation.
Issue: Dremio HTTPS fails with certificate verification errors on the internal endpoint. Solution: Configure the JGI CA bundle. Do not disable certificate verification.
| Need | Source | Access Method |
|---|---|---|
| Metadata (taxonomy, projects) | Lakehouse | SQL via REST API |
| Gene annotations (COG, Pfam, KO) | Lakehouse | SQL via REST API |
| Genome sequences (FNA) | JGI Filesystem | Copy from /clusterfs/jgi/img_merfs-ro/ |
| Protein sequences (FAA) | JGI Filesystem | Copy from /clusterfs/jgi/img_merfs-ro/ |
| Metagenome proteins only | Lakehouse | numg-iceberg.faa table |
Critical insight: The Lakehouse is a METADATA warehouse. Genome sequences must be accessed from the JGI filesystem.
| Source | Path | Contents |
|---|---|---|
| GOLD | "gold-db-2 postgresql".gold.* | Projects, studies, samples, taxonomy |
| IMG | "img-db-2 postgresql".img_core_v400.* | Taxons, genes, annotations (244 tables) |
| Portal | "portal-db-1".portal.* | Download tracking, file paths |
| Mycocosm | "myco-db-1 mysql".<organism>.* | Fungal genomes (2,711 schemas) |
| Phytozome | "plant-db-7 postgresql".* | Plant genomics — see docs/phytozome.md |
| NUMG | "numg-iceberg"."numg-iceberg".* | Metagenome proteins, Pfam hits |
Full table catalog: See docs/data-catalog.md
Phytozome (plant-db-7 / plant-db-4): Read docs/phytozome.md before writing any queries against these sources.
Use NUMG when the task is metagenome protein sequence/domain analysis.
Scope rules:
numg-iceberg is metagenome-focused.Core tables:
"numg-iceberg"."numg-iceberg".faa
oid, gene_oid, faa (protein sequence)"numg-iceberg"."numg-iceberg".gene2pfam
oid, gene_oid, pfam, evalue, alignment coordinate fieldsRecommended query flow:
-- 1) Confirm available NUMG tables
SHOW TABLES IN "numg-iceberg"."numg-iceberg";
-- 2) Inspect schema before writing joins/filters
DESCRIBE "numg-iceberg"."numg-iceberg".faa;
DESCRIBE "numg-iceberg"."numg-iceberg".gene2pfam;
-- 3) Domain filter (use exact lowercase pfam IDs)
SELECT oid, gene_oid, pfam, evalue
FROM "numg-iceberg"."numg-iceberg".gene2pfam
WHERE pfam IN ('pfam00001', 'pfam00004')
LIMIT 100;
-- 4) Join domains to protein sequences
SELECT
p.oid,
p.gene_oid,
p.pfam,
p.evalue,
f.faa
FROM "numg-iceberg"."numg-iceberg".gene2pfam p
JOIN "numg-iceberg"."numg-iceberg".faa f
ON p.oid = f.oid
AND p.gene_oid = f.gene_oid
WHERE p.pfam = 'pfam00001'
LIMIT 100;
Important NUMG rules:
oid and gene_oid (not gene_oid alone).pfam00001, not case-transformed).LIMIT and expand only after verifying row shape.See also: examples/05-query-numg-metagenome-proteins.md
# Genome packages are at:
/clusterfs/jgi/img_merfs-ro/img_web/img_web_data/download/{taxon_oid}.tar.gz
# Put these commands in a small-job sbatch allocation; do not run them on a login node.
cp /clusterfs/jgi/img_merfs-ro/img_web/img_web_data/download/8136918376.tar.gz .
tar -xzf 8136918376.tar.gz
Package contents:
{taxon_oid}.fna - Genome assembly{taxon_oid}.genes.faa - Protein sequences{taxon_oid}.genes.fna - Gene nucleotide sequences{taxon_oid}.gff - GFF annotations{taxon_oid}.cog.tab.txt - COG annotations{taxon_oid}.pfam.tab.txt - Pfam annotations{taxon_oid}.ko.tab.txt - KEGG KO annotationsUse this workflow when you need to go from an IMG metagenome assembly to the underlying JGI reads.
Assemblies live under:
/clusterfs/jgi/img_merfs-ro/img_web_data_merfs/{taxon_oid}/assembled/
For a metagenome taxon OID, the most useful linkage fields are:
img_jgi_project_idsequencing_gold_idsample_gold_idstudy_gold_idgold_project_idgold_pmo_project_idgold_its_spidIn practice, img_jgi_project_id is often the strongest key for JAMO because it behaves like the PMO project identifier used by jamo info ... pmoid.
pmoid for JGI read lookupNative JAMO lookup types are listed by:
apptainer run docker://doejgi/jamo-dori:latest jamo info help
For legacy JGI metagenomes, this usually works better than raw_normal spid:
apptainer run docker://doejgi/jamo-dori:latest \
jamo info all pmoid <img_jgi_project_id>
If you only want FASTQ rows, filter the output:
apptainer run docker://doejgi/jamo-dori:latest \
jamo info all pmoid <img_jgi_project_id> | rg 'fastq(\\.gz)?'
This queries JAMO by the IMG taxon OID embedded in metadata:
apptainer run docker://doejgi/jamo-dori:latest \
jamo info all custom '{"metadata.gold_data.img_oid": 3300000030, "file_name": {"$regex": ".*fastq(\\\\.gz)?$"}}'
This can recover reads even when the older spid route is blank, but in recent re-audits pmoid recovered many more JGI rows.
spid is valid, but not sufficientIf you already have a verified sequencing project ID, this is still worth trying:
apptainer run docker://doejgi/jamo-dori:latest \
jamo info raw_normal spid <gold_its_spid>
But do not stop there. In several JGI cases:
raw_normal spid returned nothingall pmoid <img_jgi_project_id> returned usable FASTQ recordsInspect one metadata record:
apptainer run docker://doejgi/jamo-dori:latest jamo show <metadata_id>
Fetch a file by filename:
apptainer run docker://doejgi/jamo-dori:latest \
jamo fetch -s dori all filename <file_name>
That prints the staged scratch path, typically under:
/clusterfs/jgi/scratch/dsi/...
Important:
RESTORED, you can use the staged path immediatelyPURGED, jamo fetch only starts the restore; you must wait until the staged path exists and has non-zero size before using itBounded wait pattern:
staged_file=/clusterfs/jgi/scratch/dsi/.../file.fastq.gz
timeout 30m bash -c \
'until [[ -s "$1" ]]; do sleep 10; done' _ "$staged_file"
For JGI metagenome read recovery, use this priority:
jamo info all pmoid <img_jgi_project_id>jamo info all custom '{"metadata.gold_data.img_oid": ...}'jamo info raw_normal spid <gold_its_spid>Do not assume "no reads" until all three have been checked. Do not assume a fetched file is ready until the staged path is actually restored.
The portal tracks downloadable files for Mycocosm and Phytozome in
"portal-db-1".portal.downloadRequestFiles. Use filePath to copy data
from the JGI filesystem (/global/dna/dm_archive/...).
Mycocosm (fungal genomes/proteins):
SELECT filePath, fileType
FROM "portal-db-1".portal.downloadRequestFiles
WHERE LOWER(filePath) LIKE '%mycocosm%'
AND (filePath LIKE '%.fasta%' OR filePath LIKE '%.fa%' OR filePath LIKE '%.faa%')
LIMIT 20;
Phytozome (plant genomes/proteins):
SELECT filePath, fileType
FROM "portal-db-1".portal.downloadRequestFiles
WHERE LOWER(filePath) LIKE '%phytozome%'
AND (filePath LIKE '%.fa%' OR filePath LIKE '%.fna%' OR filePath LIKE '%.faa%')
LIMIT 20;
Download from filesystem:
cp /global/dna/dm_archive/<path/from-filePath> .
Notes:
fileType typically includes Assembly, Annotation, or Sequence.virtualPath can provide a user-facing download label but filePath is the real location.-- Get count of all finished bacterial isolates
SELECT COUNT(DISTINCT taxon_oid) as total_isolates
FROM "img-db-2 postgresql".img_core_v400.taxon
WHERE domain = 'Bacteria'
AND genome_type = 'isolate'
AND is_public = 'Yes'
AND seq_status = 'Finished';
-- Get sample of isolates (if you need details)
SELECT taxon_oid, taxon_display_name, phylum, genus, species
FROM "img-db-2 postgresql".img_core_v400.taxon
WHERE domain = 'Bacteria'
AND genome_type = 'isolate'
AND is_public = 'Yes'
AND seq_status = 'Finished'
LIMIT 100;
SELECT COUNT(DISTINCT t.taxon_oid) as total_linked
FROM "img-db-2 postgresql".img_core_v400.taxon t
WHERE t.sequencing_gold_id IS NOT NULL;
SELECT COUNT(DISTINCT taxonOid) as total_tar_gz
FROM "portal-db-1".portal.downloadRequestFiles
WHERE taxonOid IS NOT NULL
AND filePath LIKE '%.tar.gz';
| Wrong | Correct |
|---|---|
Using LIMIT in complete queries | Remove LIMIT when answering actual questions; use COUNT() for aggregation |
Join ncbi_assembly on project_id | ncbi_assembly has no project_id; use bioproject or biosample |
project.ecosystem | Join study via master_study_id |
SHOW SCHEMAS IN "source" | Works, but some syntax errors in older Dremio |
| Get sequences from Lakehouse | Download from JGI filesystem |
sra_experiment_v2.platform | Use library_instrument |
gene_ko_terms = 'K00025' | Use gene_ko_terms = 'KO:K00025' |
Join NUMG on gene_oid only | Join on both oid and gene_oid |
| Case-normalizing large function tables | Use exact normalized values (pfam00001, COG1389, etc.) |
| Isolate benchmark counts vary | Add obsolete_flag = 'No' and is_public = 'Yes' |
IMG.gene_feature fails expansion | Fallback to "img-db-2 postgresql".img_core_v400.* tables |
show_schemas() misses sources | Use higher limit (e.g. show_schemas(limit=2000)) |
export DREMIO_PAT=$(cat ~/.secrets/dremio_pat)
Token setup: See docs/authentication.md
REST API Base: https://lakehouse-1.jgi.lbl.gov:9047/api/v3
# Use scripts/rest_client.py
from rest_client import query
results = query("SELECT * FROM ... LIMIT 10")
For higher-performance programmatic access, use Arrow Flight with Python.
uv run \
--with "dremio-flight @ https://github.com/dremio-hub/arrow-flight-client-examples/releases/download/dremio-flight-python-v1.1.0/dremio_flight-1.1.0-py3-none-any.whl" \
--with pyyaml \
example.py
Full guide: docs/arrow-flight-python.md
Frequently asked questions
Query JGI Lakehouse metadata and retrieve JGI genome or read files.
The source record exposes this install command: npx skills add https://github.com/fmschulz/omics-skills --skill "skills/jgi-lakehouse". Inspect the command and pinned source before running it.
Static rules flagged read-files, network in the source; the page lists the matching lines and excerpts.
Alternatives
K-Dense-AI/scientific-agent-skills
Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed use polars.
rampstackco/claude-skills
Running experiments out of the data warehouse instead of via dedicated experiment platforms. SQL-based assignment, exposure logging discipline, metric definitions in dbt models, statistical analysis in SQL or Python, variance reduction with CUPED, sequential testing, and the operational tradeoffs vs platforms like Statsig and Optimizely. Triggers on warehouse-native experimentation, run experiments in BigQuery, run experiments in Snowflake, dbt experiments, SQL t-test, CUPED variance reduction,
UiPath/skills
UiPath Coded Apps — scaffold, build, run, and deploy Coded Web Apps and Coded Action Apps: React/TypeScript apps that call UiPath Cloud APIs via the `@uipath/uipath-typescript` SDK and ship to Automation Cloud (push/pull to Studio Web, pack, publish, deploy, OAuth-PKCE). Also generates live analytics & governance dashboards from a plain-language request, wired to tenant data via the Insights real-time API, with edit and deploy flows. For RPA→uipath-rpa, Python agents→uipath-agents, Maestro flows
awslabs/agent-plugins
Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, diagnose cluster performance, load data, and develop applications with a serverless, distributed SQL database. Covers IAM auth, multi-tenant patterns, MySQL-to-DSQL and PostgreSQL-to-DSQL schema conversion, FK replacement code generation, OCC retry patterns, ORM migration (Django/EF Core/Hibernate/Rails), DDL operations, query plan explainability, system diagnostics via CloudWatch AAS, SQL compatib