agentsclimarketplace

Hierarchical database indexing

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/hierarchical-database-indexing

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 hierarchical-database-indexing

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 when you have a large combinatorial chemical space (e.g., all regioisomeric positions of lipid double bonds across carbon counts and saturation levels) and need to query it repeatedly against experimental mass spectrometry spectra.

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

8.2 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it

hierarchical-database-indexing

Summary

Construct and organize a massive enumerated library (e.g., 168.6 million lipid entries) into a hierarchical index structure that maps chemical compositions and structural variants to their theoretical fragmentation patterns, enabling sub-second lookups during spectral annotation.

When to use

When you have a large combinatorial chemical space (e.g., all regioisomeric positions of lipid double bonds across carbon counts and saturation levels) and need to query it repeatedly against experimental mass spectrometry spectra. Apply this skill if spectral matching currently requires linear or slow secondary searches and if false positives from incomplete or flat libraries are degrading annotation accuracy.

When NOT to use

  • Input is a pre-existing flat or unstructured spectral database already in use; hierarchical indexing incurs upfront computational cost and is justified only if lookup speed or accuracy is the bottleneck.
  • Chemical space is small or query frequency is low; hierarchical indexing overhead (memory, index construction) outweighs benefits.
  • Fragmentation rules for your domain are unknown or poorly defined; the quality of the library depends on rule accuracy, and guessing rules will produce false positives.

Inputs

  • Lipid class taxonomy definition (carbon count ranges, unsaturation rules)
  • Fragmentation ruleset (neutral loss patterns, characteristic ion generation rules)
  • Known lipid standards (for validation)
  • Mass spectrometry spectral data (mzML format, e.g., MS1 m/z and MS2 fragment patterns)

Outputs

  • Hierarchical database index (lipid class → chain composition → positional isomer)
  • Theoretical m/z library with fragmentation patterns
  • Fast lookup table or index structure (e.g., .rda, compiled data format)
  • Validation report (entry count, spot-check results against standards)

How to apply

First, define the chemistry taxonomy (lipid class rules, acyl chain carbon count ranges, degree-of-unsaturation constraints). Enumerate all valid structures by iterating over carbon counts and unsaturation levels, generating all positional isomers for each composition. For each structure, compute theoretical m/z fragment ions using domain rules (e.g., neutral loss, characteristic ion patterns). Organize the full enumerated set into a multilevel hierarchical index—typically lipid class → chain composition → positional isomer—that allows fast prefix-matching and range queries. Validate completeness by spot-checking fragment patterns against known standards and verifying entry count. This design, as demonstrated in LipidIN, reduces spectral querying from billions of candidate comparisons to sub-second lookups via greedy secondary matching algorithms primed with hierarchical structure.

Related tools

  • XCMS (Processes mass spectrometry data (mzML format) for peak alignment, matching and identification; used upstream to generate experimental spectral data queried against the hierarchical library.)
  • CAMERA (Extracts and annotates compound spectra from LC/MS datasets; integrates with spectral querying to refine candidate annotations.)
  • LipidIN Expeditious Querying (EQ) Module (Implements secondary matching algorithm and normalization against the hierarchical lipid fragmentation library to perform ~70 billion spectral queries in <1 second.) — https://github.com/LinShuhaiLAB/LipidIN

Examples

load(paste(getwd(),'/MS1_MS2_library.rda',sep='')); source(paste(getwd(),'/EQ.r',sep='')); EQ(filename='QC_POS1.rda', ppm1=5, ppm2=10, ESI='p')

Evaluation signals

  • Entry count matches target enumeration (e.g., 168.6 million lipids); verify by statistical sampling or checksum of enumerated compositions.
  • Hierarchical index structure preserves all regioisomeric variants; validate by confirming that known lipid standards map to correct branch paths (lipid class → chain composition → positional isomer).
  • Fragment ion m/z values for sampled entries match published or experimentally confirmed standards; spot-check ≥5 lipid standards across multiple lipid classes.
  • Query latency is <1 second for spectral datasets; measure end-to-end time for 70 billion candidate queries (as reported in LipidIN).
  • False discovery rate on annotated lipids is acceptable (LipidIN reports 5.7% FDR over 8923 lipids); validate via orthogonal method (e.g., retention time model, independent MS/MS confirmation).

Limitations

  • Library completeness depends on accuracy of fragmentation rules; if rules are incomplete or incorrect, regioisomers and chain compositions will be missed or misidentified.
  • Memory footprint scales with chemical space size; LipidIN's 168.6 million entries require substantial storage (e.g., .rda format compression); practical deployment may require distributed indexing for larger chemical ontologies.
  • Hierarchical index must be rebuilt if taxonomy or fragmentation rules change; maintenance burden increases with rule complexity and scope.
  • Data format conversion for hierarchical indexing is computationally intensive; LipidIN reports ~2 minutes conversion time for mzML to indexed .rda format per file.

Evidence

  • [intro] LipidIN features a 168.6 million lipid fragmentation hierarchical library that encompasses all potential chain compositions and carbon-carbon double bond locations.: "168.6 million lipid fragmentation hierarchical library that encompass all potential chain compositions and carbon-carbon double bond locations"
  • [other] Enumerate all valid acyl chain structures by iterating over carbon counts and unsaturation levels, generating all regioisomeric double-bond position variants for each composition.: "Enumerate all valid acyl chain structures by iterating over carbon counts and unsaturation levels, generating all regioisomeric double-bond position variants"
  • [other] Organize the 168.6 million entries into a hierarchical index structure (lipid class → chain composition → positional isomer) for efficient lookup.: "Organize the 168.6 million entries into a hierarchical index structure (lipid class → chain composition → positional isomer) for efficient lookup"
  • [intro] Expeditious querying module speeds up to around 70 billion times' spectral querying in less than 1 second.: "expeditious querying module speeds up to around 70 billion times' spectral querying in less than 1 second"
  • [readme] This task involves searching a 4-level hierarchical library, which is efficient in terms of querying. However, the data format conversion process for the LCI module takes approximately 2 minutes.: "searching a 4-level hierarchical library, which is efficient in terms of querying. However, the data format conversion process for the LCI module takes approximately 2 minutes"

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.