bfabric-query

Query and trace lineage of projects, samples, and datasets in B-Fabric LIMS.

Updated May 28, 2026
One-click install
npx skills add https://github.com/cpanse/skills --skill bfabric-query-cpanse
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bfabric-query
Source: https://github.com/cpanse/skills/tree/main/bfabric-lims/skills/bfabric-query
Command: npx skills add https://github.com/cpanse/skills --skill bfabric-query-cpanse

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires bfabric, and includes scripts (resource) and references (resource) components.

What problem does it solve? Navigating B-Fabric LIMS to find projects, samples, workunits, and datasets requires knowing the correct API endpoints, relationship fields, and query patterns, which is error-prone and slow when done manually. ## Core Features & Use Cases - Interactive Queries: Search projects, orders, samples, workunits, datasets, and resources via bfabricPy with correct relationship traversal (e.g., workunits use containerid, not projectid). - Lineage Tracing: Trace datasets upstream to source samples, list workunit outputs, and find downstream analyses for a given sample. - Metadata Export: Generate project summaries, sample sheets, and resource listings in Markdown, CSV, TSV, or JSON formats. - Use Case: A bioinformatician needs to find all BAM files in project p31662 and export a sample sheet for order 39391; the skill provides ready-made scripts and query patterns to accomplish both in minutes. ## Quick Start Ask the agent to find all samples and workunits for B-Fabric project 31662 and export a project summary report.

Frequently Asked Questions about bfabric-query

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query samples in B-Fabric LIMS with Python?

Use bfabricPy's read method with the sample endpoint and an orderid filter, such as bf.read('sample', {'orderid': 39391}).to_list_dict(). Samples belong to orders, not directly to projects, so query orders first when starting from a project.

How to trace dataset lineage in B-Fabric?

Run the trace_lineage.py script with a dataset ID to recursively follow input datasets back through producing workunits. The LineageTracer class reads each dataset's workunitid and the workunit's inputdatasetids to build the upstream chain.

Why does my B-Fabric workunit query return empty results?

Workunits link to projects via the containerid field, not projectid, so querying with projectid returns nothing. Also verify the ID type and check that your credentials in ~/.bfabricpy.yml are valid for the PRODUCTION environment.

How do I handle B-Fabric query timeouts on large result sets?

Implement pagination using BFABRIC_QUERY_LIMIT from bfabric.utils.paginator, looping with offset and limit parameters until an empty batch is returned. This avoids timeouts when fetching all workunits or resources in large projects.

Can I export B-Fabric metadata to CSV or Markdown?

Yes, the export_metadata.py script exports project summaries, sample sheets, and workunit resource lists in Markdown, CSV, TSV, or JSON formats. Specify the object ID, format, and optional output file via command-line arguments.