From bfabric-lims
Interactive query and exploration toolkit for B-Fabric LIMS. This skill should be used when searching for projects, samples, datasets, or workunits; tracing data lineage and provenance; exploring relationships between B-Fabric objects; generating reports and metadata exports; or performing bulk queries and comparisons on FGCZ infrastructure.
How this skill is triggered — by the user, by Claude, or both
Slash command
/bfabric-lims:bfabric-queryThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Query, explore, and trace lineage in B-Fabric LIMS. For dataset registration and resource management, use `bfabric-tools` instead.
Query, explore, and trace lineage in B-Fabric LIMS. For dataset registration and resource management, use bfabric-tools instead.
conda activate gi_py3.11.5
Credentials in ~/.bfabricpy.yml:
PRODUCTION:
login: your_username
password: your_password
base_url: https://fgcz-bfabric.uzh.ch/bfabric
from bfabric import Bfabric
bf = Bfabric.from_config()
# Projects
project = bf.read('project', {'id': 31662}).to_list_dict()[0]
projects = bf.read('project', {'name': 'UM_Atlas'}).to_list_dict()
# Orders and Samples
orders = bf.read('order', {'projectid': 31662}).to_list_dict()
samples = bf.read('sample', {'orderid': 39391}).to_list_dict()
sample = bf.read('sample', {'id': 393911}).to_list_dict()[0]
# Workunits and Datasets
workunits = bf.read('workunit', {'containerid': 31662}).to_list_dict()
datasets = bf.read('dataset', {'workunitid': 108483}).to_list_dict()
resources = bf.read('resource', {'datasetid': 123456}).to_list_dict()
# Applications
apps = bf.read('application', {'name': 'CellRangerCount'}).to_list_dict()
Key relationships (query field in parentheses):
projectid)orderid)containerid, NOT projectid!)workunitid)datasetid)# Full traversal example
project_id = 31662
orders = bf.read('order', {'projectid': project_id}).to_list_dict()
for order in orders:
samples = bf.read('sample', {'orderid': order['id']}).to_list_dict()
print(f"Order {order['name']}: {len(samples)} samples")
See references/lineage-tracing.md for detailed lineage functions.
# gStore → SUSHI download URL
gstore_path = "/srv/gstore/projects/p31662/data.bam"
sushi_url = gstore_path.replace('/srv/gstore/projects/', 'https://fgcz-sushi.uzh.ch/projects/')
# gStore → exploreSC Shiny URL
seurat_path = "/srv/gstore/projects/p33974/neurons.qs2"
shiny_url = f"https://fgcz-shiny.uzh.ch/app/exploreSC/?data={seurat_path.replace('/srv/gstore/projects/', '')}"
Standard paths:
/srv/gstore/projects/pXXXXX//srv/GT/analysis/pXXXXX//srv/GT/reference/# Trace dataset lineage
python scripts/trace_lineage.py --dataset 123456
# Trace workunit outputs
python scripts/trace_lineage.py --workunit 108483
# Export project summary
python scripts/export_metadata.py --project 31662 --format markdown -o report.md
# Export sample sheet
python scripts/export_metadata.py --order 39391 --format tsv -o samples.tsv
from quick_query import find_project, get_order_samples, summarize_project
from trace_lineage import LineageTracer
from export_metadata import MetadataExporter
# Find projects
projects = find_project("UM")
# Get samples
samples = get_order_samples(39391)
# Trace lineage
tracer = LineageTracer()
lineage = tracer.trace_dataset_upstream(dataset_id=123456)
# Export
exporter = MetadataExporter()
markdown = exporter.export_project_summary(31662, format='markdown')
| Endpoint | Query Keys | Description |
|---|---|---|
project | id, name, userlogin | Project metadata |
order | id, projectid | Order details |
sample | id, orderid, containerid | Sample metadata |
workunit | id, containerid, applicationid | Analysis workunits |
dataset | id, workunitid | Dataset information |
resource | id, workunitid, datasetid, relativepath | File resources |
application | id, name | SUSHI applications |
annotation | objectid + classname | Comments/notes |
Workunit: pending, processing, available, failed
Resource: available, archived, deleted
For dataset registration and resource management, use the bfabric-tools skill.
npx claudepluginhub cpanse/skills --plugin bfabric-limsGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.