Symphony Compare (Optional)

Overview

注意: Symphony Compare 需要使用 OpenRouter 作为提供商。这是此模块唯一支持的提供商。

symphonyCompare 智能体充当虚拟专家小组来解决模棱两可的细胞类型注释。它协调多个 AI 模型(智能体"交响乐团")来比较潜在的细胞类型,在讨论轮次中辩论它们的发现,并根据标记基因证据达成共识。

此智能体在运行默认 CASSIA 流程后特别有用,如果您不确定特定聚类的身份。例如,区分浆细胞的不同亚型。

Quick Start

results = CASSIA.symphonyCompare(
    tissue = "large intestine",
    celltypes = ["Plasma Cells", "IgA-secreting Plasma Cells", "IgG-secreting Plasma Cells"],
    marker_set = "IGLL5, IGLV6-57, JCHAIN, IGKC, TNFRSF17, IGHG1, MZB1",
    species = "human"
)

print(f"Consensus: {results['consensus']} (confidence: {results['confidence']:.1%})")
Python

Input

  • 标记基因: 来自 CASSIA 之前结果或您自己分析的逗号分隔的标记基因字符串
  • 候选细胞类型: 要比较的 2-4 种细胞类型的列表
  • 组织背景: 正在分析的组织类型
  • 物种: 样本的物种(默认:人类)

Parameters

Required Parameters

参数类型描述
tissue字符串正在分析的组织类型(例如,"large intestine")
celltypes列表要比较的 2-4 种细胞类型的列表
marker_set字符串逗号分隔的标记基因字符串

Optional Parameters

参数类型默认值描述
species字符串"human"样本的物种
model_preset字符串"budget"要使用的模型配置。"premium": 高性能组合 (Gemini 3 Pro, Claude Sonnet 4.5, GPT-5.1, Grok 4)。"budget": 具成本效益的模型 (DeepSeek V3.2, Grok 4 Fast, Kimi K2, Gemini 2.5 Flash)
output_basename字符串-输出文件的基本名称
enable_discussion布尔值True是否启用模型之间的多轮辩论

Advanced Parameters

参数类型默认值描述
max_discussion_rounds整数2最大讨论轮数
consensus_threshold浮点数0.8达成共识所需的模型比例(0-1)

Output

该函数返回包含共识结果的字典,并生成输出文件。

返回值:

  • consensus: 模型小组达成的共识细胞类型
  • confidence: 共识的置信度水平(0-1)

生成的文件:

  • {output_basename}.csv: 来自所有模型和轮次的详细比较结果、推理和分数
  • {output_basename}_report.html: 可视化辩论和共识过程的交互式 HTML 报告