Communitygithub.com

分析方法验证

规划、执行并记录分析方法的验证、确认和转移,遵循ICH Q2(R2)/Q14、USP <1220>/<1225>/<1226>、ICH M10生物分析、CLSI EP或ISO/IEC 17025等指导框架。适用于HPLC、LC-MS/MS、GC、CE、ICP-MS、溶出度、qNMR、qPCR、NIR以及配体结合或基于细胞的测定,只要问题是某个方法是否适用于其预期目的。

分析方法验证 是什么?

该技能旨在帮助分析科学家和质量保证人员系统性地规划、执行和记录分析方法的验证、确认和转移。它基于多个国际监管框架(如ICH Q2(R2)、USP <1225>、ICH M10、CLSI EP和ISO/IEC 17025)的要求,自动确定适用的框架、所需特性以及研究布局。用户可以通过命令行脚本生成验证方案、评估校准模型、计算准确度和精密度、确定检测限和定量限,并执行方法比较。该技能特别强调防止七种常见错误,例如使用过时的ICH Q2(R1)框架、在观察数据后设定接受标准、将r²作为线性证据,以及将重复性报告为方法的总精密度。它支持HPLC、LC-MS/MS、GC、CE、ICP-MS等多种分析技术,并详细处理了ICH M10下色谱法和配体结合测定之间不同的接受标准。所有脚本均以结构化格式输出结果,并可与自动化工作流集成。需要注意的是,该技能不取代分析师、技术审阅者或监管机构的专业判断,而是提供基于证据的统计分析结果。对于付费墙内容(如USP章节),技能仅提供指定和获取授权副本的指引,不直接转录受版权保护的内容。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/K-Dense-AI/scientific-agent-skills/tree/main/skills/analytical-method-validation

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

分析方法验证 是做什么的?

何时使用

任何时候只要问题是某个分析方法是否适用于其预期目的: 设计验证研究、评估验证数据、确认药典方法、 将方法转移到另一个实验室或仪器,或在报告中为上述任何一点进行辩护。

两条规则

1. 在设计任何东西之前,先确定哪个框架起主导作用。 同样的分析方法在ICH Q2(R2)、USP <1225>、ICH M10、CLSI EP和ISO/IEC 17025下的验证方式不同。 它们在所需特性、研究布局以及是否提供数值接受标准方面存在差异。 将它们混在一起会产生一个无法满足任何框架要求的方案。

2. 在收集数据之前说明接受标准。 在看到结果后选择的标准不是接受标准,事后制定标准是一个常见的审计发现。 ICH Q2(R2)故意几乎不提供数值标准——它们必须来自于规格限、 分析目标概况(ICH Q14第3节)或开发数据。ICH M10是一个例外: 它提供了明确的数字,而且这些数字在色谱法和配体结合测定之间是不同的。

范围

该技能规划研究、正确计算统计数据并构建文档结构。 它不决定某个方法已验证、放行批次、接受或拒绝某次运行、 结束调查,或替代分析员、技术审阅者、质量部门或监管机构。 每个脚本都报告结果;没有任何一个脚本做出结论。

版权边界

ICH指南是公开出版的,并允许在注明出处的情况下复用,因此它们的要求直接编码在该技能中。 USP通用章节、CLSI EP文件和ISO标准受版权保护并设有付费墙。 对于这些文件,该技能提供名称、范围以及如何获取授权副本—— 绝不提供文本,也绝不编造阈值。不要要求AI智能体检索、转录或重构其内容。 如果一个数字很重要且位于付费文档中,请阅读授权副本。

框架

cd skills/analytical-method-validation/scripts
python3 plan_validation.py --list-frameworks
键适用范围是否提供数值标准
ich-q2r2原料药和制剂的放行和稳定性测试几乎不提供——需要自行推导
ich-m10生物分析浓度测量(PK、TK、BE)是,且因分析方式而异
usp-1220药典方法生命周期,三个阶段付费墙
usp-1225 / usp-1226药典方法的验证/确认付费墙
clsi临床实验室测量程序(EP系列)付费墙
iso-17025实验室开发的方法和经修改的方法(在认可条件下)不提供——“在必要的程度上”

Q2(R2)于2023年11月取代了Q2(R1),并重新组织了特性。 范围现在是父特性(第3.2节),包含响应(线性)和较低范围限值的验证(DL/QL)。准确度和精密度是第3.3节,可以针对单个标准进行组合评估。稳健性被视为开发活动,并交叉引用ICH Q14。显式地处理了多变量方法(2.5和3.2.2.3),附件2增加了Q2(R1)从未涵盖的技术的工作示例——定量¹H-NMR、NIR、定量LC/MS、qPCR、生物测定和粒度分布。一个Q2(R1)形态的方案——线性、范围、准确度、精密度、专属性、LOD、LOQ、稳健性的扁平列表——已经过时了。另请注意2023年11月30日对表5和表6-11的勘误。

脚本

cd skills/analytical-method-validation/scripts
脚本解答的问题
plan_validation.py哪个框架、哪些特性、什么研究布局、什么方案?
check_response.py校准模型在整个范围内是否真的成立?
check_accuracy_precision.py回收率是多少,有多少变异是由天间差异引起的?
check_detection_limits.py通过每种允许的方法得到的DL和QL是多少,它们是否满足报告阈值?
check_bioanalytical_run.py本次运行是否满足其分析方式的ICH M10要求?
compare_methods.py两个方法在预先设定的界限内是否等效?

所有脚本都接受 --format table|tsv|json。来源信息、指南引用和注意事项输出到stderr; 数据输出到stdout,因此 > out.tsv 可以将它们分开。退出代码为 0 表示无发现,1 表示发现了问题,2 表示输入错误——因此任何脚本都可以用于在流程中设置门控。

工作流程

1. 确定框架和所需特性

python3 plan_validation.py --framework ich-q2r2 --attribute assay --technique hplc --range-use assay

Q2(R2)表1根据被测属性(而非技术)决定所需特性。对于含量测定:专属性、响应、准确度、重复性、中间精密度。对于限度试验:仅专属性和DL。对于鉴别试验:仅专属性。接受的属性包括 assay(含量测定)、impurity(定量杂质)、impurity-limit(杂质限度)和 identity(鉴别)。

可报告范围来自于规格限。Q2(R2)表2提供了工作示例——含量测定为标称含量的80–120%,含量均匀度为70–130%,杂质为报告阈值至规格的120%。

2. 生成方案并填写标准

python3 plan_validation.py --framework ich-q2r2 --attribute impurity --protocol > protocol.md

每个用方括号括起来的字段都是在数据收集之前需要做出并记录决策的地方。方案模板故意拒绝为Q2(R2)工作预填接受标准,因为没有可辩护的默认值。

3. 评估响应

python3 check_response.py -i calibration.csv --max-back-calc-error 2

输入是 level,response,每进样一次一行;相同水平的重复行被视为重复测定,提供它们是使线性检验成为可能的因素。

来自一条决定系数会轻易通过的曲线的真实输出:

statistic                           value
distinct levels                     5
slope                               166.6000
intercept                           2495.0000
intercept CI includes 0             no
coefficient of determination (r2)   0.9830
lack-of-fit F                       469.5294
lack-of-fit p                       1.5139e-06
runs test p                         0.0492

level     n  mean_response  mean_back_calculated  relative_error_pct
50.0000   2  10075.0000     45.4982               -9.0036
75.0000   2  15150.0000     75.9604               1.2805
100.0000  2  20050.0000     105.3721              5.3721
125.0000  2  24050.0000     129.3818              3.5054
150.0000  2  26450.0000     143.7875              -4.1417

r² = 0.983,但模型不可用:范围低端回算误差为−9.0%,失拟p = 1.5 × 10⁻⁶,残差符号非随机。r²不能作为线性的证据——它随范围增大而增大,且几乎对曲率不敏感。针对纯误差的失拟F检验和残差模式才是证据,这就是为什么Q2(R2) 3.2.2.1要求分析点与线的偏差,而不仅仅是相关系数。

对于宽范围曲线,添加 --weight 1/x2。当范围上三分之一部分的残差方差超过下三分之一部分10倍以上时,该脚本会标记异方差性,因为此时未加权的拟合会偏偏低估报告阈值所在的低端。

4. 评估准确度和精密度

python3 check_accuracy_precision.py -i ap.csv --accuracy-limit 2 --rsd-limit 1.0 --design-check assay

输入是 level,measured,group,其中 group 是中间精密度因素——天、分析员或仪器。

level  component                       sd      rsd_pct  df      ci90_low_sd  ci90_high_sd
100    repeatability (within group)    0.0707  0.0707   3       0.0438       0.2065
100    between-group                   1.6515  1.6515   2       n/a          n/a
100    intermediate precision (total)  1.6530  1.6530   2.0037  0.9554       7.2821

重复性RSD为0.07%看起来极好;中间精密度为1.65%,是其二十三倍,因为变异完全存在于天间。将日内数据报告为方法的精密度将使常规性能低估一个数量级以上。这就是为什么该脚本拟合的是单因素随机效应模型而不是合并数据的原因。

该脚本为您处理了两个陷阱:

  • 精密度是在每个水平内估算的,绝不跨水平合并。 将80/100/120%的结果合并成一个标准偏差会将范围本身变成明显的精密度不佳。该脚本按水平报告,并作为标称值的百分比提供一个与水平无关的视图。
  • --require-ci-within-limit 强制执行整个置信区间位于限值内,而不仅仅是均值。Q2(R2) 3.3.1.4要求区间与标准兼容;一个在六个重复样上勉强位于限值内的均值并没有展示太多东西。

5. 确定DL和QL,并进行确认

python3 check_detection_limits.py --calibration lowcal.csv --blanks blanks.csv \
    --confirm-ql 0.05 --confirm-data ql_check.csv --reporting-threshold 0.05
approach                                          sigma   slope      DL      QL
sd-and-slope (sigma = residual SD of regression)  7.2816  5033.3490  0.0048  0.0145
sd-and-slope (sigma = SD of y-intercept)          4.3303  5033.3490  0.0028  0.0086
sd-and-slope (sigma = SD of 8 blanks)             3.7702  5033.3490  0.0025  0.0075

相同的数据给出的QL估计值范围相差1.9倍,纯粹是因为σ的选择。Q2(R2) 3.2.3.5因此要求报告限值以及用于确定它的方法,并且必须使用接近该限值的样品来确认估计的限值。对于杂质方法,QL必须低于或等于报告阈值。习惯性地使用 3.3σ/slope,报告一个数字却没有说明方法名称,并且从未确认,这是三个独立的发现。

6. ICH M10下的生物分析运行

python3 check_bioanalytical_run.py --modality chromatographic --run run1.csv
python3 check_bioanalytical_run.py --modality lba --isr isr.csv
python3 check_bioanalytical_run.py --modality lba --criteria

--modality 是必需的,没有默认值,因为标准确实不同:

色谱法配体结合测定
校准耐受性±15%,LLOQ 处为 ±20%±20%,LLOQ 和 ULOQ 处为 ±25%
准确度/精密度±15% / ≤15% CV(LLOQ 处为 ±20% / ≤20%)±20% / ≤20% CV(LLOQ 和 ULOQ 处为 ±25% / ≤25%)
准确度和精密度设计4个QC水平,每批5个重复,≥3批,跨越≥2天5个QC水平,每批3个重复,≥6批,跨越≥2天
总误差无此标准≤30%,LLOQ 和 ULOQ 处为 ≤40%
ISR 一致性≥2/3的重复样在 ±20% 内≥2/3的重复样在 ±30% 内

将色谱法的±15%数字应用于配体结合测定,或者将LBA的总误差标准引入色谱方法,都是常见的错误。

该运行检查强制实施一个经常被忽略的逐水平规则:至少2/3的所有QC并且每个水平至少50%。一次运行可能通过总体比例,而单个水平却完全失败。

finding: QC level high: 0/2 within tolerance (0%); M10 requires at least 50% at each level

7. 转移和方法比较

python3 compare_methods.py -i paired.csv --margin 2 --relative --slope-tolerance 0.05
mean difference (%)                       1.4646
TOST margin                               2.0000
TOST p-value                              1.0528e-13
90% CI (TOST)                             1.44127 to 1.48797
equivalent at stated margin               yes
--- for contrast only ---
paired t-test p (NOT equivalence)         0.0000
OLS slope (biased here)                   1.0396
Deming slope                              1.0398
Passing-Bablok slope                      1.0351

该脚本取代了两个错误:

  • “p > 0.05,无显著差异,因此方法是等效的。” 未能检测到差异不是等效的证据,并且在小的转移数据集上,这个结果几乎是必然的。TOST检验的是真正重要的问题——真实差异是否位于预先设定的界限内。这里t检验表明差异高度显著并且TOST表明在±2%的界限内方法是等效的;两者都是真的,但只有后者回答了问题。
  • 使用普通最小二乘法进行方法比较。 OLS假定参考值没有误差,这在比较两个方法时是错误的,并且会使斜率偏向零。Deming回归(使用指定的误差方差比)和Passing–Bablok回归(非参数、抗离群值)是合适的方法,并与OLS并列报告以作对比。

该脚本还会标记比例偏差——当差异随浓度变化趋势时,无论限度看起来多么严格,单一的平均偏差及其一致性限值都是具有误导性的。

该技能旨在防止什么

  1. 在Q2(R2)取代Q2(R1)三年后,仍按照Q2(R1)的结构进行验证。
  2. 在看到数据后才编写接受标准。
  3. 将r²作为线性的证据。
  4. 将重复性报告为方法的精密度,而忽略了天间组分。
  5. 提供一个DL/QL数字,却没有说明方法名称,也没有进行确认。
  6. 将色谱法M10标准应用于配体结合测定,或反之。
  7. 将t检验的非显著性呈现为方法转移时的等效性。

参考文献

  • references/framework-selection.md — 哪个框架起主导作用,以及相关问题

…

[已截断以进行翻译]

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

adaptyv

How to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.

aeon

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

alphagenome

Look up precomputed AlphaGenome Atlas effects for any GRCh38 single-nucleotide variant (AVI score with Phred and 18 SHAP feature attributions, plus raw and quantile scores for RNA-seq, DNase, ATAC, ChIP-TF, ChIP-histone, CAGE, PRO-cap, splicing, polyadenylation and contact-map tracks), score variants or scan windows on demand with the AlphaGenome model for human and mouse (variant scoring, in silico mutagenesis, REF-versus-ALT track prediction), and build Atlas website deep links. Use when the user mentions AlphaGenome, AlphaGenome Atlas, AVI or AlphaGenome Variant Impact, DeepMind variant effect prediction, or wants to prioritise or mechanistically interpret non-coding, regulatory, splicing, enhancer, promoter, or chromatin-accessibility effects of SNVs from a VCF, credible set, or region. Research use only; not a clinical tool.

anndata

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

arbor

Autonomously improve a real artifact (code, training recipe, agent harness, data pipeline, prompt) against an objective and an evaluator, using Hypothesis Tree Refinement (HTR) from the Arbor paper. Use this whenever someone wants to iteratively optimize something over many experiments without overfitting — e.g.

arboreto

Infer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.

astropy

Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.

autoskill

Observe the user

benchling-integration

Benchling Python SDK and REST API integration for registry entities, inventory, ELN entries, workflows, Benchling Apps, and Data Warehouse queries. Use when automating lab data with benchling-sdk or the v2 API.

bgpt-paper-search

Search scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server. Returns 25+ fields per paper including methods, results, sample sizes, quality scores, and conclusions. Use for literature reviews, evidence synthesis, and finding experimental details not available in abstracts alone.

bids

>

biopython

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

bioservices

Unified Python interface to 40+ bioinformatics services. Use when querying multiple databases (UniProt, KEGG, ChEMBL, Reactome) in a single workflow with consistent API. Best for cross-database analysis, ID mapping across services. For quick single-database lookups use gget; for sequence/file manipulation use biopython.

bulk-rnaseq

End-to-end bulk RNA-seq orchestrator — takes raw FASTQ reads through QC and trimming (FastQC, fastp/Trim Galore), alignment and quantification (STAR, Salmon, featureCounts), assembles a gene-level counts matrix, then hands off to differential expression (pydeseq2), pathway/GSEA enrichment (pathway-enrichment), and publication figures (scientific-visualization). Use whenever the user has bulk RNA-seq reads or quant output and wants a complete, reproducible differential-expression workflow — e.g.

cellxgene-census

Query the CZ CELLxGENE Census programmatically for versioned public single-cell and spatial transcriptomics data. Use when you need population-scale cell metadata, gene expression slices, Census summary counts, source H5AD URIs/downloads, embeddings, spatial Census data, or reference atlas comparisons across organisms, tissues, diseases, assays, and cell types. For analyzing your own local single-cell data use scanpy, anndata, or scvi-tools.

cirq

Google quantum computing framework. Use when targeting Google Quantum AI hardware, designing noise-aware circuits, or running quantum characterization experiments. Best for Google hardware, noise modeling, and low-level circuit design. For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for physics simulations use qutip.

citation-management

Comprehensive citation management for academic research. Search OpenAlex, PubMed, and Google Scholar for papers, extract accurate metadata, validate citations, and generate properly formatted BibTeX entries. This skill should be used when you need to find papers, verify citation information, convert DOIs to BibTeX, or ensure reference accuracy in scientific writing.

clinical-decision-support

Prepare and validate research-only clinical decision-support evaluation, evidence-profile, cohort, survival, biomarker/model, privacy, and governance artifacts. Use for aggregate or synthetic research documentation and traceability—not patient care or live clinical operation.

clinical-reports

Create safety-bounded draft structures and run local deterministic checks for clinical case, diagnostic, trial, safety, and aggregate research reports. Use only with synthetic, de-identified, or aggregate inputs and verified source-fact manifests; every output requires qualified review.

cobrapy

Constraint-based metabolic modeling (COBRA). FBA, FVA, gene knockouts, flux sampling, SBML models, for systems biology and metabolic engineering analysis.

相关技能