tooluniverse-clinical-trial-matching
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseClinical Trial Matching for Precision Medicine
精准医学临床试验匹配系统
Transform patient molecular profiles and clinical characteristics into prioritized clinical trial recommendations. Searches ClinicalTrials.gov and cross-references with molecular databases (CIViC, OpenTargets, ChEMBL, FDA) to produce evidence-graded, scored trial matches.
KEY PRINCIPLES:
- Report-first approach - Create report file FIRST, then populate progressively
- Patient-centric - Every recommendation considers the individual patient's profile
- Molecular-first matching - Prioritize trials targeting patient's specific biomarkers
- Evidence-graded - Every recommendation has an evidence tier (T1-T4)
- Quantitative scoring - Trial Match Score (0-100) for every trial
- Eligibility-aware - Parse and evaluate inclusion/exclusion criteria
- Actionable output - Clear next steps, contact info, enrollment status
- Source-referenced - Every statement cites the tool/database source
- Completeness checklist - Mandatory section showing analysis coverage
- English-first queries - Always use English terms in tool calls. Respond in user's language
将患者分子特征与临床信息转化为优先级排序的临床试验推荐。搜索ClinicalTrials.gov并与CIViC、OpenTargets、ChEMBL、FDA等分子数据库交叉引用,生成带证据分级的匹配评分试验列表。
核心原则:
- 报告优先原则 - 先创建报告文件,再逐步填充内容
- 以患者为中心 - 所有推荐均考虑患者个体档案
- 分子优先匹配 - 优先推荐针对患者特定生物标志物的试验
- 证据分级 - 所有推荐均标注证据等级(T1-T4)
- 量化评分 - 为每个试验生成0-100分的匹配评分
- 适配性感知 - 解析并评估纳入/排除标准
- 可落地输出 - 明确的后续步骤、联系信息及招募状态
- 来源标注 - 所有结论均标注工具/数据库来源
- 完整性检查清单 - 强制展示分析覆盖情况的模块
- 英文优先查询 - 工具调用时始终使用英文术语,最终响应使用用户语言
When to Use
适用场景
Apply when user asks:
- "What clinical trials are available for my NSCLC with EGFR L858R?"
- "Patient has BRAF V600E melanoma, failed ipilimumab - what trials?"
- "Find basket trials for NTRK fusion"
- "Breast cancer with HER2 amplification, post-CDK4/6 inhibitor trials"
- "KRAS G12C colorectal cancer clinical trials"
- "Immunotherapy trials for TMB-high solid tumors"
- "Clinical trials near Boston for lung cancer"
- "What are my options after failing osimertinib for EGFR+ NSCLC?"
NOT for (use other skills instead):
- Single variant interpretation without trial focus -> Use
tooluniverse-cancer-variant-interpretation - Drug safety profiling -> Use
tooluniverse-adverse-event-detection - Target validation -> Use
tooluniverse-drug-target-validation - General disease research -> Use
tooluniverse-disease-research
适用于用户提出以下需求时:
- "我的EGFR L858R突变非小细胞肺癌有哪些可选临床试验?"
- "患者为BRAF V600E突变黑色素瘤,已对伊匹单抗耐药,有哪些临床试验?"
- "寻找针对NTRK融合的篮式试验"
- "HER2扩增型乳腺癌,CDK4/6抑制剂治疗后的临床试验"
- "KRAS G12C突变结直肠癌的临床试验"
- "TMB高表达实体瘤的免疫治疗临床试验"
- "波士顿附近的肺癌临床试验"
- "EGFR阳性非小细胞肺癌患者对奥希替尼耐药后有哪些选择?"
不适用场景(请使用其他工具):
- 仅解读单个变异而不关注临床试验 -> 使用
tooluniverse-cancer-variant-interpretation - 药物安全性分析 -> 使用
tooluniverse-adverse-event-detection - 靶点验证 -> 使用
tooluniverse-drug-target-validation - 一般性疾病研究 -> 使用
tooluniverse-disease-research
Input Parsing
输入解析
Required Input
必填输入
- Disease/cancer type: Free-text disease name (e.g., "non-small cell lung cancer", "melanoma")
- 疾病/癌症类型: 自由文本形式的疾病名称(如:"非小细胞肺癌"、"黑色素瘤")
Strongly Recommended
强烈推荐输入
- Molecular alterations: One or more biomarkers (e.g., "EGFR L858R", "KRAS G12C", "PD-L1 50%", "TMB-high")
- Stage/grade: Disease stage (e.g., "Stage IV", "metastatic", "locally advanced")
- Prior treatments: Previous therapies and outcomes (e.g., "failed platinum chemotherapy", "progressed on osimertinib")
- 分子变异: 一种或多种生物标志物(如:"EGFR L858R"、"KRAS G12C"、"PD-L1 50%"、"TMB-high")
- 分期/分级: 疾病分期(如:"IV期"、"转移性"、"局部晚期")
- 既往治疗史: 既往治疗方案及疗效(如:"铂类化疗失败"、"奥希替尼治疗后进展")
Optional
可选输入
- Performance status: ECOG or Karnofsky score (e.g., "ECOG 0-1")
- Geographic location: City/state for proximity filtering (e.g., "Boston, MA")
- Trial phase preference: I, II, III, IV, or "any"
- Intervention type: drug, biological, device, etc.
- Recruiting status preference: recruiting, not yet recruiting, active
- 体能状态: ECOG或卡氏评分(如:"ECOG 0-1")
- 地理位置: 用于 proximity 筛选的城市/州(如:"Boston, MA")
- 临床试验阶段偏好: I、II、III、IV期或"任意"
- 干预类型: 药物、生物制剂、器械等
- 招募状态偏好: 招募中、尚未招募、进行中
Biomarker Parsing Rules
生物标志物解析规则
| Input Format | Parsed As | Example |
|---|---|---|
| Gene + amino acid change | Specific mutation | EGFR L858R |
| Gene + exon notation | Exon-level alteration | EGFR exon 19 deletion |
| Gene + fusion partner | Fusion | EML4-ALK fusion |
| Gene + amplification | Copy number gain | HER2 amplification |
| Gene + expression level | Expression biomarker | PD-L1 50% |
| Gene + status | Status biomarker | MSI-high, TMB-high |
| Gene + resistance | Resistance mutation | EGFR T790M |
| 输入格式 | 解析结果 | 示例 |
|---|---|---|
| 基因 + 氨基酸改变 | 特定突变 | EGFR L858R |
| 基因 + 外显子标注 | 外显子层面变异 | EGFR exon 19 deletion |
| 基因 + 融合伙伴 | 融合突变 | EML4-ALK fusion |
| 基因 + 扩增 | 拷贝数增加 | HER2 amplification |
| 基因 + 表达水平 | 表达型生物标志物 | PD-L1 50% |
| 基因 + 状态 | 状态型生物标志物 | MSI-high, TMB-high |
| 基因 + 耐药突变 | 耐药突变 | EGFR T790M |
Gene Symbol Normalization
基因符号标准化
| Common Alias | Official Symbol | Notes |
|---|---|---|
| HER2 | ERBB2 | Search both in trials |
| PD-L1 | CD274 | Often searched as "PD-L1" in trials |
| ALK | ALK | EML4-ALK is a fusion |
| VEGF | VEGFA | Often searched as "VEGF" |
| PD-1 | PDCD1 | Search as "PD-1" in trials |
| BRCA | BRCA1/BRCA2 | Specify which BRCA gene |
| 常用别名 | 官方符号 | 说明 |
|---|---|---|
| HER2 | ERBB2 | 搜索试验时同时查询两个符号 |
| PD-L1 | CD274 | 试验中常以"PD-L1"为关键词 |
| ALK | ALK | EML4-ALK为融合突变 |
| VEGF | VEGFA | 试验中常以"VEGF"为关键词 |
| PD-1 | PDCD1 | 试验中常以"PD-1"为关键词 |
| BRCA | BRCA1/BRCA2 | 需明确具体BRCA基因 |
Phase 0: Tool Parameter Reference (CRITICAL)
阶段0:工具参数参考(关键)
BEFORE calling ANY tool, verify its parameters from this reference table.
调用任何工具前,请从此参考表确认参数。
Clinical Trial Tools
临床试验工具
| Tool | Parameters | Notes |
|---|---|---|
| | Main search. Returns |
| | Alternative search. Returns |
| | Full trial details. Returns |
| | Returns |
| | Returns |
| | Returns |
| | Returns |
| | Returns |
| | Returns |
| | Returns trial outcome results |
| | Returns adverse event data |
| 工具 | 参数 | 说明 |
|---|---|---|
| | 主搜索工具。返回 |
| | 备选搜索工具。返回 |
| | 获取完整试验详情。返回 |
| | 返回 |
| | 返回 |
| | 返回 |
| | 返回 |
| | 返回 |
| | 返回 |
| | 返回临床试验结果数据 |
| | 返回不良事件数据 |
Molecular/Disease Tools
分子/疾病工具
| Tool | Parameters | Notes |
|---|---|---|
| | Returns |
| | Returns |
| | Returns |
| | Returns |
| | Returns |
| | Returns |
| | Returns |
| | Returns |
| | Returns target-disease evidence rows |
| 工具 | 参数 | 说明 |
|---|---|---|
| | 返回 |
| | 返回 |
| | 返回 |
| | 返回 |
| | 返回 |
| | 返回 |
| | 返回 |
| | 返回 |
| | 返回靶点-疾病证据条目 |
CIViC Tools
CIViC工具
| Tool | Parameters | Notes |
|---|---|---|
| | Does NOT filter by query. Returns alphabetically sorted variants |
| | Returns |
| | Does NOT filter by query. Returns evidence alphabetically |
| | Returns |
| | Search therapies |
| | Search diseases |
Known CIViC Gene IDs: EGFR=19, BRAF=5, ALK=1, ABL1=4, KRAS=30, TP53=45, ERBB2=20, NTRK1=197, NTRK2=560, NTRK3=561, PIK3CA=37, MET=52, ROS1=118, RET=122, BRCA1=2370, BRCA2=2371
| 工具 | 参数 | 说明 |
|---|---|---|
| | 不按查询条件过滤,返回按字母排序的变异列表 |
| | 返回 |
| | 不按查询条件过滤,返回按字母排序的证据条目 |
| | 返回 |
| | 搜索治疗方案 |
| | 搜索疾病 |
已知CIViC基因ID: EGFR=19, BRAF=5, ALK=1, ABL1=4, KRAS=30, TP53=45, ERBB2=20, NTRK1=197, NTRK2=560, NTRK3=561, PIK3CA=37, MET=52, ROS1=118, RET=122, BRCA1=2370, BRCA2=2371
Drug Information Tools
药物信息工具
| Tool | Parameters | Notes |
|---|---|---|
| | Returns |
| | Returns drug indications |
| | Returns |
| | Returns drug mechanisms |
| | Returns |
| | Returns FDA indications text |
| | Returns FDA MoA text |
| | Returns FDA clinical study info |
| | Returns adverse reactions |
| 工具 | 参数 | 说明 |
|---|---|---|
| | 返回 |
| | 返回药物适应症 |
| | 返回 |
| | 返回药物作用机制 |
| | 返回 |
| | 返回FDA标注的适应症文本 |
| | 返回FDA标注的作用机制文本 |
| | 返回FDA临床试验信息 |
| | 返回不良反应数据 |
Disease Ontology Tools
疾病本体工具
| Tool | Parameters | Notes |
|---|---|---|
| | Returns |
| | Get specific EFO term details |
| | Get child terms |
| 工具 | 参数 | 说明 |
|---|---|---|
| | 返回 |
| | 获取特定EFO术语详情 |
| | 获取子术语 |
Literature Tools
文献工具
| Tool | Parameters | Notes |
|---|---|---|
| | Returns list of |
| | Returns literature results |
| 工具 | 参数 | 说明 |
|---|---|---|
| | 返回 |
| | 返回文献搜索结果 |
PharmGKB Tools
PharmGKB工具
| Tool | Parameters | Notes |
|---|---|---|
| | Returns gene pharmacogenomics data |
| | Returns clinical annotations |
| 工具 | 参数 | 说明 |
|---|---|---|
| | 返回基因药物基因组学数据 |
| | 返回临床注释 |
Workflow Overview
工作流概述
Input: Patient profile (disease + biomarkers + stage + prior treatments)
Phase 1: Patient Profile Standardization
- Resolve disease to EFO/ontology IDs
- Parse molecular alterations to gene + variant
- Resolve gene symbols to Ensembl/Entrez IDs
- Classify biomarker actionability (FDA-approved vs investigational)
Phase 2: Broad Trial Discovery
- Disease-based trial search (ClinicalTrials.gov)
- Biomarker-specific trial search
- Intervention-based search (for known drugs targeting patient's biomarkers)
- Collect NCT IDs for detailed analysis
Phase 3: Trial Characterization
- Get eligibility criteria for top candidate trials
- Get conditions and interventions
- Get locations and status
- Get trial descriptions and phase information
Phase 4: Molecular Eligibility Matching
- Parse eligibility criteria text for biomarker requirements
- Match patient's molecular profile to trial requirements
- Score molecular eligibility
Phase 5: Drug-Biomarker Alignment
- Identify trial intervention drugs
- Check drug mechanisms against patient biomarkers (OpenTargets, ChEMBL)
- FDA approval status for biomarker-drug combinations
- Classify drugs (targeted therapy, immunotherapy, chemotherapy)
Phase 6: Evidence Assessment
- FDA-approved biomarker-drug combinations
- Clinical trial results for similar patients (PubMed)
- CIViC clinical evidence
- PharmGKB pharmacogenomics
- Drug safety profiles
Phase 7: Geographic & Feasibility Analysis
- Trial site locations
- Enrollment status and dates
- Distance from patient location (if provided)
Phase 8: Alternative Options
- Basket trials (biomarker-driven, tumor-agnostic)
- Expanded access and compassionate use
- Related trials with different study designs
Phase 9: Scoring & Ranking
- Calculate Trial Match Score (0-100) for each trial
- Tier classification (Optimal/Good/Possible/Exploratory)
- Rank by composite score
- Generate recommendations
Phase 10: Report Synthesis
- Executive summary (top 3 trials)
- Patient profile summary
- Ranked trial list with detailed analysis
- Alternative options
- Evidence grading
- Completeness checklistInput: Patient profile (disease + biomarkers + stage + prior treatments)
Phase 1: Patient Profile Standardization
- Resolve disease to EFO/ontology IDs
- Parse molecular alterations to gene + variant
- Resolve gene symbols to Ensembl/Entrez IDs
- Classify biomarker actionability (FDA-approved vs investigational)
Phase 2: Broad Trial Discovery
- Disease-based trial search (ClinicalTrials.gov)
- Biomarker-specific trial search
- Intervention-based search (for known drugs targeting patient's biomarkers)
- Collect NCT IDs for detailed analysis
Phase 3: Trial Characterization
- Get eligibility criteria for top candidate trials
- Get conditions and interventions
- Get locations and status
- Get trial descriptions and phase information
Phase 4: Molecular Eligibility Matching
- Parse eligibility criteria text for biomarker requirements
- Match patient's molecular profile to trial requirements
- Score molecular eligibility
Phase 5: Drug-Biomarker Alignment
- Identify trial intervention drugs
- Check drug mechanisms against patient biomarkers (OpenTargets, ChEMBL)
- FDA approval status for biomarker-drug combinations
- Classify drugs (targeted therapy, immunotherapy, chemotherapy)
Phase 6: Evidence Assessment
- FDA-approved biomarker-drug combinations
- Clinical trial results for similar patients (PubMed)
- CIViC clinical evidence
- PharmGKB pharmacogenomics
- Drug safety profiles
Phase 7: Geographic & Feasibility Analysis
- Trial site locations
- Enrollment status and dates
- Distance from patient location (if provided)
Phase 8: Alternative Options
- Basket trials (biomarker-driven, tumor-agnostic)
- Expanded access and compassionate use
- Related trials with different study designs
Phase 9: Scoring & Ranking
- Calculate Trial Match Score (0-100) for each trial
- Tier classification (Optimal/Good/Possible/Exploratory)
- Rank by composite score
- Generate recommendations
Phase 10: Report Synthesis
- Executive summary (top 3 trials)
- Patient profile summary
- Ranked trial list with detailed analysis
- Alternative options
- Evidence grading
- Completeness checklistPhase 1: Patient Profile Standardization
阶段1:患者档案标准化
Goal: Resolve all patient inputs to standardized identifiers for cross-database queries.
目标: 将所有患者输入解析为标准化标识符,用于跨数据库查询。
1.1 Disease Resolution
1.1 疾病解析
python
def resolve_disease(tu, disease_name):
"""Resolve disease name to EFO ID and standard terminology."""
# OpenTargets disease search
result = tu.tools.OpenTargets_get_disease_id_description_by_name(diseaseName=disease_name)
hits = result.get('data', {}).get('search', {}).get('hits', [])
if hits:
disease_info = hits[0]
return {
'efo_id': disease_info.get('id'),
'name': disease_info.get('name'),
'description': disease_info.get('description'),
'original_input': disease_name
}
# Fallback: OLS EFO search
ols_result = tu.tools.ols_search_efo_terms(query=disease_name, limit=5)
ols_terms = ols_result.get('data', {}).get('terms', [])
if ols_terms:
term = ols_terms[0]
return {
'efo_id': term.get('short_form'),
'name': term.get('label'),
'description': term.get('description', [''])[0] if term.get('description') else '',
'original_input': disease_name
}
return {'efo_id': None, 'name': disease_name, 'description': '', 'original_input': disease_name}Response:
{efo_id: "EFO_0003060", name: "non-small cell lung carcinoma", description: "...", original_input: "..."}python
def resolve_disease(tu, disease_name):
"""Resolve disease name to EFO/ontology IDs."""
# OpenTargets disease search
result = tu.tools.OpenTargets_get_disease_id_description_by_name(diseaseName=disease_name)
hits = result.get('data', {}).get('search', {}).get('hits', [])
if hits:
disease_info = hits[0]
return {
'efo_id': disease_info.get('id'),
'name': disease_info.get('name'),
'description': disease_info.get('description'),
'original_input': disease_name
}
# Fallback: OLS EFO search
ols_result = tu.tools.ols_search_efo_terms(query=disease_name, limit=5)
ols_terms = ols_result.get('data', {}).get('terms', [])
if ols_terms:
term = ols_terms[0]
return {
'efo_id': term.get('short_form'),
'name': term.get('label'),
'description': term.get('description', [''])[0] if term.get('description') else '',
'original_input': disease_name
}
return {'efo_id': None, 'name': disease_name, 'description': '', 'original_input': disease_name}返回结果:
{efo_id: "EFO_0003060", name: "non-small cell lung carcinoma", description: "...", original_input: "..."}1.2 Gene/Biomarker Resolution
1.2 基因/生物标志物解析
python
def resolve_gene(tu, gene_symbol):
"""Resolve gene symbol to cross-database IDs."""
# Normalize common aliases
alias_map = {
'HER2': 'ERBB2', 'HER-2': 'ERBB2',
'PD-L1': 'CD274', 'PDL1': 'CD274',
'PD-1': 'PDCD1', 'PD1': 'PDCD1',
'VEGF': 'VEGFA',
}
normalized = alias_map.get(gene_symbol.upper(), gene_symbol)
# MyGene resolution
result = tu.tools.MyGene_query_genes(query=normalized, species='human')
hits = result.get('hits', [])
gene_hit = None
for hit in hits:
if hit.get('symbol', '').upper() == normalized.upper():
gene_hit = hit
break
if not gene_hit and hits:
gene_hit = hits[0]
if gene_hit:
ensembl = gene_hit.get('ensembl', {})
ensembl_id = ensembl.get('gene') if isinstance(ensembl, dict) else (ensembl[0].get('gene') if isinstance(ensembl, list) and ensembl else None)
return {
'symbol': gene_hit.get('symbol'),
'entrez_id': gene_hit.get('entrezgene'),
'ensembl_id': ensembl_id,
'name': gene_hit.get('name'),
'original_input': gene_symbol
}
return {'symbol': gene_symbol, 'entrez_id': None, 'ensembl_id': None, 'name': None, 'original_input': gene_symbol}python
def resolve_gene(tu, gene_symbol):
"""Resolve gene symbol to cross-database IDs."""
# Normalize common aliases
alias_map = {
'HER2': 'ERBB2', 'HER-2': 'ERBB2',
'PD-L1': 'CD274', 'PDL1': 'CD274',
'PD-1': 'PDCD1', 'PD1': 'PDCD1',
'VEGF': 'VEGFA',
}
normalized = alias_map.get(gene_symbol.upper(), gene_symbol)
# MyGene resolution
result = tu.tools.MyGene_query_genes(query=normalized, species='human')
hits = result.get('hits', [])
gene_hit = None
for hit in hits:
if hit.get('symbol', '').upper() == normalized.upper():
gene_hit = hit
break
if not gene_hit and hits:
gene_hit = hits[0]
if gene_hit:
ensembl = gene_hit.get('ensembl', {})
ensembl_id = ensembl.get('gene') if isinstance(ensembl, dict) else (ensembl[0].get('gene') if isinstance(ensembl, list) and ensembl else None)
return {
'symbol': gene_hit.get('symbol'),
'entrez_id': gene_hit.get('entrezgene'),
'ensembl_id': ensembl_id,
'name': gene_hit.get('name'),
'original_input': gene_symbol
}
return {'symbol': gene_symbol, 'entrez_id': None, 'ensembl_id': None, 'name': None, 'original_input': gene_symbol}1.3 Biomarker Actionability Classification
1.3 生物标志物可行动性分类
Classify each biomarker using FDA pharmacogenomic biomarkers list:
python
def classify_biomarker_actionability(tu, gene_symbol, alteration):
"""Classify biomarker as FDA-approved, guideline, or investigational."""
# Check FDA pharmacogenomic biomarkers
fda_result = tu.tools.fda_pharmacogenomic_biomarkers()
fda_biomarkers = fda_result.get('results', [])
fda_match = [b for b in fda_biomarkers if gene_symbol.upper() in str(b.get('Biomarker', '')).upper()]
if fda_match:
return {
'level': 'FDA-approved',
'drugs': [b.get('Drug') for b in fda_match],
'labeling_sections': [b.get('LabelingSection') for b in fda_match]
}
# Check OpenTargets for drugs targeting this gene
# (done in Phase 5)
return {'level': 'investigational', 'drugs': [], 'labeling_sections': []}使用FDA药物基因组学生物标志物列表对每个生物标志物进行分类:
python
def classify_biomarker_actionability(tu, gene_symbol, alteration):
"""Classify biomarker as FDA-approved, guideline, or investigational."""
# Check FDA pharmacogenomic biomarkers
fda_result = tu.tools.fda_pharmacogenomic_biomarkers()
fda_biomarkers = fda_result.get('results', [])
fda_match = [b for b in fda_biomarkers if gene_symbol.upper() in str(b.get('Biomarker', '')).upper()]
if fda_match:
return {
'level': 'FDA-approved',
'drugs': [b.get('Drug') for b in fda_match],
'labeling_sections': [b.get('LabelingSection') for b in fda_match]
}
# Check OpenTargets for drugs targeting this gene
# (done in Phase 5)
return {'level': 'investigational', 'drugs': [], 'labeling_sections': []}1.4 Parse Molecular Alterations
1.4 分子变异解析
python
def parse_biomarker(biomarker_text):
"""Parse free-text biomarker into structured components."""
import re
# Pattern: "GENE VARIANT" (e.g., "EGFR L858R")
mutation_match = re.match(r'(\w+)\s+([A-Z]\d+[A-Z])', biomarker_text, re.IGNORECASE)
if mutation_match:
return {'gene': mutation_match.group(1), 'alteration': mutation_match.group(2), 'type': 'mutation'}
# Pattern: "GENE exon N deletion/insertion"
exon_match = re.match(r'(\w+)\s+exon\s+(\d+)\s+(\w+)', biomarker_text, re.IGNORECASE)
if exon_match:
return {'gene': exon_match.group(1), 'alteration': f'exon {exon_match.group(2)} {exon_match.group(3)}', 'type': 'exon_alteration'}
# Pattern: "GENE1-GENE2 fusion" or "GENE1/GENE2"
fusion_match = re.match(r'(\w+)[-/](\w+)\s*(fusion)?', biomarker_text, re.IGNORECASE)
if fusion_match:
return {'gene': fusion_match.group(2), 'alteration': f'{fusion_match.group(1)}-{fusion_match.group(2)}', 'type': 'fusion', 'partner': fusion_match.group(1)}
# Pattern: "GENE amplification"
amp_match = re.match(r'(\w+)\s+amplification', biomarker_text, re.IGNORECASE)
if amp_match:
return {'gene': amp_match.group(1), 'alteration': 'amplification', 'type': 'amplification'}
# Pattern: "PD-L1 XX%"
expression_match = re.match(r'([\w-]+)\s+(\d+%|high|low|positive|negative)', biomarker_text, re.IGNORECASE)
if expression_match:
return {'gene': expression_match.group(1), 'alteration': expression_match.group(2), 'type': 'expression'}
# Pattern: "MSI-high", "TMB-high"
status_match = re.match(r'(MSI|TMB|dMMR|MMR)[-\s]*(high|low|stable|deficient|proficient)', biomarker_text, re.IGNORECASE)
if status_match:
return {'gene': status_match.group(1), 'alteration': status_match.group(2), 'type': 'status'}
# Fallback: treat as gene name
return {'gene': biomarker_text.split()[0], 'alteration': ' '.join(biomarker_text.split()[1:]), 'type': 'unknown'}python
def parse_biomarker(biomarker_text):
"""Parse free-text biomarker into structured components."""
import re
# Pattern: "GENE VARIANT" (e.g., "EGFR L858R")
mutation_match = re.match(r'(\w+)\s+([A-Z]\d+[A-Z])', biomarker_text, re.IGNORECASE)
if mutation_match:
return {'gene': mutation_match.group(1), 'alteration': mutation_match.group(2), 'type': 'mutation'}
# Pattern: "GENE exon N deletion/insertion"
exon_match = re.match(r'(\w+)\s+exon\s+(\d+)\s+(\w+)', biomarker_text, re.IGNORECASE)
if exon_match:
return {'gene': exon_match.group(1), 'alteration': f'exon {exon_match.group(2)} {exon_match.group(3)}', 'type': 'exon_alteration'}
# Pattern: "GENE1-GENE2 fusion" or "GENE1/GENE2"
fusion_match = re.match(r'(\w+)[-/](\w+)\s*(fusion)?', biomarker_text, re.IGNORECASE)
if fusion_match:
return {'gene': fusion_match.group(2), 'alteration': f'{fusion_match.group(1)}-{fusion_match.group(2)}', 'type': 'fusion', 'partner': fusion_match.group(1)}
# Pattern: "GENE amplification"
amp_match = re.match(r'(\w+)\s+amplification', biomarker_text, re.IGNORECASE)
if amp_match:
return {'gene': amp_match.group(1), 'alteration': 'amplification', 'type': 'amplification'}
# Pattern: "PD-L1 XX%"
expression_match = re.match(r'([\w-]+)\s+(\d+%|high|low|positive|negative)', biomarker_text, re.IGNORECASE)
if expression_match:
return {'gene': expression_match.group(1), 'alteration': expression_match.group(2), 'type': 'expression'}
# Pattern: "MSI-high", "TMB-high"
status_match = re.match(r'(MSI|TMB|dMMR|MMR)[-\s]*(high|low|stable|deficient|proficient)', biomarker_text, re.IGNORECASE)
if status_match:
return {'gene': status_match.group(1), 'alteration': status_match.group(2), 'type': 'status'}
# Fallback: treat as gene name
return {'gene': biomarker_text.split()[0], 'alteration': ' '.join(biomarker_text.split()[1:]), 'type': 'unknown'}Phase 2: Broad Trial Discovery
阶段2:广谱临床试验发现
Goal: Cast a wide net to find all potentially relevant clinical trials.
目标: 全面检索所有潜在相关的临床试验。
2.1 Disease-Based Trial Search
2.1 基于疾病的临床试验检索
python
def search_trials_by_disease(tu, disease_name, status_filter=None, phase_filter=None, page_size=20):
"""Search ClinicalTrials.gov by disease/condition."""
query_parts = []
if status_filter:
query_parts.append(f'AREA[OverallStatus]{status_filter}')
if phase_filter:
query_parts.append(phase_filter)
query_term = ' AND '.join(query_parts) if query_parts else disease_name
result = tu.tools.search_clinical_trials(
condition=disease_name,
query_term=query_term if query_parts else disease_name,
pageSize=page_size
)
# Response: {studies: [{NCT ID, brief_title, brief_summary, overall_status, condition, phase}], nextPageToken, total_count}
if isinstance(result, str):
return [] # No studies found
return result.get('studies', [])python
def search_trials_by_disease(tu, disease_name, status_filter=None, phase_filter=None, page_size=20):
"""Search ClinicalTrials.gov by disease/condition."""
query_parts = []
if status_filter:
query_parts.append(f'AREA[OverallStatus]{status_filter}')
if phase_filter:
query_parts.append(phase_filter)
query_term = ' AND '.join(query_parts) if query_parts else disease_name
result = tu.tools.search_clinical_trials(
condition=disease_name,
query_term=query_term if query_parts else disease_name,
pageSize=page_size
)
# Response: {studies: [{NCT ID, brief_title, brief_summary, overall_status, condition, phase}], nextPageToken, total_count}
if isinstance(result, str):
return [] # No studies found
return result.get('studies', [])2.2 Biomarker-Specific Trial Search
2.2 基于生物标志物的临床试验检索
python
def search_trials_by_biomarker(tu, gene_symbol, alteration, disease_name=None, page_size=15):
"""Search trials mentioning specific biomarkers."""
# Search 1: Gene + alteration
biomarker_query = f'{gene_symbol} {alteration}' if alteration else gene_symbol
result = tu.tools.search_clinical_trials(
condition=disease_name if disease_name else '',
query_term=biomarker_query,
pageSize=page_size
)
if isinstance(result, str):
return []
return result.get('studies', [])python
def search_trials_by_biomarker(tu, gene_symbol, alteration, disease_name=None, page_size=15):
"""Search trials mentioning specific biomarkers."""
# Search 1: Gene + alteration
biomarker_query = f'{gene_symbol} {alteration}' if alteration else gene_symbol
result = tu.tools.search_clinical_trials(
condition=disease_name if disease_name else '',
query_term=biomarker_query,
pageSize=page_size
)
if isinstance(result, str):
return []
return result.get('studies', [])2.3 Intervention-Based Trial Search
2.3 基于干预措施的临床试验检索
python
def search_trials_by_intervention(tu, drug_name, disease_name=None, page_size=10):
"""Search trials by intervention/drug name."""
result = tu.tools.search_clinical_trials(
condition=disease_name if disease_name else '',
intervention=drug_name,
query_term=drug_name,
pageSize=page_size
)
if isinstance(result, str):
return []
return result.get('studies', [])python
def search_trials_by_intervention(tu, drug_name, disease_name=None, page_size=10):
"""Search trials by intervention/drug name."""
result = tu.tools.search_clinical_trials(
condition=disease_name if disease_name else '',
intervention=drug_name,
query_term=drug_name,
pageSize=page_size
)
if isinstance(result, str):
return []
return result.get('studies', [])2.4 Alternative Search (clinical_trials_search)
2.4 备选检索工具(clinical_trials_search)
Use as a complement to the main search:
python
def search_trials_alternative(tu, condition, intervention=None, limit=10):
"""Alternative trial search with different API endpoint."""
params = {
'action': 'search_studies',
'condition': condition,
'limit': limit
}
if intervention:
params['intervention'] = intervention
result = tu.tools.clinical_trials_search(**params)
return result.get('studies', [])作为主检索工具的补充:
python
def search_trials_alternative(tu, condition, intervention=None, limit=10):
"""Alternative trial search with different API endpoint."""
params = {
'action': 'search_studies',
'condition': condition,
'limit': limit
}
if intervention:
params['intervention'] = intervention
result = tu.tools.clinical_trials_search(**params)
return result.get('studies', [])2.5 Deduplication
2.5 去重
python
def deduplicate_trials(trial_lists):
"""Merge and deduplicate trials from multiple searches."""
seen_ncts = set()
unique_trials = []
for trials in trial_lists:
for trial in trials:
nct = trial.get('NCT ID') or trial.get('nctId', '')
if nct and nct not in seen_ncts:
seen_ncts.add(nct)
unique_trials.append(trial)
return unique_trialspython
def deduplicate_trials(trial_lists):
"""Merge and deduplicate trials from multiple searches."""
seen_ncts = set()
unique_trials = []
for trials in trial_lists:
for trial in trials:
nct = trial.get('NCT ID') or trial.get('nctId', '')
if nct and nct not in seen_ncts:
seen_ncts.add(nct)
unique_trials.append(trial)
return unique_trialsPhase 3: Trial Characterization
阶段3:临床试验特征分析
Goal: Get detailed information for the top candidate trials.
目标: 获取候选临床试验的详细信息。
3.1 Get Eligibility Criteria (Batch)
3.1 批量获取适配性标准
python
def get_trial_eligibility(tu, nct_ids):
"""Get eligibility criteria for multiple trials."""
# Process in batches of 10
all_criteria = []
for i in range(0, len(nct_ids), 10):
batch = nct_ids[i:i+10]
result = tu.tools.get_clinical_trial_eligibility_criteria(
nct_ids=batch,
eligibility_criteria='all'
)
if isinstance(result, list):
all_criteria.extend(result)
return all_criteria
# Returns: [{NCT ID, eligibility_criteria: "Inclusion Criteria:\n...\nExclusion Criteria:\n..."}]python
def get_trial_eligibility(tu, nct_ids):
"""Get eligibility criteria for multiple trials."""
# Process in batches of 10
all_criteria = []
for i in range(0, len(nct_ids), 10):
batch = nct_ids[i:i+10]
result = tu.tools.get_clinical_trial_eligibility_criteria(
nct_ids=batch,
eligibility_criteria='all'
)
if isinstance(result, list):
all_criteria.extend(result)
return all_criteria
# Returns: [{NCT ID, eligibility_criteria: "Inclusion Criteria:\n...\nExclusion Criteria:\n..."}]3.2 Get Conditions and Interventions (Batch)
3.2 批量获取疾病与干预措施
python
def get_trial_interventions(tu, nct_ids):
"""Get conditions, arm groups, and interventions for multiple trials."""
all_interventions = []
for i in range(0, len(nct_ids), 10):
batch = nct_ids[i:i+10]
result = tu.tools.get_clinical_trial_conditions_and_interventions(
nct_ids=batch,
condition_and_intervention='all'
)
if isinstance(result, list):
all_interventions.extend(result)
return all_interventions
# Returns: [{NCT ID, condition, arm_groups: [{label, type, description, interventionNames}], interventions: [{type, name, description}]}]python
def get_trial_interventions(tu, nct_ids):
"""Get conditions, arm groups, and interventions for multiple trials."""
all_interventions = []
for i in range(0, len(nct_ids), 10):
batch = nct_ids[i:i+10]
result = tu.tools.get_clinical_trial_conditions_and_interventions(
nct_ids=batch,
condition_and_intervention='all'
)
if isinstance(result, list):
all_interventions.extend(result)
return all_interventions
# Returns: [{NCT ID, condition, arm_groups: [{label, type, description, interventionNames}], interventions: [{type, name, description}]}]3.3 Get Locations (Batch)
3.3 批量获取试验地点
python
def get_trial_locations(tu, nct_ids):
"""Get trial site locations."""
all_locations = []
for i in range(0, len(nct_ids), 10):
batch = nct_ids[i:i+10]
result = tu.tools.get_clinical_trial_locations(
nct_ids=batch,
location='all'
)
if isinstance(result, list):
all_locations.extend(result)
return all_locations
# Returns: [{NCT ID, locations: [{facility, city, state, country}]}]python
def get_trial_locations(tu, nct_ids):
"""Get trial site locations."""
all_locations = []
for i in range(0, len(nct_ids), 10):
batch = nct_ids[i:i+10]
result = tu.tools.get_clinical_trial_locations(
nct_ids=batch,
location='all'
)
if isinstance(result, list):
all_locations.extend(result)
return all_locations
# Returns: [{NCT ID, locations: [{facility, city, state, country}]}]3.4 Get Status and Dates (Batch)
3.4 批量获取试验状态与时间
python
def get_trial_status(tu, nct_ids):
"""Get enrollment status and key dates."""
all_status = []
for i in range(0, len(nct_ids), 10):
batch = nct_ids[i:i+10]
result = tu.tools.get_clinical_trial_status_and_dates(
nct_ids=batch,
status_and_date='all'
)
if isinstance(result, list):
all_status.extend(result)
return all_status
# Returns: [{NCT ID, overall_status, start_date, primary_completion_date, completion_date}]python
def get_trial_status(tu, nct_ids):
"""Get enrollment status and key dates."""
all_status = []
for i in range(0, len(nct_ids), 10):
batch = nct_ids[i:i+10]
result = tu.tools.get_clinical_trial_status_and_dates(
nct_ids=batch,
status_and_date='all'
)
if isinstance(result, list):
all_status.extend(result)
return all_status
# Returns: [{NCT ID, overall_status, start_date, primary_completion_date, completion_date}]3.5 Get Full Descriptions (Batch)
3.5 批量获取完整试验描述
python
def get_trial_descriptions(tu, nct_ids):
"""Get detailed trial descriptions."""
all_descriptions = []
for i in range(0, len(nct_ids), 10):
batch = nct_ids[i:i+10]
result = tu.tools.get_clinical_trial_descriptions(
nct_ids=batch,
description_type='full'
)
if isinstance(result, list):
all_descriptions.extend(result)
return all_descriptions
# Returns: [{NCT ID, brief_title, official_title, brief_summary, detailed_description}]python
def get_trial_descriptions(tu, nct_ids):
"""Get detailed trial descriptions."""
all_descriptions = []
for i in range(0, len(nct_ids), 10):
batch = nct_ids[i:i+10]
result = tu.tools.get_clinical_trial_descriptions(
nct_ids=batch,
description_type='full'
)
if isinstance(result, list):
all_descriptions.extend(result)
return all_descriptions
# Returns: [{NCT ID, brief_title, official_title, brief_summary, detailed_description}]Phase 4: Molecular Eligibility Matching
阶段4:分子适配性匹配
Goal: Determine how well the patient's molecular profile matches each trial's requirements.
目标: 评估患者分子档案与各临床试验要求的匹配程度。
4.1 Parse Eligibility Text for Biomarker Requirements
4.1 从适配性文本中提取生物标志物要求
python
def extract_biomarker_requirements(eligibility_text):
"""Extract biomarker requirements from eligibility criteria text."""
import re
requirements = {
'required_biomarkers': [],
'excluded_biomarkers': [],
'biomarker_agnostic': False
}
if not eligibility_text:
return requirements
text_upper = eligibility_text.upper()
# Common biomarker patterns in eligibility text
# Required biomarkers (in inclusion criteria)
inclusion_section = eligibility_text.split('Exclusion Criteria')[0] if 'Exclusion Criteria' in eligibility_text else eligibility_text
exclusion_section = eligibility_text.split('Exclusion Criteria')[1] if 'Exclusion Criteria' in eligibility_text else ''
# Look for gene mutation requirements
gene_patterns = [
r'(?:EGFR|KRAS|BRAF|ALK|ROS1|RET|MET|NTRK|HER2|ERBB2|PIK3CA|BRCA|PD-?L1|MSI|TMB|dMMR)',
]
for pattern in gene_patterns:
# In inclusion section
for match in re.finditer(pattern, inclusion_section, re.IGNORECASE):
gene = match.group(0).upper()
context = inclusion_section[max(0, match.start()-100):match.end()+100]
requirements['required_biomarkers'].append({
'gene': gene,
'context': context.strip()
})
# In exclusion section
for match in re.finditer(pattern, exclusion_section, re.IGNORECASE):
gene = match.group(0).upper()
context = exclusion_section[max(0, match.start()-100):match.end()+100]
requirements['excluded_biomarkers'].append({
'gene': gene,
'context': context.strip()
})
# Check for biomarker-agnostic / basket trial language
basket_terms = ['tumor-agnostic', 'histology-independent', 'basket', 'any solid tumor', 'all comers', 'biomarker-selected']
if any(term in text_upper.lower() for term in basket_terms):
requirements['biomarker_agnostic'] = True
return requirementspython
def extract_biomarker_requirements(eligibility_text):
"""Extract biomarker requirements from eligibility criteria text."""
import re
requirements = {
'required_biomarkers': [],
'excluded_biomarkers': [],
'biomarker_agnostic': False
}
if not eligibility_text:
return requirements
text_upper = eligibility_text.upper()
# Common biomarker patterns in eligibility text
# Required biomarkers (in inclusion criteria)
inclusion_section = eligibility_text.split('Exclusion Criteria')[0] if 'Exclusion Criteria' in eligibility_text else eligibility_text
exclusion_section = eligibility_text.split('Exclusion Criteria')[1] if 'Exclusion Criteria' in eligibility_text else ''
# Look for gene mutation requirements
gene_patterns = [
r'(?:EGFR|KRAS|BRAF|ALK|ROS1|RET|MET|NTRK|HER2|ERBB2|PIK3CA|BRCA|PD-?L1|MSI|TMB|dMMR)',
]
for pattern in gene_patterns:
# In inclusion section
for match in re.finditer(pattern, inclusion_section, re.IGNORECASE):
gene = match.group(0).upper()
context = inclusion_section[max(0, match.start()-100):match.end()+100]
requirements['required_biomarkers'].append({
'gene': gene,
'context': context.strip()
})
# In exclusion section
for match in re.finditer(pattern, exclusion_section, re.IGNORECASE):
gene = match.group(0).upper()
context = exclusion_section[max(0, match.start()-100):match.end()+100]
requirements['excluded_biomarkers'].append({
'gene': gene,
'context': context.strip()
})
# Check for biomarker-agnostic / basket trial language
basket_terms = ['tumor-agnostic', 'histology-independent', 'basket', 'any solid tumor', 'all comers', 'biomarker-selected']
if any(term in text_upper.lower() for term in basket_terms):
requirements['biomarker_agnostic'] = True
return requirements4.2 Score Molecular Match
4.2 分子匹配评分
python
def score_molecular_match(patient_biomarkers, trial_requirements):
"""Score molecular match between patient and trial (0-40 points)."""
if not trial_requirements['required_biomarkers'] and not trial_requirements['excluded_biomarkers']:
# No molecular criteria - could be open to any
return 10, 'No specific molecular criteria (general trial)'
patient_genes = {b['gene'].upper() for b in patient_biomarkers}
required_genes = {b['gene'].upper() for b in trial_requirements['required_biomarkers']}
excluded_genes = {b['gene'].upper() for b in trial_requirements['excluded_biomarkers']}
# Check exclusions first
excluded_match = patient_genes & excluded_genes
if excluded_match:
return 0, f'Patient biomarker(s) {excluded_match} are in exclusion criteria'
if not required_genes:
return 10, 'No specific biomarker requirements found'
# Check for exact gene match
matched_genes = patient_genes & required_genes
if matched_genes:
# Check for specific variant match
# Look for specific mutation mentions in context
exact_variant_match = False
for req in trial_requirements['required_biomarkers']:
for pb in patient_biomarkers:
if pb['gene'].upper() == req['gene'].upper():
alt = pb.get('alteration', '').upper()
if alt and alt in req.get('context', '').upper():
exact_variant_match = True
break
if exact_variant_match:
return 40, f'Exact biomarker match: {matched_genes} with specific variant'
else:
return 30, f'Gene-level match: {matched_genes} (specific variant match unclear)'
# Check for pathway-level match (e.g., trial targets EGFR pathway, patient has EGFR mutation)
# This requires domain knowledge mapping
return 5, 'No direct biomarker match found'python
def score_molecular_match(patient_biomarkers, trial_requirements):
"""Score molecular match between patient and trial (0-40 points)."""
if not trial_requirements['required_biomarkers'] and not trial_requirements['excluded_biomarkers']:
# No molecular criteria - could be open to any
return 10, 'No specific molecular criteria (general trial)'
patient_genes = {b['gene'].upper() for b in patient_biomarkers}
required_genes = {b['gene'].upper() for b in trial_requirements['required_biomarkers']}
excluded_genes = {b['gene'].upper() for b in trial_requirements['excluded_biomarkers']}
# Check exclusions first
excluded_match = patient_genes & excluded_genes
if excluded_match:
return 0, f'Patient biomarker(s) {excluded_match} are in exclusion criteria'
if not required_genes:
return 10, 'No specific biomarker requirements found'
# Check for exact gene match
matched_genes = patient_genes & required_genes
if matched_genes:
# Check for specific variant match
# Look for specific mutation mentions in context
exact_variant_match = False
for req in trial_requirements['required_biomarkers']:
for pb in patient_biomarkers:
if pb['gene'].upper() == req['gene'].upper():
alt = pb.get('alteration', '').upper()
if alt and alt in req.get('context', '').upper():
exact_variant_match = True
break
if exact_variant_match:
return 40, f'Exact biomarker match: {matched_genes} with specific variant'
else:
return 30, f'Gene-level match: {matched_genes} (specific variant match unclear)'
# Check for pathway-level match (e.g., trial targets EGFR pathway, patient has EGFR mutation)
# This requires domain knowledge mapping
return 5, 'No direct biomarker match found'Phase 5: Drug-Biomarker Alignment
阶段5:药物-生物标志物匹配
Goal: Verify that trial drugs actually target the patient's biomarkers.
目标: 验证临床试验中的药物是否确实靶向患者的生物标志物。
5.1 Identify Trial Drugs and Mechanisms
5.1 识别试验药物及作用机制
python
def get_drug_mechanism_info(tu, drug_name):
"""Get drug mechanism, targets, and approval status."""
# Step 1: Resolve drug in OpenTargets
result = tu.tools.OpenTargets_get_drug_id_description_by_name(drugName=drug_name)
hits = result.get('data', {}).get('search', {}).get('hits', [])
if not hits:
return {'drug_name': drug_name, 'chembl_id': None, 'mechanisms': [], 'is_approved': False}
drug_info = hits[0]
chembl_id = drug_info.get('id')
# Step 2: Get mechanisms of action
moa_result = tu.tools.OpenTargets_get_drug_mechanisms_of_action_by_chemblId(chemblId=chembl_id)
moa_rows = moa_result.get('data', {}).get('drug', {}).get('mechanismsOfAction', {}).get('rows', [])
mechanisms = []
for row in moa_rows:
targets = row.get('targets', [])
mechanisms.append({
'mechanism': row.get('mechanismOfAction'),
'action_type': row.get('actionType'),
'target_name': row.get('targetName'),
'target_genes': [t.get('approvedSymbol') for t in targets]
})
# Step 3: Check approval
approval_result = tu.tools.OpenTargets_get_drug_approval_status_by_chemblId(chemblId=chembl_id)
return {
'drug_name': drug_name,
'chembl_id': chembl_id,
'description': drug_info.get('description'),
'mechanisms': mechanisms,
'is_approved': 'approved' in drug_info.get('description', '').lower()
}python
def get_drug_mechanism_info(tu, drug_name):
"""Get drug mechanism, targets, and approval status."""
# Step 1: Resolve drug in OpenTargets
result = tu.tools.OpenTargets_get_drug_id_description_by_name(drugName=drug_name)
hits = result.get('data', {}).get('search', {}).get('hits', [])
if not hits:
return {'drug_name': drug_name, 'chembl_id': None, 'mechanisms': [], 'is_approved': False}
drug_info = hits[0]
chembl_id = drug_info.get('id')
# Step 2: Get mechanisms of action
moa_result = tu.tools.OpenTargets_get_drug_mechanisms_of_action_by_chemblId(chemblId=chembl_id)
moa_rows = moa_result.get('data', {}).get('drug', {}).get('mechanismsOfAction', {}).get('rows', [])
mechanisms = []
for row in moa_rows:
targets = row.get('targets', [])
mechanisms.append({
'mechanism': row.get('mechanismOfAction'),
'action_type': row.get('actionType'),
'target_name': row.get('targetName'),
'target_genes': [t.get('approvedSymbol') for t in targets]
})
# Step 3: Check approval
approval_result = tu.tools.OpenTargets_get_drug_approval_status_by_chemblId(chemblId=chembl_id)
return {
'drug_name': drug_name,
'chembl_id': chembl_id,
'description': drug_info.get('description'),
'mechanisms': mechanisms,
'is_approved': 'approved' in drug_info.get('description', '').lower()
}5.2 Score Drug-Biomarker Alignment
5.2 药物-生物标志物匹配评分
python
def score_drug_biomarker_alignment(patient_gene_symbols, drug_mechanisms):
"""Check if trial drug targets patient's biomarkers."""
patient_genes_upper = {g.upper() for g in patient_gene_symbols}
for mech in drug_mechanisms:
target_genes = {g.upper() for g in mech.get('target_genes', [])}
if patient_genes_upper & target_genes:
return True, f"Drug targets {patient_genes_upper & target_genes} via {mech.get('mechanism')}"
return False, "No direct target overlap with patient biomarkers"python
def score_drug_biomarker_alignment(patient_gene_symbols, drug_mechanisms):
"""Check if trial drug targets patient's biomarkers."""
patient_genes_upper = {g.upper() for g in patient_gene_symbols}
for mech in drug_mechanisms:
target_genes = {g.upper() for g in mech.get('target_genes', [])}
if patient_genes_upper & target_genes:
return True, f"Drug targets {patient_genes_upper & target_genes} via {mech.get('mechanism')}"
return False, "No direct target overlap with patient biomarkers"Phase 6: Evidence Assessment
阶段6:证据评估
Goal: Assess evidence strength for drug efficacy in similar patient populations.
目标: 评估药物在相似患者群体中疗效的证据强度。
6.1 FDA Approval Evidence
6.1 FDA批准证据
python
def check_fda_approval(tu, drug_name, disease_name):
"""Check FDA approval status and labeled indications."""
result = tu.tools.FDA_get_indications_by_drug_name(drug_name=drug_name, limit=3)
indications = result.get('results', [])
for ind in indications:
ind_text = str(ind.get('indications_and_usage', ''))
# Check if disease is mentioned in indications
if any(term.lower() in ind_text.lower() for term in disease_name.split()):
return {
'approved': True,
'indication_text': ind_text[:500],
'brand_name': ind.get('openfda.brand_name', []),
'evidence_tier': 'T1'
}
return {'approved': False, 'indication_text': '', 'brand_name': [], 'evidence_tier': 'T3'}python
def check_fda_approval(tu, drug_name, disease_name):
"""Check FDA approval status and labeled indications."""
result = tu.tools.FDA_get_indications_by_drug_name(drug_name=drug_name, limit=3)
indications = result.get('results', [])
for ind in indications:
ind_text = str(ind.get('indications_and_usage', ''))
# Check if disease is mentioned in indications
if any(term.lower() in ind_text.lower() for term in disease_name.split()):
return {
'approved': True,
'indication_text': ind_text[:500],
'brand_name': ind.get('openfda.brand_name', []),
'evidence_tier': 'T1'
}
return {'approved': False, 'indication_text': '', 'brand_name': [], 'evidence_tier': 'T3'}6.2 Literature Evidence
6.2 文献证据
python
def get_literature_evidence(tu, gene, alteration, drug_name, disease_name):
"""Search PubMed for evidence of drug efficacy for this biomarker."""
query = f'{gene} {alteration} {drug_name} {disease_name} clinical trial'
result = tu.tools.PubMed_search_articles(query=query, max_results=5)
articles = result if isinstance(result, list) else result.get('articles', [])
return articlespython
def get_literature_evidence(tu, gene, alteration, drug_name, disease_name):
"""Search PubMed for evidence of drug efficacy for this biomarker."""
query = f'{gene} {alteration} {drug_name} {disease_name} clinical trial'
result = tu.tools.PubMed_search_articles(query=query, max_results=5)
articles = result if isinstance(result, list) else result.get('articles', [])
return articles6.3 CIViC Evidence (if available)
6.3 CIViC证据(如可用)
python
def get_civic_evidence(tu, gene_symbol, civic_gene_id):
"""Get CIViC clinical evidence for gene variants."""
if not civic_gene_id:
return []
result = tu.tools.civic_get_variants_by_gene(gene_id=civic_gene_id, limit=100)
variants = result.get('data', {}).get('gene', {}).get('variants', {}).get('nodes', [])
return variantspython
def get_civic_evidence(tu, gene_symbol, civic_gene_id):
"""Get CIViC clinical evidence for gene variants."""
if not civic_gene_id:
return []
result = tu.tools.civic_get_variants_by_gene(gene_id=civic_gene_id, limit=100)
variants = result.get('data', {}).get('gene', {}).get('variants', {}).get('nodes', [])
return variants6.4 Evidence Tier Classification
6.4 证据等级分类
| Tier | Symbol | Criteria | Score Impact |
|---|---|---|---|
| T1 | [T1] | FDA-approved biomarker-drug, NCCN guideline | 20 points |
| T2 | [T2] | Phase III positive, clinical evidence | 15 points |
| T3 | [T3] | Phase I/II results, preclinical | 10 points |
| T4 | [T4] | Computational, mechanism inference | 5 points |
| 等级 | 标识 | 标准 | 评分影响 |
|---|---|---|---|
| T1 | [T1] | FDA批准的生物标志物-药物组合,NCCN指南推荐 | +20分 |
| T2 | [T2] | III期临床试验阳性结果,临床证据充分 | +15分 |
| T3 | [T3] | I/II期临床试验结果,临床前证据 | +10分 |
| T4 | [T4] | 计算推导,机制推断 | +5分 |
Phase 7: Geographic & Feasibility Analysis
阶段7:地理与可行性分析
Goal: Assess practical feasibility of trial enrollment.
目标: 评估临床试验入组的实际可行性。
7.1 Location Analysis
7.1 地点分析
python
def analyze_trial_locations(locations_data, patient_location=None):
"""Analyze trial site locations and proximity."""
if not locations_data:
return {'total_sites': 0, 'countries': [], 'us_states': [], 'nearest': None}
locations = locations_data.get('locations', [])
countries = list(set(loc.get('country', '') for loc in locations if loc.get('country')))
us_states = list(set(loc.get('state', '') for loc in locations if loc.get('country') == 'United States' and loc.get('state')))
return {
'total_sites': len(locations),
'countries': countries,
'us_states': us_states,
'has_us_sites': 'United States' in countries,
'locations': locations[:10] # First 10 for display
}python
def analyze_trial_locations(locations_data, patient_location=None):
"""Analyze trial site locations and proximity."""
if not locations_data:
return {'total_sites': 0, 'countries': [], 'us_states': [], 'nearest': None}
locations = locations_data.get('locations', [])
countries = list(set(loc.get('country', '') for loc in locations if loc.get('country')))
us_states = list(set(loc.get('state', '') for loc in locations if loc.get('country') == 'United States' and loc.get('state')))
return {
'total_sites': len(locations),
'countries': countries,
'us_states': us_states,
'has_us_sites': 'United States' in countries,
'locations': locations[:10] # First 10 for display
}7.2 Geographic Scoring
7.2 地理评分
| Criterion | Points |
|---|---|
| Trial sites in patient's state/city | 5 |
| Trial sites within 100 miles | 3 |
| Trial sites in same country | 1 |
| No location info or far away | 0 |
| 标准 | 分值 |
|---|---|
| 试验地点位于患者所在州/城市 | 5分 |
| 试验地点位于患者100英里范围内 | 3分 |
| 试验地点位于同一国家 | 1分 |
| 无地点信息或距离过远 | 0分 |
Phase 8: Alternative Options
阶段8:备选方案
Goal: Identify basket trials, expanded access, and related studies.
目标: 识别篮式试验、扩大使用方案及相关研究。
8.1 Basket Trial Search
8.1 篮式试验检索
IMPORTANT: ClinicalTrials.gov search is sensitive to query complexity. Overly specific queries like "NTRK fusion tumor agnostic" may return zero results. Use simpler queries and combine results.
python
def search_basket_trials(tu, biomarker, page_size=10):
"""Search for basket/biomarker-driven trials.
NOTE: Use simpler queries first (e.g., 'NTRK solid tumor'),
then more specific ones. Complex multi-word queries often fail.
"""
# Start with simpler queries (more likely to return results)
query_terms = [
f'{biomarker} solid tumor',
f'{biomarker}',
f'{biomarker} basket',
]
all_trials = []
for query in query_terms:
result = tu.tools.search_clinical_trials(
query_term=query,
pageSize=page_size
)
if not isinstance(result, str):
all_trials.extend(result.get('studies', []))
return deduplicate_trials([all_trials])重要提示: ClinicalTrials.gov检索对查询复杂度敏感。过于具体的查询(如"NTRK fusion tumor agnostic")可能返回零结果。请使用简单查询并合并结果。
python
def search_basket_trials(tu, biomarker, page_size=10):
"""Search for basket/biomarker-driven trials.
NOTE: Use simpler queries first (e.g., 'NTRK solid tumor'),
then more specific ones. Complex multi-word queries often fail.
"""
# Start with simpler queries (more likely to return results)
query_terms = [
f'{biomarker} solid tumor',
f'{biomarker}',
f'{biomarker} basket',
]
all_trials = []
for query in query_terms:
result = tu.tools.search_clinical_trials(
query_term=query,
pageSize=page_size
)
if not isinstance(result, str):
all_trials.extend(result.get('studies', []))
return deduplicate_trials([all_trials])8.2 Expanded Access Search
8.2 扩大使用方案检索
python
def search_expanded_access(tu, drug_name):
"""Search for expanded access / compassionate use programs."""
result = tu.tools.search_clinical_trials(
query_term=f'{drug_name} expanded access',
pageSize=5
)
if isinstance(result, str):
return []
return result.get('studies', [])python
def search_expanded_access(tu, drug_name):
"""Search for expanded access / compassionate use programs."""
result = tu.tools.search_clinical_trials(
query_term=f'{drug_name} expanded access',
pageSize=5
)
if isinstance(result, str):
return []
return result.get('studies', [])Phase 9: Trial Match Scoring System
阶段9:临床试验匹配评分系统
Score Components (Total: 0-100)
评分组成(总分:0-100分)
Molecular Match (0-40 points):
| Criterion | Points | Description |
|---|---|---|
| Exact biomarker match | 40 | Trial requires patient's specific variant |
| Gene-level match | 30 | Trial requires gene mutation, patient has specific variant |
| Pathway match | 20 | Trial targets same pathway as patient's biomarker |
| No molecular criteria | 10 | General disease trial |
| Excluded biomarker | 0 | Patient's biomarker is in exclusion criteria |
Clinical Eligibility (0-25 points):
| Criterion | Points | Description |
|---|---|---|
| All criteria met | 25 | Disease, stage, prior treatment all match |
| Most criteria met | 18 | 1-2 criteria unclear |
| Some criteria met | 10 | Several criteria unclear |
| Clearly ineligible | 0 | Fails major criterion |
Evidence Strength (0-20 points):
| Criterion | Points | Description |
|---|---|---|
| FDA-approved combination | 20 | T1 evidence |
| Phase III positive | 15 | T2 evidence |
| Phase II promising | 10 | T3 evidence |
| Phase I or no results | 5 | T4 evidence |
Trial Phase (0-10 points):
| Phase | Points |
|---|---|
| Phase III | 10 |
| Phase II | 8 |
| Phase I/II | 6 |
| Phase I | 4 |
Geographic Feasibility (0-5 points):
| Criterion | Points |
|---|---|
| Patient's city/state | 5 |
| Same country | 3 |
| International only | 1 |
| Unknown | 0 |
分子匹配(0-40分):
| 标准 | 分值 | 说明 |
|---|---|---|
| 完全生物标志物匹配 | 40分 | 试验要求与患者特定变异完全匹配 |
| 基因层面匹配 | 30分 | 试验要求某基因变异,患者携带该基因特定变异 |
| 通路层面匹配 | 20分 | 试验靶向通路与患者生物标志物所在通路一致 |
| 无分子标准 | 10分 | 通用疾病相关试验 |
| 生物标志物被排除 | 0分 | 患者生物标志物在试验排除标准中 |
临床适配性(0-25分):
| 标准 | 分值 | 说明 |
|---|---|---|
| 所有标准均满足 | 25分 | 疾病、分期、既往治疗完全匹配 |
| 大部分标准满足 | 18分 | 1-2项标准不明确 |
| 部分标准满足 | 10分 | 多项标准不明确 |
| 明确不符合 | 0分 | 不符合主要标准 |
证据强度(0-20分):
| 标准 | 分值 | 说明 |
|---|---|---|
| FDA批准的药物-生物标志物组合 | 20分 | T1级证据 |
| III期临床试验阳性结果 | 15分 | T2级证据 |
| II期临床试验前景良好 | 10分 | T3级证据 |
| I期临床试验或无结果 | 5分 | T4级证据 |
临床试验阶段(0-10分):
| 阶段 | 分值 |
|---|---|
| III期 | 10分 |
| II期 | 8分 |
| I/II期 | 6分 |
| I期 | 4分 |
地理可行性(0-5分):
| 标准 | 分值 |
|---|---|
| 患者所在城市/州 | 5分 |
| 同一国家 | 3分 |
| 仅国际地点 | 1分 |
| 未知 | 0分 |
Recommendation Tiers
推荐分层
| Score | Tier | Label | Action |
|---|---|---|---|
| 80-100 | Tier 1 | Optimal Match | Strongly recommend - contact site immediately |
| 60-79 | Tier 2 | Good Match | Recommend - discuss with care team |
| 40-59 | Tier 3 | Possible Match | Consider - needs further eligibility review |
| 0-39 | Tier 4 | Exploratory | Backup option - consider if Tier 1-3 unavailable |
| 评分 | 层级 | 标签 | 行动建议 |
|---|---|---|---|
| 80-100 | 层级1 | 最优匹配 | 强烈推荐 - 立即联系试验站点 |
| 60-79 | 层级2 | 良好匹配 | 推荐 - 与医疗团队讨论 |
| 40-59 | 层级3 | 潜在匹配 | 考虑 - 需进一步适配性审核 |
| 0-39 | 层级4 | 探索性匹配 | 备选方案 - 仅当前三个层级无可用选项时考虑 |
Phase 10: Report Synthesis
阶段10:报告生成
Report Template
报告模板
The final report should follow this structure:
markdown
undefined最终报告应遵循以下结构:
markdown
undefinedClinical Trial Matching Report
临床试验匹配报告
Patient: [Disease type] with [biomarker(s)]
Date: [Current date]
Trials Analyzed: [N total] | Top Matches: [N with score >= 60]
患者: [疾病类型]伴[生物标志物]
日期: [当前日期]
分析试验总数: [N] | 高匹配度试验: [N个评分≥60分的试验]
Executive Summary
执行摘要
Top 3 Trial Recommendations:
-
[NCT ID] - [Brief title] (Score: XX/100, Tier N)
- Phase: [Phase], Status: [Status]
- Why: [Key reason for match]
-
[NCT ID] - [Brief title] (Score: XX/100, Tier N) ...
-
[NCT ID] - [Brief title] (Score: XX/100, Tier N) ...
Top 3 临床试验推荐:
-
[NCT ID] - [试验标题](评分: XX/100,层级N)
- 阶段: [试验阶段], 状态: [招募状态]
- 推荐理由: [核心匹配原因]
-
[NCT ID] - [试验标题](评分: XX/100,层级N) ...
-
[NCT ID] - [试验标题](评分: XX/100,层级N) ...
Patient Profile Summary
患者档案摘要
| Parameter | Value | Standardized |
|---|---|---|
| Disease | [input] | [EFO name] (EFO_XXXX) |
| Biomarker(s) | [input] | [gene: variant, type] |
| Stage | [input] | [standardized] |
| Prior Treatment | [input] | [standardized] |
| Performance Status | [input] | [ECOG score] |
| Location | [input] | [city, state] |
| 参数 | 输入值 | 标准化值 |
|---|---|---|
| 疾病 | [输入值] | [EFO名称] (EFO_XXXX) |
| 生物标志物 | [输入值] | [基因: 变异, 类型] |
| 分期 | [输入值] | [标准化分期] |
| 既往治疗 | [输入值] | [标准化治疗史] |
| 体能状态 | [输入值] | [ECOG评分] |
| 地理位置 | [输入值] | [城市, 州] |
Biomarker Actionability
生物标志物可行动性
| Biomarker | Actionability Level | FDA-Approved Drugs | Evidence |
|---|---|---|---|
| [gene variant] | [FDA-approved/investigational] | [drugs] | [T1/T2/T3/T4] |
| 生物标志物 | 可行动性等级 | FDA批准药物 | 证据等级 |
|---|---|---|---|
| [基因变异] | [FDA批准/研究性] | [药物列表] | [T1/T2/T3/T4] |
Ranked Trial Matches
排序后的临床试验匹配结果
Trial 1: [NCT ID] - [Title]
试验1: [NCT ID] - [标题]
Trial Match Score: XX/100 (Tier N: [Label])
| Component | Score | Details |
|---|---|---|
| Molecular Match | XX/40 | [explanation] |
| Clinical Eligibility | XX/25 | [explanation] |
| Evidence Strength | XX/20 | [explanation] |
| Trial Phase | XX/10 | [phase] |
| Geographic | XX/5 | [location info] |
Trial Details:
- Phase: [Phase]
- Status: [Recruiting/Active/etc.]
- Sponsor: [Sponsor]
- Start Date: [Date]
- Estimated Completion: [Date]
Interventions:
- [Drug name]: [Mechanism] | [Dosing info if available]
Molecular Eligibility Match:
- Required biomarkers: [list]
- Patient match: [Exact/Gene-level/Pathway/None]
- Notes: [details]
Clinical Eligibility Assessment:
- Disease type: [Match/Mismatch]
- Stage: [Match/Mismatch/Unclear]
- Prior treatment: [Match/Mismatch/Unclear]
- Performance status: [Match/Mismatch/Unclear]
Evidence for Efficacy:
- FDA approval: [Yes/No for this indication]
- Clinical results: [Phase III/II/I data if available]
- Mechanism alignment: [Drug targets patient's biomarker: Yes/No]
- Literature: [Key references]
Trial Sites (first 5):
- [City, State, Country]
- ...
Next Steps: [Contact info, enrollment instructions]
[Repeat for each matched trial]
匹配评分: XX/100(层级N: [标签])
| 评分项 | 得分 | 详情 |
|---|---|---|
| 分子匹配 | XX/40 | [说明] |
| 临床适配性 | XX/25 | [说明] |
| 证据强度 | XX/20 | [说明] |
| 试验阶段 | XX/10 | [阶段] |
| 地理可行性 | XX/5 | [地点信息] |
试验详情:
- 阶段: [试验阶段]
- 状态: [招募中/进行中等]
- 申办方: [申办方]
- 启动日期: [日期]
- 预计完成日期: [日期]
干预措施:
- [药物名称]: [作用机制] | [若有则提供给药信息]
分子适配性匹配:
- 要求的生物标志物: [列表]
- 患者匹配情况: [完全匹配/基因层面匹配/通路匹配/无匹配]
- 备注: [详情]
临床适配性评估:
- 疾病类型: [匹配/不匹配]
- 分期: [匹配/不匹配/不明确]
- 既往治疗: [匹配/不匹配/不明确]
- 体能状态: [匹配/不匹配/不明确]
疗效证据:
- FDA批准: [该适应症是否获批]
- 临床结果: [若有则提供III/II/I期数据]
- 机制匹配: [药物是否靶向患者生物标志物: 是/否]
- 文献: [关键参考文献]
试验站点(前5个):
- [城市, 州, 国家]
- ...
下一步行动: [联系信息, 入组说明]
[为每个匹配试验重复上述内容]
Trials by Category
临床试验分类
Targeted Therapy Trials
靶向治疗试验
[List trials with targeted agents matching patient's biomarkers]
[列出与患者生物标志物匹配的靶向治疗试验]
Immunotherapy Trials
免疫治疗试验
[List immunotherapy trials, noting PD-L1/TMB/MSI requirements]
[列出免疫治疗试验,标注PD-L1/TMB/MSI要求]
Combination Therapy Trials
联合治疗试验
[List trials with drug combinations]
[列出药物联合治疗试验]
Basket/Platform Trials
篮式/平台试验
[List biomarker-agnostic or multi-arm trials]
[列出生物标志物无关或多臂试验]
Additional Testing Recommendations
额外检测建议
If the patient has not been tested for certain biomarkers, these trials would become relevant:
| Biomarker | Test Needed | Trials Unlocked | Priority |
|---|---|---|---|
| [e.g., TMB] | [NGS panel] | [NCT IDs] | [High/Medium/Low] |
若患者未检测某些生物标志物,以下试验将变得相关:
| 生物标志物 | 所需检测 | 可解锁的临床试验 | 优先级 |
|---|---|---|---|
| [如:TMB] | [NGS panel] | [NCT ID列表] | [高/中/低] |
Alternative Options
备选方案
Expanded Access Programs
扩大使用方案
[List any expanded access or compassionate use programs]
[列出所有扩大使用或同情用药方案]
Off-Label Options
超适应症用药选项
[FDA-approved drugs for other indications with same biomarker]
[针对相同生物标志物、获批其他适应症的FDA批准药物]
Evidence Grading Summary
证据等级摘要
| Evidence Tier | Count | Description |
|---|---|---|
| T1 (FDA/Guideline) | N | FDA-approved biomarker-drug, clinical guideline |
| T2 (Clinical) | N | Phase III data, robust clinical evidence |
| T3 (Emerging) | N | Phase I/II, preclinical evidence |
| T4 (Exploratory) | N | Computational, mechanism inference |
| 证据等级 | 数量 | 说明 |
|---|---|---|
| T1 (FDA/指南) | N | FDA批准的生物标志物-药物组合,临床指南推荐 |
| T2 (临床证据) | N | III期临床试验数据,充分临床证据 |
| T3 (新兴证据) | N | I/II期临床试验,临床前证据 |
| T4 (探索性证据) | N | 计算推导,机制推断 |
Completeness Checklist
完整性检查清单
| Analysis Step | Status | Source |
|---|---|---|
| Disease standardization | [Done/Partial/Failed] | [OpenTargets/OLS] |
| Gene resolution | [Done/Partial/Failed] | [MyGene] |
| Biomarker actionability | [Done/Partial/Failed] | [FDA biomarkers] |
| Disease trial search | [Done/Partial/Failed] | [ClinicalTrials.gov] |
| Biomarker trial search | [Done/Partial/Failed] | [ClinicalTrials.gov] |
| Intervention trial search | [Done/Partial/Failed] | [ClinicalTrials.gov] |
| Eligibility parsing | [Done/Partial/Failed] | [ClinicalTrials.gov] |
| Drug mechanism analysis | [Done/Partial/Failed] | [OpenTargets/ChEMBL] |
| Evidence assessment | [Done/Partial/Failed] | [FDA/PubMed/CIViC] |
| Location analysis | [Done/Partial/Failed] | [ClinicalTrials.gov] |
| Basket trial search | [Done/Partial/Failed] | [ClinicalTrials.gov] |
| Expanded access search | [Done/Partial/Failed] | [ClinicalTrials.gov] |
| Scoring & ranking | [Done/Partial/Failed] | [Composite] |
| 分析步骤 | 状态 | 数据源 |
|---|---|---|
| 疾病标准化 | [完成/部分完成/失败] | [OpenTargets/OLS] |
| 基因解析 | [完成/部分完成/失败] | [MyGene] |
| 生物标志物可行动性 | [完成/部分完成/失败] | [FDA生物标志物数据库] |
| 疾病相关试验检索 | [完成/部分完成/失败] | [ClinicalTrials.gov] |
| 生物标志物相关试验检索 | [完成/部分完成/失败] | [ClinicalTrials.gov] |
| 干预措施相关试验检索 | [完成/部分完成/失败] | [ClinicalTrials.gov] |
| 适配性标准解析 | [完成/部分完成/失败] | [ClinicalTrials.gov] |
| 药物机制分析 | [完成/部分完成/失败] | [OpenTargets/ChEMBL] |
| 证据评估 | [完成/部分完成/失败] | [FDA/PubMed/CIViC] |
| 地点分析 | [完成/部分完成/失败] | [ClinicalTrials.gov] |
| 篮式试验检索 | [完成/部分完成/失败] | [ClinicalTrials.gov] |
| 扩大使用方案检索 | [完成/部分完成/失败] | [ClinicalTrials.gov] |
| 评分与排序 | [完成/部分完成/失败] | [综合算法] |
Disclaimer
免责声明
This report is for informational and research purposes only. Clinical trial eligibility is ultimately determined by the trial investigators based on complete medical records. Patients should discuss all options with their healthcare team. Trial availability and status may change; verify current status at ClinicalTrials.gov.
本报告仅供信息参考与研究使用。临床试验适配性最终由试验研究者根据完整医疗记录确定。患者应与医疗团队讨论所有选项。临床试验可用性与状态可能发生变化,请访问ClinicalTrials.gov核实最新状态。
Sources
数据源
All data sourced from:
- ClinicalTrials.gov (trial search, eligibility, locations, status)
- OpenTargets Platform (drug-target associations, disease ontology)
- CIViC (clinical variant interpretations)
- ChEMBL (drug mechanisms, targets)
- FDA (approved indications, pharmacogenomic biomarkers, drug labels)
- DrugBank (drug targets, indications)
- PharmGKB (pharmacogenomics)
- PubMed/NCBI (literature evidence)
- OLS/EFO (disease ontology)
- MyGene (gene identifier resolution)
---所有数据来源于:
- ClinicalTrials.gov(试验检索、适配性标准、地点、状态)
- OpenTargets平台(药物-靶点关联、疾病本体)
- CIViC(临床变异解读)
- ChEMBL(药物作用机制、靶点)
- FDA(获批适应症、药物基因组学生物标志物、药物标签)
- DrugBank(药物靶点、适应症)
- PharmGKB(药物基因组学)
- PubMed/NCBI(文献证据)
- OLS/EFO(疾病本体)
- MyGene(基因标识符解析)
---Execution Strategy
执行策略
Parallelization Opportunities
并行化机会
Many tool calls can be executed in parallel to speed up the workflow:
Parallel Group 1 (Phase 1 - can all run simultaneously):
- for each gene
MyGene_query_genes - for disease
OpenTargets_get_disease_id_description_by_name - for disease
ols_search_efo_terms - (no params)
fda_pharmacogenomic_biomarkers
Parallel Group 2 (Phase 2 - can all run simultaneously):
- with disease condition
search_clinical_trials - with biomarker query
search_clinical_trials - with intervention query
search_clinical_trials - as alternative
clinical_trials_search
Parallel Group 3 (Phase 3 - can all run simultaneously):
- for all NCT IDs
get_clinical_trial_eligibility_criteria - for all NCT IDs
get_clinical_trial_conditions_and_interventions - for all NCT IDs
get_clinical_trial_locations - for all NCT IDs
get_clinical_trial_status_and_dates - for all NCT IDs
get_clinical_trial_descriptions
Parallel Group 4 (Phases 5-6 - for each drug):
- for drug
OpenTargets_get_drug_id_description_by_name - for drug
OpenTargets_get_drug_mechanisms_of_action_by_chemblId - for drug
FDA_get_indications_by_drug_name - for evidence
PubMed_search_articles
许多工具调用可并行执行以提升工作流速度:
并行组1(阶段1 - 可同时执行):
- 每个基因调用
MyGene_query_genes - 调用解析疾病
OpenTargets_get_disease_id_description_by_name - 调用解析疾病
ols_search_efo_terms - 调用(无参数)
fda_pharmacogenomic_biomarkers
并行组2(阶段2 - 可同时执行):
- 基于疾病调用
search_clinical_trials - 基于生物标志物调用
search_clinical_trials - 基于干预措施调用
search_clinical_trials - 调用作为备选
clinical_trials_search
并行组3(阶段3 - 可同时执行):
- 为所有NCT ID调用
get_clinical_trial_eligibility_criteria - 为所有NCT ID调用
get_clinical_trial_conditions_and_interventions - 为所有NCT ID调用
get_clinical_trial_locations - 为所有NCT ID调用
get_clinical_trial_status_and_dates - 为所有NCT ID调用
get_clinical_trial_descriptions
并行组4(阶段5-6 - 针对每个药物):
- 调用解析药物
OpenTargets_get_drug_id_description_by_name - 调用获取药物作用机制
OpenTargets_get_drug_mechanisms_of_action_by_chemblId - 调用获取药物适应症
FDA_get_indications_by_drug_name - 调用获取证据
PubMed_search_articles
Error Handling
错误处理
For each tool call:
- Wrap in try/except
- Check for empty results
- Use fallback tools when primary fails
- Document what failed in completeness checklist
- Never let one failure block the entire analysis
针对每个工具调用:
- 使用try/except包裹
- 检查空结果
- 主工具失败时使用备选工具
- 在完整性检查清单中记录失败项
- 单个工具调用失败不得中断整个分析
Performance Optimization
性能优化
- Batch NCT IDs in groups of 10 for detail tools
- Limit initial search to 20-30 trials per search strategy
- Focus detailed analysis on top 15-20 candidates after initial filtering
- Cache gene/disease resolution results for reuse across phases
- 将NCT ID按10个一组批量处理详情查询工具
- 初始检索时每个策略限制返回20-30个试验
- 初始过滤后仅对前15-20个候选试验进行详细分析
- 缓存基因/疾病解析结果,跨阶段复用
Common Use Patterns
常见使用模式
Pattern 1: Targeted Therapy Matching (Most Common)
模式1:靶向治疗匹配(最常见)
Input: "NSCLC patient with EGFR L858R, failed platinum chemotherapy"
- Resolve: NSCLC -> EFO_0003060, EGFR -> ENSG00000146648
- Search: "non-small cell lung cancer" + "EGFR mutation" + "EGFR L858R"
- Filter: Recruiting trials with EGFR molecular requirements
- Match: Score trials by EGFR L858R specificity
- Drugs: Identify TKIs (osimertinib, erlotinib, etc.) in trial arms
- Evidence: Check FDA approval of EGFR TKIs for NSCLC
- Report: Prioritize targeted therapy trials, include immunotherapy options
输入: "非小细胞肺癌患者,EGFR L858R突变,铂类化疗失败"
- 解析: 非小细胞肺癌 -> EFO_0003060, EGFR -> ENSG00000146648
- 检索: "非小细胞肺癌" + "EGFR突变" + "EGFR L858R"
- 过滤: 招募中且要求EGFR分子标准的试验
- 匹配: 按EGFR L858R特异性评分
- 药物识别: 识别试验组中的TKI(奥希替尼、厄洛替尼等)
- 证据检查: 检查EGFR TKI用于非小细胞肺癌的FDA批准情况
- 报告: 优先推荐靶向治疗试验,同时包含免疫治疗选项
Pattern 2: Immunotherapy Selection
模式2:免疫治疗选择
Input: "Melanoma, TMB-high, PD-L1 positive, failed ipilimumab"
- Resolve: Melanoma -> EFO_0000756
- Search: "melanoma" + "TMB" + "PD-L1" + "immunotherapy"
- Filter: Trials requiring PD-L1 or TMB testing
- Match: Score by TMB/PD-L1 requirements
- Drugs: Identify checkpoint inhibitors (pembrolizumab, nivolumab)
- Evidence: Check FDA approval for TMB-high indications
- Report: Focus on anti-PD-1/PD-L1 trials, combination immunotherapy
输入: "黑色素瘤,TMB高表达,PD-L1阳性,伊匹单抗耐药"
- 解析: 黑色素瘤 -> EFO_0000756
- 检索: "黑色素瘤" + "TMB" + "PD-L1" + "免疫治疗"
- 过滤: 要求PD-L1或TMB检测的试验
- 匹配: 按TMB/PD-L1要求评分
- 药物识别: 识别检查点抑制剂(帕博利珠单抗、纳武利尤单抗)
- 证据检查: 检查TMB高表达适应症的FDA批准情况
- 报告: 聚焦抗PD-1/PD-L1试验及联合免疫治疗
Pattern 3: Basket Trial Identification
模式3:篮式试验识别
Input: "Any solid tumor with NTRK fusion"
- Resolve: NTRK genes (NTRK1, NTRK2, NTRK3)
- Search: "NTRK fusion" + "tumor agnostic" + "basket"
- Filter: Biomarker-agnostic trials
- Match: Score by NTRK-specific inclusion criteria
- Drugs: Identify larotrectinib, entrectinib
- Evidence: FDA tissue-agnostic approval for larotrectinib
- Report: Highlight tumor-agnostic approval, broad eligibility
输入: "任何携带NTRK融合的实体瘤"
- 解析: NTRK基因(NTRK1、NTRK2、NTRK3)
- 检索: "NTRK融合" + "tumor agnostic" + "basket"
- 过滤: 生物标志物无关的试验
- 匹配: 按NTRK特异性纳入标准评分
- 药物识别: 识别拉罗替尼、恩曲替尼
- 证据检查: 拉罗替尼的组织无关FDA批准情况
- 报告: 突出组织无关批准及广泛适配性
Pattern 4: Post-Progression Options
模式4:疾病进展后选项
Input: "Breast cancer, failed CDK4/6 inhibitors, ESR1 mutation"
- Resolve: Breast cancer -> EFO_0000305, ESR1 -> ENSG00000091831
- Search: "breast cancer" + "ESR1" + "CDK4/6 resistance"
- Filter: Trials for post-CDK4/6 setting
- Match: Score by ESR1 mutation and prior treatment requirements
- Drugs: Identify novel endocrine agents, SERDs, ESR1-targeting drugs
- Evidence: Check clinical data for post-CDK4/6 options
- Report: Focus on resistance-overcoming strategies
输入: "乳腺癌,CDK4/6抑制剂治疗失败,ESR1突变"
- 解析: 乳腺癌 -> EFO_0000305, ESR1 -> ENSG00000091831
- 检索: "乳腺癌" + "ESR1" + "CDK4/6 resistance"
- 过滤: 针对CDK4/6抑制剂治疗后场景的试验
- 匹配: 按ESR1突变及既往治疗要求评分
- 药物识别: 识别新型内分泌药物、SERDs、ESR1靶向药物
- 证据检查: 检查CDK4/6抑制剂治疗后选项的临床数据
- 报告: 聚焦克服耐药的治疗策略
Pattern 5: Geographic Search
模式5:地理定位检索
Input: "Lung cancer trials within 100 miles of Boston"
- Search: "lung cancer" (broad)
- Get locations for all candidate trials
- Filter: Sites in Massachusetts and nearby states
- Score: High geographic feasibility for Boston-area sites
- Report: Prioritize by proximity, include contact info
输入: "波士顿100英里范围内的肺癌临床试验"
- 检索: "肺癌"(广谱检索)
- 获取所有候选试验的地点
- 过滤: 位于马萨诸塞州及周边州的站点
- 评分: 为波士顿地区站点赋予高地理可行性评分
- 报告: 按距离优先级排序,包含联系信息
Edge Case Handling
边缘场景处理
No Matching Trials Found
未找到匹配临床试验
If no trials match the patient's biomarker:
- Broaden search to gene-level (remove specific variant)
- Search for pathway-level trials
- Search basket trials
- Suggest additional biomarker testing
- Report alternative options (off-label, compassionate use)
若未找到与患者生物标志物匹配的试验:
- 放宽检索至基因层面(移除特定变异)
- 检索通路层面的试验
- 检索篮式试验
- 建议额外生物标志物检测
- 报告备选方案(超适应症用药、同情用药)
Rare Biomarkers
罕见生物标志物
For uncommon mutations (e.g., unusual EGFR variants):
- Search gene-level trials (any EGFR mutation)
- Search mechanism-level trials (TKI trials)
- Check CIViC for any evidence on this specific variant
- Note variant rarity in report
- Suggest discussion with molecular tumor board
针对罕见突变(如:不常见的EGFR变异):
- 检索基因层面的试验(任何EGFR突变)
- 检索机制层面的试验(TKI试验)
- 检查CIViC中该特定变异的证据
- 在报告中注明变异罕见性
- 建议与分子肿瘤委员会讨论
Multiple Biomarkers
多生物标志物
For complex molecular profiles:
- Search for each biomarker independently
- Search for combination biomarker trials
- Identify trials that require multiple biomarkers
- Score based on most actionable biomarker
- Flag potential synergistic drug targets
针对复杂分子特征:
- 独立检索每个生物标志物
- 检索要求组合生物标志物的试验
- 识别要求多生物标志物的试验
- 基于最具可行动性的生物标志物评分
- 标记潜在的协同药物靶点
Conflicting Eligibility
适配性冲突
When patient meets some criteria but not others:
- Score partial match transparently
- Highlight which criteria are met/unmet
- Note if unmet criteria are waivable
- Suggest contacting PI for edge cases
- Provide alternative trials without conflicting criteria
患者满足部分标准但不满足其他标准时:
- 透明地给出部分匹配评分
- 突出显示满足/不满足的标准
- 注明不满足的标准是否可豁免
- 建议联系研究者处理边缘情况
- 提供无冲突标准的备选试验
Known CIViC Gene IDs
已知CIViC基因ID
For direct CIViC lookups without search:
| Gene | CIViC ID | Gene | CIViC ID |
|---|---|---|---|
| ALK | 1 | MET | 52 |
| ABL1 | 4 | PIK3CA | 37 |
| BRAF | 5 | ROS1 | 118 |
| EGFR | 19 | RET | 122 |
| ERBB2 | 20 | NTRK1 | 197 |
| KRAS | 30 | NTRK2 | 560 |
| TP53 | 45 | NTRK3 | 561 |
无需检索即可直接用于CIViC查询:
| 基因 | CIViC ID | 基因 | CIViC ID |
|---|---|---|---|
| ALK | 1 | MET | 52 |
| ABL1 | 4 | PIK3CA | 37 |
| BRAF | 5 | ROS1 | 118 |
| EGFR | 19 | RET | 122 |
| ERBB2 | 20 | NTRK1 | 197 |
| KRAS | 30 | NTRK2 | 560 |
| TP53 | 45 | NTRK3 | 561 |
Report File Naming Convention
报告文件命名规范
Save reports as:
clinical_trial_matching_[DISEASE]_[BIOMARKER]_[DATE].mdExample:
clinical_trial_matching_NSCLC_EGFR_L858R_2026-02-15.md报告保存格式:
clinical_trial_matching_[DISEASE]_[BIOMARKER]_[DATE].md示例:
clinical_trial_matching_NSCLC_EGFR_L858R_2026-02-15.md