$npx -y skills add ma-compbio-lab/SkillFoundry --skill metadata-harmonization-starterUse this skill to harmonize small metadata tables with inconsistent column names and categorical labels into one canonical TSV plus a compact JSON summary.
| 1 | # Metadata Harmonization Starter |
| 2 | |
| 3 | Use this skill to harmonize small metadata tables with inconsistent column names and categorical labels into one canonical TSV plus a compact JSON summary. |
| 4 | |
| 5 | ## What This Skill Does |
| 6 | |
| 7 | - reads one or more tabular metadata files |
| 8 | - applies a JSON mapping from source columns to canonical fields |
| 9 | - normalizes selected categorical values such as `sex` and `condition` |
| 10 | - writes a harmonized TSV and a machine-readable summary |
| 11 | |
| 12 | ## When To Use It |
| 13 | |
| 14 | - when you need a starter for `metadata-harmonization` |
| 15 | - when multiple small test fixtures use different metadata headers |
| 16 | - when you want deterministic harmonized outputs before validation or format conversion |
| 17 | |
| 18 | ## Run |
| 19 | |
| 20 | ```bash |
| 21 | python3 skills/data-acquisition-and-dataset-handling/metadata-harmonization-starter/scripts/run_metadata_harmonization.py \ |
| 22 | --input skills/data-acquisition-and-dataset-handling/metadata-harmonization-starter/examples/cohort_a.tsv \ |
| 23 | --input skills/data-acquisition-and-dataset-handling/metadata-harmonization-starter/examples/cohort_b.tsv \ |
| 24 | --mapping skills/data-acquisition-and-dataset-handling/metadata-harmonization-starter/examples/column_mapping.json \ |
| 25 | --out-tsv scratch/metadata-harmonization/harmonized_metadata.tsv \ |
| 26 | --summary-out scratch/metadata-harmonization/harmonized_metadata_summary.json |
| 27 | ``` |
| 28 | |
| 29 | ## Notes |
| 30 | |
| 31 | - The starter keeps the mapping external so the same script can be reused for other tiny fixtures. |
| 32 | - Canonical rows are sorted by `sample_id` to keep committed outputs deterministic. |