agentsclimarketplace

Categorical grouping and aggregation

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v1/skills/categorical-grouping-and-aggregation

Use when you have a flat table of structure-organism pairs or entity records and need to summarize their distribution across categorical bins (e.g., organism counts binned by number of associated structures in categories: 1, 1–10, 10–100, >100).From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill categorical-grouping-and-aggregation

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 15 stars15 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

6.2 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

categorical-grouping-and-aggregation

Summary

Group entities (organisms, structures, or references) by a discrete categorical attribute and count or aggregate members within each group to summarize distributions and validate against reference benchmarks. This skill is essential for validating curated datasets against published counts and understanding the composition of large structure-organism pair collections.

When to use

Apply this skill when you have a flat table of structure-organism pairs or entity records and need to summarize their distribution across categorical bins (e.g., organism counts binned by number of associated structures in categories: 1, 1–10, 10–100, >100). Use it to validate curated data against known reference values or to characterize the shape of a collection.

When NOT to use

  • Input is already a pre-aggregated frequency table or summary statistic; re-grouping would lose granularity.
  • Categorical bins are not pre-defined or their boundaries are arbitrary; the skill requires substantive binning logic grounded in domain knowledge.
  • The dataset is too large to fit in memory; consider streaming or database-backed grouping instead.

Inputs

  • Flat reference table (TSV or data frame) with structure-organism pairs
  • Grouping attribute (e.g., organism identifier)
  • Aggregation function (count or cardinality of unique structures per organism)
  • Categorical bin boundaries (e.g., [1, 1-10, 10-100, >100])

Outputs

  • Contingency table or frequency distribution (entity counts per bin)
  • Summary statistics (mean, median, range of entities per category)
  • Validation report (observed vs. reference counts with discrepancy flagging)

How to apply

Load the flat reference table (e.g., LOTUS structure-organism pairs: 484,174 unique 2D pairs across 42,166 organisms) into a data frame. Group records by the target categorical attribute (e.g., organisms grouped by their unique structure count). Bin grouped results into pre-defined categories (e.g., exactly 1 structure, 1–10, 10–100, >100 structures). Count the number of entities falling into each bin. Compare observed counts against published or reference values; report any discrepancies or confirmation of expected distributions. This approach validates data integrity and characterizes collection composition.

Related tools

Examples

# R: Load LOTUS flat file and bin organisms by structure count
lotus_df <- read.table('lotus_structure_organism_pairs.tsv.gz', header=TRUE)
org_counts <- lotus_df %>% group_by(organism_id) %>% summarize(n_structures = n_distinct(structure_id))
binned <- org_counts %>% mutate(bin = case_when(n_structures == 1 ~ '1', n_structures <= 10 ~ '1-10', n_structures <= 100 ~ '10-100', TRUE ~ '>100')) %>% group_by(bin) %>% summarize(count = n())

Evaluation signals

  • Observed counts in each bin match the reference values (7,354 / 21,490 / 10,683 / 374 for LOTUS 2D structures) or explicitly justify discrepancies.
  • Sum of all bin counts equals the total number of entities in the input table (e.g., 42,166 organisms).
  • Bin boundaries are mutually exclusive and exhaustive (no entities fall outside or between bins).
  • Distributions show expected shape (e.g., majority of organisms contain few structures, few organisms contain many).
  • Reproducibility: re-running the grouping on the same input produces identical counts.

Limitations

  • Binning is sensitive to choice of category boundaries; small changes to thresholds (e.g., 1–10 vs. 1–11) can shift counts between adjacent bins.
  • Extremely large tables (>10 million rows) may require memory-efficient streaming or database backends; in-memory data frames in R/Python may be slow or fail.
  • The skill does not handle missing or inconsistent categorical values; data quality pre-processing (cleaning, standardization) is a prerequisite.
  • Results are descriptive, not inferential; aggregation alone does not test statistical hypotheses or establish causation.

Evidence

  • [methods] Group organisms by unique 2D structure count and bin into four categories: exactly 1 structure, 1–10 structures, 10–100 structures, and >100 structures.: "Group organisms by unique 2D structure count and bin into four categories: exactly 1 structure, 1–10 structures, 10–100 structures, and >100 structures"
  • [methods] Validate the observed counts against the reported reference values (7,354, 21,490, 10,683, 374) and report any discrepancies or confirmation.: "Validate the observed counts against the reported reference values (7,354, 21,490, 10,683, 374) and report any discrepancies or confirmation"
  • [methods] Load the LOTUS flat file (484,174 unique 2D structure-organism pairs across 42,166 organisms) into a data frame.: "Load the LOTUS flat file (484,174 unique 2D structure-organism pairs across 42,166 organisms) into a data frame"
  • [methods] 588694 | 484174 (3D|2D) unique referenced structure-organism pairs: "588694 | 484174 (3D|2D) unique referenced structure-organism pairs"

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.