agentsclimarketplace

Homologous series clustering

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/homologous-series-clustering

Use when you have a feature list (m/z, retention time, intensity) from HRMS data and want to identify potential PFAS homologous series for prioritization.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill homologous-series-clustering

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

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

homologous-series-clustering

Summary

Group mass spectrometry features into homologous series by computing Kendrick mass defect (KMD) values and clustering features with similar KMD within a mass tolerance window. This technique is used to identify CF₂-repeating PFAS compounds in non-target HRMS workflows.

When to use

Apply this skill when you have a feature list (m/z, retention time, intensity) from HRMS data and want to identify potential PFAS homologous series for prioritization. The skill is particularly valuable when you suspect CF₂ or other repeating-unit families in your data and want to group related features systematically rather than manually inspecting mass differences.

When NOT to use

  • Input is already a classified feature table with known compound annotations — clustering homologous series is a discovery/prioritization step, not a validation step.
  • Data contains only singly-charged ions or highly fragmented peaks where intact m/z values are unreliable — KMD calculation requires accurate neutral mass.
  • The repeating unit is not a standard mass difference (e.g., custom polymeric modifications) — the method assumes the repeating unit mass is known and constant.

Inputs

  • Feature list (pandas DataFrame or Excel table) with columns: m/z (exact mass), retention time, intensity
  • Kendrick mass reference mass (default: 14.01565 for CH₂ unit)

Outputs

  • Enriched feature table with additional columns: Kendrick mass (KM), Kendrick mass defect (KMD), series_id (integer cluster label)
  • Homologous series groups indexed by series_id

How to apply

Load the feature list as a pandas DataFrame with exact mass values. For each feature, calculate Kendrick mass using KM = (exact_mass / 14.01565) × 14, where 14 represents the CH₂ unit mass. Compute KMD as the difference KMD = exact_mass − KM for each feature. Cluster features into homologous series by grouping those with KMD values within a tolerance window (typically ±0.005 Da for CF₂ series). Assign each clustered group a unique series_id label. The rationale is that features belonging to the same homologous series share identical KMD values (reflecting the same basic molecular scaffold) but differ in their total mass by integer multiples of the repeating unit; the tight tolerance window isolates genuine series from noise.

Related tools

  • PFΔScreen (Complete PFAS prioritization workflow that implements KMD analysis alongside MD/C-m/C and MS2 fragment analysis for feature detection and clustering) — https://github.com/JonZwe/PFAScreen
  • pandas (Data manipulation and DataFrame operations for loading feature lists and computing mass-based columns)
  • pyOpenMS (Feature detection in raw MS data upstream of KMD clustering; provides the initial m/z and RT values)

Examples

# Load feature list and compute KMD-based homologous series
import pandas as pd
features = pd.read_excel('feature_list.xlsx', columns=['m/z', 'RT', 'intensity'])
KM = (features['m/z'] / 14.01565) * 14
features['KMD'] = features['m/z'] - KM
features['series_id'] = (features.groupby(pd.cut(features['KMD'], bins=np.arange(features['KMD'].min(), features['KMD'].max(), 0.005))).ngroup())
features.to_excel('features_clustered.xlsx', index=False)

Evaluation signals

  • KMD values for all features in a series_id cluster fall within ±0.005 Da (or specified tolerance); no features are misassigned to the wrong cluster.
  • Features within the same series differ by integer multiples of the repeating unit mass (e.g., 14 Da for CH₂, 50 Da for CF₂); mass gaps are consistent.
  • Retention time profiles within a series show systematic shifts or coelution patterns consistent with homologs of differing chain length.
  • Series_id assignments are reproducible when parameters (tolerance window, reference mass) are fixed; no stochastic variation in clustering.
  • Output enriched feature table is valid Excel/CSV with no missing values in KMD or series_id columns; schema matches input with two new columns added.

Limitations

  • Tolerance window (typically ±0.005 Da) may need adjustment for lower-resolution MS instruments; too tight a window will fragment true series, too loose will merge unrelated clusters.
  • The method assumes a single, constant repeating unit mass; it does not handle mixed or variable repeating units (e.g., CF₂ and CF₃ in the same series).
  • Features with low intensity or near the mass spectrometer's detection limit may have m/z values with larger measurement error, leading to spurious KMD values and misclassification.
  • Isotope peaks (e.g., ¹³C variants) are not automatically distinguished from different homologs and may create artifactual series if not pre-filtered.
  • No built-in validation of whether grouped series represent genuine chemistry; biological or environmental significance must be assessed downstream.

Evidence

  • [other] Calculate Kendrick mass for each feature using the formula KM = (exact_mass / 14.01565) × 14, where 14 is the CH₂ unit mass.: "Calculate Kendrick mass for each feature using the formula KM = (exact_mass / 14.01565) × 14, where 14 is the CH₂ unit mass."
  • [other] Compute KMD as KMD = exact_mass − KM for each feature. Cluster features into homologous series by grouping those with KMD values within a tolerance window (typically ±0.005 Da for CF₂ series).: "Compute KMD as KMD = exact_mass − KM for each feature. Cluster features into homologous series by grouping those with KMD values within a tolerance window (typically ±0.005 Da for CF₂ series)."
  • [intro] PFΔScreen uses several techniques for prioritization such as the MD/C-m/C approach, Kendrick mass defect (KMD) analysis and fragment mass differences and diagnostic fragments in the MS2 data: "PFΔScreen uses several techniques for prioritization such as the MD/C-m/C approach, Kendrick mass defect (KMD) analysis and fragment mass differences"
  • [readme] a KMD vs. m/z with linked m/z vs. RT plot (to verify systematic RT-shifts): "a KMD vs. m/z with linked m/z vs. RT plot (to verify systematic RT-shifts)"

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.