Skip to main content

Experimental-design-aware quality control for sequencing analysis sample sheets.

Project description

MetaSheet-Guard

Documentation website | Repository

MetaSheet-Guard performs experimental-design-aware quality control for sequencing analysis sample sheets. It targets the analysis-preparation stage: after FASTQ generation or public metadata collection, but before running workflows such as Nextflow, Snakemake, nf-core/rnaseq, or custom RNA-seq pipelines.

The current package includes CSV/TSV reading, bundled YAML schemas, validation, repair provenance, workflow export, JSON/HTML reports, and a metasheet-guard CLI.

Scope

MetaSheet-Guard is being built to model relationships between biological samples, sequencing runs, lanes, FASTQ files, replicates, conditions, batches, and downstream workflow requirements. The current release is intentionally small and currently supports these first-pass capabilities:

  • required columns
  • duplicate column names
  • schema-defined column aliases
  • empty values in required columns
  • sample ID and metadata consistency checks
  • FASTQ path, extension, gzip, pair, and duplication checks
  • sample/run/lane relationship checks
  • batch-condition and related design-risk checks
  • safe repair with changes.json provenance
  • nf-core/rnaseq, Snakemake, canonical CSV, and DESeq2 design exports
  • bundled generic-ngs and bulk-rnaseq schemas

Non-goals

MetaSheet-Guard is not an RNA-seq aligner, quantifier, differential expression tool, SRA downloader, nf-core/fetchngs replacement, nf-schema replacement, Illumina BCL Convert or bcl2fastq SampleSheet validator, single-cell object validator, spatial image validator, or generic CSV validation framework.

Installation

pip install -e ".[dev]"

Quickstart

Validate a broken bulk RNA-seq sample sheet and write a JSON report:

metasheet-guard check examples/broken/missing_required_column.csv \
  --schema bulk-rnaseq \
  --json report.json

The command exits with status code 1 when blocking validation errors are found. For the example above, report.json contains a REQUIRED_COLUMN_MISSING issue because the bulk-rnaseq schema requires a condition column.

Validate a minimal valid example:

metasheet-guard check examples/valid/bulk_rnaseq_paired.csv \
  --schema bulk-rnaseq

Repair safe metadata issues and record provenance:

metasheet-guard repair examples/broken/condition_case_mixed.csv \
  --schema bulk-rnaseq \
  --out clean.csv \
  --changes changes.json

Only safe repairs are implemented. Suggested/inference-based repairs are reserved for later milestones and currently fail clearly if requested.

Export a cleaned sheet:

metasheet-guard export examples/valid/bulk_rnaseq_paired.csv \
  --target nf-core-rnaseq \
  --out nfcore_samplesheet.csv

Python API

from metasheet_guard import read_sheet, validate

sheet = read_sheet("examples/broken/missing_required_column.csv")
result = validate(sheet, schema="bulk-rnaseq")

for issue in result.issues:
    print(issue.severity, issue.code, issue.message)

Development

Run tests and linting:

pytest
ruff check .

The project uses src/ packaging, Typer for the command-line interface, PyYAML for schemas, pytest for tests, and Ruff for linting.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metasheet_guard-0.1.0.tar.gz (30.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metasheet_guard-0.1.0-py3-none-any.whl (38.3 kB view details)

Uploaded Python 3

File details

Details for the file metasheet_guard-0.1.0.tar.gz.

File metadata

  • Download URL: metasheet_guard-0.1.0.tar.gz
  • Upload date:
  • Size: 30.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for metasheet_guard-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a45e11b4e06686f57b37cf504ef87cdcb85ddb2b85abff4942d7529cfcdfd131
MD5 565d56a444914c1b8d2b9020b4784a83
BLAKE2b-256 a822fcabd434602f744c7108e041e6a2ef3d8f5055b63c10f434fcb6a79b2278

See more details on using hashes here.

Provenance

The following attestation bundles were made for metasheet_guard-0.1.0.tar.gz:

Publisher: release.yml on qchiujunhao/metasheet-guard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metasheet_guard-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: metasheet_guard-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 38.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for metasheet_guard-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 edf941002879245141473daaadf9f9c877374089a4304a50dfa54099edbf59a1
MD5 911218d18553809d93730c4d14b311df
BLAKE2b-256 8c4d172377ca58c6fb70cbf1482e683bd34fbbe045215abae8006b6c6da26dc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for metasheet_guard-0.1.0-py3-none-any.whl:

Publisher: release.yml on qchiujunhao/metasheet-guard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page