Communitygithub.com

分析方法驗證

規劃、執行並記錄分析程序的驗證、確認與轉移,並遵循 ICH Q2(R2)/Q14、USP <1220>/<1225>/<1226>、ICH M10 生物分析、CLSI EP 或 ISO/IEC 17025 等規範架構。

分析方法驗證 是什麼?

此技能專為分析化學與生物分析領域的科學家及法規遵循專業人員設計,協助其在 HPLC、LC-MS/MS、GC 等技術平台上,針對 ICH Q2(R2)、USP <1225>、ICH M10、CLSI EP 與 ISO/IEC 17025 等不同規範架構,規劃、執行並記錄分析方法的驗證、確認與轉移。它提供一套指令碼,可自動生成驗證計畫、計算統計數據(如線性、準確度、精密度、偵測極限與定量極限),並檢查生物分析運作是否符合 ICH M10 要求。此技能的核心在於強制執行兩項關鍵規則:在設計任何研究前,先確定適用的規範架構;以及在收集數據前,預先制定允收標準,避免常見的法規缺失。它支援 ICH Q2(R2) 的最新結構(如將範圍作為上層特性,並納入多變量程序),並正確處理 ICH M10 中層析法與配體結合法在允收標準上的差異。此技能也可用於方法比較(如方法轉移),採用 TOST 等效性檢定與戴明迴歸,而非常見但易誤導的 t 檢定與最小平方法。

相容平台~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 標準受版權保護且需付費使用。 對於這些規範,此技能提供其名稱、範圍以及如何取得授權副本——絕不提供原文,也絕不發明閾值。請勿要求代理程式檢索、轉錄或重建其內容。如果某個數值很重要且位於付費文件中,請從授權副本中讀取。

規範架構

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 節),包含回應(線性)和下範圍限制的驗證(偵測極限/定量極限)。準確度與精密度為第 3.3 節,可根據單一標準進行組合評估。穩健性被視為開發活動,並交叉引用 ICH Q14。多變量程序得到明確處理(2.5 和 3.2.2.3),附錄 2 新增了 Q2(R1) 從未涵蓋的技術實例——定量 ¹H-NMR、NIR、定量 LC/MS、qPCR、生物分析與粒徑。一份以 Q2(R1) 為形狀的計畫書——一個包含線性、範圍、準確度、精密度、專一性、偵測極限、定量極限、穩健性的平面列表——已經過時。另請注意 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每種允許方法下的偵測極限和定量極限是多少,它們是否滿足報告閾值?
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 根據測量屬性而非技術來決定所需內容。對於含量分析:專一性、回應、準確度、重複性、中間精密度。對於限度測試:僅需專一性和偵測極限。對於鑑別測試:僅需專一性。接受的屬性包括 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

0.07% RSD 的重複性看起來極佳;中間精密度為 1.65%,大了二十三倍,因為變異性完全來自日間差異。將當日數據報告為該程序的精密度,會使常規性能低估一個數量級以上。這就是為什麼該指令碼擬合單因子隨機效應模型而非合併。

該指令碼為您處理了兩個陷阱:

  • 精密度是在每個水平內估計,絕不跨水平合併。 將 80/100/120% 的結果合併為一個標準差,會將範圍本身變成明顯的不精密度。該指令碼報告每個水平的結果,並以標稱值的百分比提供一個與水平無關的視圖。
  • --require-ci-within-limit 強制要求整個信賴區間位於限值內,而不僅僅是平均值。Q2(R2) 3.3.1.4 要求區間與標準相容;一個在六次重複中勉強落在限值內的平均值,並未證明太多。

5. 建立偵測極限與定量極限,並進行確認

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% CV)±20% / ≤20% CV(LLOQ 和 ULOQ 為 ±25% / ≤25% CV)
A&P 設計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 假定參考值沒有誤差,這在比較兩個程序時是錯誤的,會使斜率偏離零。戴明迴歸(需指定誤差變異數比)和 Passing–Bablok 迴歸(非參數、抗離群值)是適當的迴歸方法,此處與 OLS 並列報告以供對比。

該指令碼還會標記比例偏差——當差異隨濃度變化時,單一的平均偏差及其一致界限無論看起來多緊密,都具有誤導性。

此技能存在的目的

  1. 在 Q2(R2) 取代 Q2(R1) 三年後,仍根據 ICH Q2(R1) 的結構進行驗證。
  2. 在看到數據後才制定允收標準。
  3. 將 r² 呈現為線性的證據。
  4. 將重複性報告為程序的精密度,而日間成分卻不可見。
  5. 提供一個沒有命名方法的 DQL 數字且未經確認。
  6. 將層析法 M10 標準應用於配體結合法,或反過來。
  7. 在方法轉移中,將 t 檢定的非顯著性呈現為等效性。

參考資料

  • references/framework-selection.md — 哪個架構管轄,以及根據什麼問題
  • references/ich-q2r2-summary.md — Q2(R2) 結構變更(相對於 Q2(R1))
  • references/ich-m10-summary.md — M10 標準摘要

支援

將問題和錯誤報告提交至 GitHub Issues。

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.

相關技能