agentsclimarketplace

Concentration prediction from calibration curves

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/concentration-prediction-from-calibration-curves

Use when when you have a targeted metabolomics peak area intensity table with samples classified into calibration curve standards (with known concentration values), quality control (QC) samples, blanks, and unknowns, and you need to convert raw peak intensities into predicted concentrations for.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill concentration-prediction-from-calibration-curves

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

9.0 KB, ~1.5k tokens by cl100k_base, as published. Nobody here has run it

concentration-prediction-from-calibration-curves

Summary

Predict unknown sample concentrations by fitting linear regression models to calibration curve samples (with known concentrations) and applying the fitted models to unknown samples. This skill quantifies targeted metabolomics features using peak area intensities and internal standard normalization.

When to use

When you have a targeted metabolomics peak area intensity table with samples classified into calibration curve standards (with known concentration values), quality control (QC) samples, blanks, and unknowns, and you need to convert raw peak intensities into predicted concentrations for unknown samples using the calibration curve relationship.

When NOT to use

  • Input data lacks calibration curve samples with known concentration values (cannot fit a model without standards).
  • Peak intensities are already normalized and concentrations are already predicted (workflow already completed).
  • Sample classifications are missing or cannot distinguish 'curve' (calibration) from 'unknown' samples.

Inputs

  • df_example_targeted (peak area intensities table: samples × compounds)
  • df_example_targeted_legend (sample classifications and known concentration values)
  • df_example_targeted_compounds_legend (internal standard assignments and metadata)

Outputs

  • results_concentrations (predicted concentrations for unknown samples and actual values for standards)
  • results_accuracy (accuracy metrics: R², MAE for curve and QC points)
  • summary_regression_models (slope, intercept, R² for each compound)
  • regression_models (fitted linear regression model objects per compound)
  • cv_internal_standards (relative standard deviation of internal standard intensities)

How to apply

Load three data frames: (1) peak area intensities with samples in rows and compounds in columns, (2) sample legend with type classifications ('blank', 'curve', 'qc', 'unknown') and known concentration values for 'curve' and 'qc' samples, and (3) optional compound metadata specifying internal standard assignments. Call get_targeted_elaboration() with these three inputs. The function fits linear regression models (with or without mixed effects and optional TOBIT censored regression) separately for each compound using 'curve' samples, then applies the fitted slope and intercept to predict concentrations for 'unknown' samples. Calculate accuracy metrics (R², MAE) on curve-fitted points and QC samples to validate model performance. Extract the results_concentrations table (predicted and actual values), accuracy scores, and regression model summaries (coefficients, statistics) from the returned list object.

Related tools

  • GetFeatistics (Provides get_targeted_elaboration() function to fit regression models and predict concentrations from calibration curves) — https://github.com/FrigerioGianfranco/GetFeatistics
  • lme4 (Supplies lmer() for fitting linear models with mixed effects (random intercept) as alternative to fixed-effect regression)
  • AER (Provides tobit() function for TOBIT censored regression models when dealing with detection limits)
  • R (Base statistical environment (version ≥ 4.3.1) for executing the entire workflow)

Examples

library(GetFeatistics); result <- get_targeted_elaboration(df_example_targeted, df_example_targeted_legend, df_example_targeted_compounds_legend); concentrations <- result$results_concentrations; accuracy <- result$results_accuracy

Evaluation signals

  • Regression model R² values for calibration curve samples are >0.95 (indicates good fit of the calibration relationship)
  • Predicted concentrations for QC samples fall within acceptable accuracy range (e.g., mean absolute error <10% of known QC values)
  • Coefficient of variation (CV) of internal standard intensities is <20%, indicating stable normalization
  • All expected elements present in returned list: concentrations table, accuracy scores, and model summaries with coefficients and statistics
  • Predicted unknown sample concentrations fall within biologically plausible ranges and are reasonable relative to the concentration range spanned by the calibration curve

Limitations

  • Requires sufficient calibration curve points (typically ≥3 points) to reliably estimate linear regression parameters; sparse or poorly distributed standards degrade prediction accuracy.
  • Assumes linear relationship between peak intensity and concentration; non-linear curves require alternative models (polynomial regression, spline fitting).
  • Performance depends on internal standard availability and stability; if internal standards are absent or show high CV (>20%), predicted concentrations may be unreliable.
  • TOBIT regression for censored data (below detection limit) requires proper specification of detection threshold; misspecification can bias concentration estimates.
  • Mixed-effects models (lmer) assume random intercept structure; complex study designs with multiple random effects may require manual model specification.

Evidence

  • [other] get_targeted_elaboration returns a list containing: results_concentrations (calculated concentrations), results_accuracy (accuracy % for curve and QC points), cv_internal_standards (relative standard deviation of internal standard intensities), compound_legend (input metadata), summary_regression_models (slope, intercept, R² values), and regression_models (fitted linear regression models).: "get_targeted_elaboration returns a list containing: results_concentrations (calculated concentrations), results_accuracy (accuracy % for curve and QC points), cv_internal_standards (relative standard"
  • [other] Load the three example data frames from the GetFeatistics package: df_example_targeted (peak area intensities with samples in rows and compounds in columns), df_example_targeted_legend (sample classifications and known concentration values), and df_example_targeted_compounds_legend (internal standard assignments and compound metadata).: "Load the three example data frames from the GetFeatistics package: df_example_targeted (peak area intensities with samples in rows and compounds in columns), df_example_targeted_legend (sample"
  • [intro] The first should contain the intensities of peak area. Samples in rows, analysed compounds in columns: "The first should contain the intensities of peak area. Samples in rows, analysed compounds in columns"
  • [intro] the second column should contain the following: "blank", "curve", "qc", or "unknown". the third column should have the actual known values for "curve" and "qc" samples: "the second column should contain the following: "blank", "curve", "qc", or "unknown". the third column should have the actual known values for "curve" and "qc" samples"
  • [intro] linear models (with fixed effects), using the lm function...linear models with mixed effects (random and fixed), using the lmer function...TOBIT linear models, using the tobit function: "linear models (with fixed effects), using the lm function...linear models with mixed effects (random and fixed), using the lmer function...TOBIT linear models, using the tobit function"
  • [intro] a third table is useful especially if you work with internal standards...in the second column, the matched internal standard (or NA if there isn't an internal standard for that molecule): "a third table is useful especially if you work with internal standards...in the second column, the matched internal standard (or NA if there isn't an internal standard)"

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.