labqc-cli
日本語版 README はこちら (README_JA.md)
Zero-dependency, offline-first CLI auditor, built-in stdio MCP server, and Agent Skill for wet-lab CSV/TSV datasets, qPCR plates, calibration curves, and Excel gene-name date corruption.
labqc inspects experimental tables locally in milliseconds—using Python standard library only—and provides both an Agent-First CLI (--format json, --quiet, deterministic exit codes 0/1/2), a built-in JSON-RPC 2.0 MCP server (labqc mcp / labqc-mcp), and a single-file HTML report (pure inline SVG charts, zero external CDNs).
Why labqc-cli?
Every wet-lab spreadsheet fails in predictable ways right before manuscript submission or AI pipeline handoff:
- Excel gene-name date corruption:
MARCH1becomes1-Mar/March-1/3月1日,SEPT2becomes2-Sep/Sept-2,DEC1becomes1-Dec, and2310009E13becomes2.31E+13. - Mixed measurement units: Someone records
0.025 ug/mLin ang/mLcolumn, or enters a1,000xprefix slip. - Hidden qPCR & calibration issues: Missing NTC controls (
QPCR_MISSING_NTC), NTC amplification (Ct < 35), Ct outliers (QPCR_CT_OUTLIER), replicateSD > 0.5(MIQE threshold), non-monotonic standard curves, or extrapolated unknowns. - Silent encoding & delimiter traps: Japanese Excel
Shift_JIS / CP932, UTF-8/UTF-16 BOMs, jagged unquoted commas, or duplicateSample_IDrows. - Data governance blocks: You cannot upload unpublished experimental or clinical cohorts to cloud SaaS validators.
labqc runs 100% offline with zero third-party pip dependencies, launches in under 1 second, and never makes any outbound network request.
Quick Start (1-Line Install & Instant Demo)
pip install labqc-cli
Or run directly with uv:
uvx --from labqc-cli labqc demo --format json
Try the synthetic wet-lab demo and generate an HTML report + cleaned CSV:
labqc demo --out demo_report.html --clean-out demo_cleaned.csv
Audit your own experimental file (human report or machine-readable agent JSON):
# Human-readable report + cleaned UTF-8 CSV
labqc audit experiment_results.csv --out qc_report.html --clean-out experiment_clean.csv
# Agent-first JSON audit (writes zero extra HTML files unless --out is passed)
labqc audit experiment_results.csv --format json --strict
Use as an Offline MCP Server (Claude Desktop / Cursor)
labqc-cli v0.2 includes a zero-dependency JSON-RPC 2.0 stdio MCP server (labqc mcp / labqc-mcp) exposing three offline tools:
audit_lab_table: Audits CSV/TSV files or inlinecsv_textfor gene-date corruption, mixed units, missingness, IQR/MAD outliers, batch shifts, and formula injection.audit_qpcr_plate: Enforces MIQE plate QC (QPCR_MISSING_NTC,QPCR_NTC_CONTAMINATION,QPCR_CT_OUTLIER,QPCR_INVALID_CT,QPCR_HIGH_REPLICATE_SD).generate_qc_html_report: Writes a self-contained zero-CDN HTML report (with optional UTF-8 cleaned CSV).
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"labqc": {
"command": "uvx",
"args": ["--from", "labqc-cli", "labqc-mcp"]
}
}
}
Cursor (.cursor/mcp.json)
{
"mcpServers": {
"labqc": {
"command": "labqc",
"args": ["mcp"]
}
}
}
Agent Skill Package (skills/labqc/SKILL.md)
Ready for Claude Code, Cursor, Antigravity, and skills-hub.ai — copy skills/labqc/ into your workspace or global skills directory (.claude/skills/labqc/ or .gemini/skills/labqc/).
Before & After: What labqc Catches Automatically
| Raw Spreadsheet Trap | What labqc Detects & Reports |
Action Taken in --clean-out CSV |
|---|---|---|
1-Mar, March-1, 3月1日, 2-Sep, 2.31E+13 in gene_symbol |
CRITICAL EXCEL_GENE_DATE_CORRUPTION with suggested symbols (MARCH1/MARCHF1, SEPT2/SEPTIN2, DEC1, OCT4) |
Never silently guessed/overwritten — preserved intact and tagged in labqc_flags for scientist review |
12.5 ng/mL mixed with 0.025 ug/mL |
CRITICAL MIXED_UNITS across concentration / molarity / mass / volume / time |
Safely converts 0.025 ug/mL -> 25 ng/mL and logs conversion |
#DIV/0!, NA, nd, Undetermined, Inf, NaN |
Flags non-finite values (NON_FINITE_VALUES) & Excel errors (EXCEL_ERROR_TOKENS) |
Normalizes missing placeholders to empty cells ("") cleanly |
Plate_1 vs Plate_2 shift |
WARNING BATCH_SHIFT_DETECTED (one-way ANOVA $F$, $\eta^2$, Kruskal–Wallis $H$) |
Flags batch shift in terminal, JSON, and SVG batch comparison chart |
Missing NTC, NTC Ct = 31.4, Ct outlier, replicate SD > 0.5 |
CRITICAL / WARNING MIQE qPCR alerts (QPCR_MISSING_NTC, QPCR_NTC_CONTAMINATION, QPCR_CT_OUTLIER, QPCR_HIGH_REPLICATE_SD) |
Highlighted in dedicated qPCR panel and JSON summary |
=cmd|'/C calc'!A0 formula strings |
WARNING CSV_FORMULA_INJECTION |
Neutralized with leading ' when --neutralize-formulas is enabled |
Japanese Excel CP932 / UTF-8 BOM / UTF-16 |
Auto-detected encoding (cp932, utf-8-sig, utf-16, utf-8, latin-1) |
Re-encoded safely to portable UTF-8 CSV |
Agent-First CLI Usage & Deterministic Exit Codes
labqc audit INPUT [--out REPORT.html] [--clean-out CLEAN.csv] [--json-out AUDIT.json]
[--mode auto|general|qpcr|curve] [--id-col COL] [--batch-col COL]
[--delimiter DELIM] [--lang en|ja] [--format text|json] [--quiet]
[--neutralize-formulas] [--strict]
labqc demo [--scenario all|qpcr|curve] [--out DEMO.html] [--clean-out CLEAN.csv]
[--json-out AUDIT.json] [--lang en|ja] [--format text|json] [--quiet]
[--neutralize-formulas] [--strict]
labqc mcp # Start JSON-RPC 2.0 stdio MCP server (alias: labqc-mcp)
labqc version # Print version (--format json supported)
Exit Code Contract
0: Audit completed cleanly (or withoutCRITICALblockers when--strictis omitted).1: Argument, input file, directory collision, or I/O error (all errors emit cause + copy-pasteFix command).2: One or moreCRITICALfindings detected under--strict.
Python API
from pathlib import Path
from labqc import audit_file
report = audit_file(Path("experiment_results.csv"))
print(report.score, report.grade, report.critical_count)
Features Inside Every Single-File HTML Report
- Quality Scorecard (0–100, Grade A–F): Transparent deduction across structural, statistical, and biological checks.
- Prioritized Action Checklist: Sorted
CRITICAL->WARNING->INFOwith row numbers, examples, and exact remediation guidance. - Pure Inline SVG Visualizations: Missingness bar chart, per-column numeric histograms (with median & 1.5x IQR outlier fences), batch median comparison SVG, and calibration curve scatter + OLS fit SVG.
- Zero External Requests: Zero JavaScript frameworks, zero Google Fonts, zero external CDNs. Opens cleanly in air-gapped labs and prints cleanly to PDF.
- Bilingual UI: Supports
--lang en(default) and--lang ja.
Development & Running Tests
git clone https://github.com/kaneko-ai/labqc-cli.git
cd labqc-cli
uv run --with pytest pytest -v
uv build
Research Use Only (RUO) & License
- License: MIT License
- Research Use Only (RUO):
labqc-cliis provided strictly for research data quality auditing and statistical education. It is not intended for clinical diagnosis, treatment decisions, patient management, or regulatory (FDA / IVD / GLP / 21 CFR Part 11) validation.
Need a local desktop GUI for flow cytometry, statistics, and publication-ready figures? AutoTool Lab Complete Lab Suite (https://autotool-lab-showcase.kanekiti1125.workers.dev/)
Metadata
Release files for labqc-cli 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| labqc_cli-0.2.1.tar.gz | 80.1 kB | Without provenance | Details for labqc_cli-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| labqc_cli-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for labqc_cli-0.2.1-py3-none-any.whl |
Total release size: 140.6 kB
Release files / labqc_cli-0.2.1.tar.gz
| Download URL | labqc_cli-0.2.1.tar.gz |
|---|---|
| Size | 80.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ec454782f66293ac35948ab21dda4e26abc7a16b6f47224ba9d2945a1b35b733
|
|
BLAKE2b-256 checksum How to use checksums |
0c525d54214e028dca2f044732775248df695127f4fe4ce7fe7ed41ce62bcefc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / labqc_cli-0.2.1-py3-none-any.whl
| Download URL | labqc_cli-0.2.1-py3-none-any.whl |
|---|---|
| Size | 60.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
069d7b77839fac7a355039b8a79e8d5089965f2e5477e02853e9e5e15429d32e
|
|
BLAKE2b-256 checksum How to use checksums |
7b43abfa73ec57373663ede7b340eda83dc52828de5b16e68aa478491d077dc5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for labqc-cli 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.