Skip to content
Back to skills

Data Io Validation

ASecurity

"Prepare, load, orient, and validate PyDESeq2 count and metadata

  • 247 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 8, 2026
datapythonexpress

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill data-io-validation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Data Io Validation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Data Io Validation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-data-io-validation/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-data-io-validation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: data-io-validation
description: "Prepare, load, orient, and validate PyDESeq2 count and metadata
  inputs before differential expression modeling."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# Data I/O And Validation

Use this sub-skill when a task is about getting data into PyDESeq2 safely: reading count and metadata CSVs, fixing sample/gene orientation, checking design prerequisites, constructing a `DeseqDataSet`, or exporting fitted data as picklable `AnnData`.

## Read First

- `references/data-formats.md`: expected schemas, loading patterns, validation checklist, filtering, `AnnData`, and script recipes.
- `references/troubleshooting.md`: symptoms and recoveries for count, metadata, design, orientation, and local CSV problems.
- `scripts/validate_pydeseq2_inputs.py`: network-free validator for local CSVs and optional design matrices.
- `scripts/run_local_csv_dea.py`: local CSV adaptation of the pandas I/O example with optional synthetic data and optional tiny fit smoke.

## Core Rules

- Counts must be samples x genes: rows are sample ids, columns are gene ids, and values are numeric non-negative integers.
- Metadata must be samples x variables: its index must be the same sample ids, in the same order, as the count index before constructing `DeseqDataSet`.
- If counts arrive as genes x samples, transpose them before validation or pass `--orientation genes-by-samples` to the bundled scripts.
- Formula designs such as `~condition` or `~group + condition` reference metadata columns; direct design matrices must have one row per sample and an index identical to metadata/counts.
- Filter missing design-factor samples before modeling, then optionally remove genes with low total counts.

## Recommended Workflow

1. Load with `pandas.read_csv(..., index_col=0)` or use `load_example_data(modality="raw_counts"|"metadata", dataset="synthetic")` for the built-in synthetic example.
2. Normalize orientation to samples x genes, then align metadata with `metadata = metadata.loc[counts.index]` only after confirming both sets of sample ids match.
3. From this sub-skill directory, run `python scripts/validate_pydeseq2_inputs.py --counts-csv counts.csv --metadata-csv metadata.csv --design '~condition' --orientation auto`.
4. Construct `DeseqDataSet(counts=counts_df, metadata=metadata, design="~condition")` only after validation passes.
5. Route full fitting with `dds.deseq2()` to `../dea-workflows/SKILL.md`; route result interpretation to `../statistics-and-results/SKILL.md`; route VST/normalization internals to `../model-fitting-internals/SKILL.md`.

## Safe Export

When a fitted `DeseqDataSet` must be pickled, export `dds.to_picklable_anndata()` instead of pickling the raw `DeseqDataSet`; this converts the formulaic design matrix metadata into a picklable `AnnData` representation.

Files in this skill

  • SKILL.md2.8 KB
  • references/data-formats.md6.8 KB
  • references/troubleshooting.md5.8 KB
  • scripts/run_local_csv_dea.py10.9 KB
  • scripts/validate_pydeseq2_inputs.py20.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.