agentsclimarketplace

Metabolite feature treemap visualization

Skill HolobiomicsLab/asb-skill-collections/packs/metabolomics/lc-ms/skills/metabolite-feature-treemap-visualization

Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill metabolite-feature-treemap-visualization

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

  • 14 stars14 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 author says it does

Copied from the file, not written here

Use when after applying mpactr's filter suite (filter_mispicked_ions, filter_group, filter_cv, filter_insource_ions) to a peak table, use this skill when you need to summarize the overall filtering outcome across all ion categories and present a compact, area-proportional view of which ions passed.

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

7.3 KB, as published. Nobody here has run it

metabolite-feature-treemap-visualization

Summary

Visualize the distribution of passing and failing metabolite ions across multiple filter categories (mispicked, group, replicability, insource) as a hierarchical treemap, where tile area represents ion count and labels show filter status and percentage of total ions. This enables rapid assessment of filtering efficacy and identification of which filter categories are removing the most features.

When to use

After applying mpactr's filter suite (filter_mispicked_ions, filter_group, filter_cv, filter_insource_ions) to a peak table, use this skill when you need to summarize the overall filtering outcome across all ion categories and present a compact, area-proportional view of which ions passed or failed which filters. Particularly useful when comparing filtering strategies or reporting filtering statistics to stakeholders.

When NOT to use

  • Input has not yet been filtered; qc_summary() requires a filtered mpactr object to produce meaningful status categories.
  • Seeking to visualize m/z and retention time distributions; treemap is designed for categorical counts, not continuous feature properties.
  • Filtering results contain no variation in status (e.g., all ions passed all filters); treemap requires multiple status categories to be informative.

Inputs

  • mpactr object (post-filtering with applied filter_mispicked_ions, filter_group, filter_cv, filter_insource_ions)
  • qc_summary() output (data frame containing per-ion filter status across all filter categories)

Outputs

  • treemap visualization (ggplot2 object)
  • PNG file (exported treemap image with status, count, and percentage labels)

How to apply

  1. Load the filtered mpactr object and call qc_summary() to extract per-ion filter status across all applied filters (mispicked, group, replicability, insource). 2. Pivot and aggregate the qc_summary() output using data.table grouping operations to count ions per filter status category and calculate the percentage of total ions for each status. 3. Construct a data frame with columns for filter status, ion count, and percentage. 4. Render the treemap using ggplot2, with geom_treemap() to scale tile areas proportionally to ion counts and geom_treemap_text() to overlay filter status labels and percentages on each tile. 5. Export the final treemap as a PNG file for reporting or publication. The treemap area scale communicates the relative magnitude of each filter category's impact, and the percentage labels allow comparison across different filtering scenarios.

Related tools

  • mpactr (Extract per-ion filter status via qc_summary() and provide filtered peak data) — https://github.com/mums2/mpactr
  • ggplot2 (Create treemap visualization using geom_treemap() and geom_treemap_text() layers)
  • data.table (Group and aggregate ion counts and percentages by filter status from qc_summary() output)
  • plotly (Optional: convert static treemap to interactive plot for exploratory filtering assessment)

Examples

qc_dat <- qc_summary(mpactr_obj); qc_pivot <- qc_dat[, .(count = .N, pct = 100*.N/nrow(qc_dat)), by=.(filter_status)]; ggplot(qc_pivot, aes(area=count, fill=filter_status, label=paste0(filter_status, '\n', count, ' (', round(pct,1), '%)'))) + geom_treemap() + geom_treemap_text(colour='white', place='centre', size=12)

Evaluation signals

  • Treemap tiles sum to 100% across all filter status categories (verifies percentage calculation correctness).
  • Tile area is proportional to ion count; visually confirm that larger tiles correspond to higher counts in the underlying data frame.
  • All filter status categories from qc_summary() (mispicked pass/fail, group pass/fail, replicability pass/fail, insource pass/fail) are represented in the treemap.
  • Text labels on tiles are readable and non-overlapping; geom_treemap_text() correctly sizes text to fit tile dimensions.
  • PNG export contains no artifacts, has adequate resolution (≥ 300 dpi recommended), and treemap structure matches the underlying data frame when inspected.

Limitations

  • Treemap visualization becomes crowded and difficult to interpret if there are many unique filter status combinations; consider filtering the data frame to top categories or aggregating rare statuses.
  • The treemap does not show temporal or sample-level filtering effects—it is a summary statistic. Ion-level or time-series filtering patterns require complementary visualizations (e.g., interactive scatter plots of m/z and retention time).
  • Percentage labels may be difficult to read if tiles are very small; consider removing text labels or using an interactive version (plotly) for fine-grained inspection.
  • The skill assumes qc_summary() has been called on a fully filtered mpactr object; if filters are applied incrementally without calling qc_summary() between steps, intermediate status information may be lost.

Evidence

  • [other] qc_summary output pivot and grouping rationale: "Ion counts and percentages by status can be computed from qc_summary() output using data.table grouping"
  • [other] treemap rendering method: "rendered as a treemap with geom_treemap() and geom_treemap_text() showing status, count, and percentage labels"
  • [other] filter status categories from qc_summary: "per-ion filter status (passed/failed for mispicked, group, replicability, insource filters)"
  • [methods] workflow step detail from methods: "Visualizing each compound by m/z and retention time, and their fate during filtering may be useful to see if filters are removing features at certain retention time or m/z ranges"
  • [readme] mpactr overview of available filters: "filter_mispicked_ions(): removal of mispicked peaks, or those isotopic patterns that are incorrectly split during preprocessing. filter_group(): removal of features overrepresented in a specific"

Keep looking

Skills are one crate of 328,083. 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.