Skip to content
Skills Library
Data & analytics · Building & coding

data-samplesheet-schema

/data-samplesheet-schema

Design and validate a sample sheet: TSV (CSV only by recorded decision or vendor format), sample column, n/a for empty, paths relative to the sheet, per-column nf-schema JSON Schema with pattern/errorMessage/meta, cross-row checks in a Python script, validated copy published. Use when adding or changing a pipeline input sheet or its schema_input.json.

Licence
MIT
Last repository change
11.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
2
Deprecation

No signals detected. Repository changed on 11.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Design and validate a sample sheet: TSV (CSV only by recorded decision or vendor format), sample column, n/a for empty, paths relative to the sheet, per-column nf-schema JSON Schema with pattern/errorMessage/meta, cross-row checks in a Python script, validated copy published. Use when adding or changing a pipeline input sheet or its schema_input.json.

Original author description

Design and validate a sample sheet: TSV (CSV only by recorded decision or vendor format), sample column, n/a for empty, paths relative to the sheet, per-column nf-schema JSON Schema with pattern/errorMessage/meta, cross-row checks in a Python script, validated copy published. Use when adding or changing a pipeline input sheet or its schema_input.json.

How it works

  1. Purpose
  2. When to use
  3. Steps
  4. Checks before finishing
  5. Pitfalls
Original SKILL.md headings · 52 lines, 394 words
SKILL.md preview
---
name: data-samplesheet-schema
description: 'Design and validate a sample sheet: TSV (CSV only by recorded decision or vendor format), sample column, n/a for empty, paths relative to the sheet, per-column nf-schema JSON Schema with pattern/errorMessage/meta, cross-row checks in a Python script, validated copy published. Use when adding or changing a pipeline input sheet or its schema_input.json.'
---

# Sample-sheet schema

## Purpose

One predictable, validated input sheet per workflow, with errors a biologist can act on.

## When to use

New or changed `assets/schema_input.json`, a new input sheet (samples, known variants,
strata), or sheet errors. Not for genomic content checks (`bioinformatics-agent`).

## Steps

1. Format: TSV with `.tsv`, header row, `sample` column, no whitespace in column names, values with spaces double-quoted, `n/a` for empty. If the project records CSV as a decision (or the format is vendor-defined), keep it and state this in `docs/usage.md`.
2. Layout: row-oriented by default; EAV (`sample`, `key`, `value`) only for long values, pivot downstream with `pivot_table()`.
3. Paths: relative to the sheet's directory, resolved by the pipeline; no index-file columns (use `.tbi`/`.bai` next to the file or create it).
4. Write `assets/schema_input.json` (draft 2020-12):
   ```json
   {"$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://raw.githubusercontent.com/<org>/<repo>/main/assets/schema_input.json",
    "title": "<repo> pipeline - params.input schema",
    "description": "Relative paths resolve against the sheet's directory; empty or 'n/a' marks an empty optional field.",
    "type": "array",
    "items": {"type": "object",
      "properties": {
        "sample": {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]*$",
                   "errorMessage": "sample must be given and use only A-Z a-z 0-9 _ . -",
                   "meta": ["sample"]},
        "technology": {"type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$", "meta": ["technology"]},
        "vcf": {"type": "string", "format": "file-path", "exists": true, "pattern": "^\\S+\\.vcf\\.gz$"}},
      "required": ["sample", "technology", "vcf"]}}
   ```
   Every property gets a pattern or enum plus an `errorMessage`.
5. Wire it with nf-schema `samplesheetToList(params.input, "assets/schema_input.json")`; the param is declared with `schema` in `nextflow_schema.json` (via `nf-core pipelines schema build`).
6. Cross-row rules (unique sample+technology, exactly one truth technology, tumor_id != normal_id, all rows reference the same genome build) go in `bin/<pipeline>_check-sheets.py`, which reads the sheet and prints `ERROR: <file>: row <n>: <field>: expected <x>, found <y>; fix: <hint>` and exits non-zero.
7. Treat `n/a` and empty as empty in both layers; do not let `n/a` reach tools as a path.
8. Publish the validated, path-resolved copy to `pipeline_info/samplesheet_validated.tsv`.
9. Provide a tiny valid example (synthetic IDs) in `assets/` and one failing example per rule for tests.

## Checks before finishing

- Example sheet passes; each failing example fails with the intended message.
- Docs list every column, allowed values, whether required.
- No real sample names in committed sheets.

## Pitfalls

- Regex on sample IDs that later breaks file names; allow only the CUBI file-name set.
- Embedding cross-row logic in the schema; keep it in the script.
- Absolute paths in committed sheets.

Versions

The database has no other skills named data-samplesheet-schema.

Database snapshot: 13.11.2026 · package version 81a731625bfa (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100csv-tools
    Inspect, filter, aggregate, and clean CSV/TSV data with Python. Use when users hand over a .csv/.tsv file or paste tabular data and want a quick look, column stats, filtering, sorting, deduping, group-by sums/counts, or cleanup — without needing a full spreadsheet. Triggers on…
  • 90clean-validate
    Design a data validation pipeline — schema checks, range validation, and quality metrics. Use when asked to "validate incoming data", "add schema checks", or "define data quality metrics".
  • 100data-raw-to-normalized-tables
    Turn a manually maintained table (Excel/CSV from a client or colleague) into clean TSV without touching the original: column map with aliases, normalization rules, a corrections table, an issues table, encoding fallback, strict assertions. Use when a pipeline reads a hand-edited…
  • 90data-file-ops
    Use when inspecting, cleaning, transforming, comparing, or summarizing local JSON, CSV, TSV, or text data files with minimal ceremony and reproducible outputs. Triggers: clean this CSV, transform JSON, diff these tables, summarize the data file.
  • 100portaljs-check-data-quality
    Audit a local or remote tabular file (CSV/TSV) for common data quality issues — schema, nulls, types, duplicates. Read-only. Use when a dataset needs a quality check before publishing, or a showcase renders wrong (blank cells, garbled numbers, an unsortable date column) and the…
  • 95ml4t-canonical-schema
    Standardized data schema across all financial datasets. Use when defining or enforcing column names, types, and index conventions.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.