35  Evidence-guided biological interpretation

Statistical enrichment results are evidence to inspect, not biological conclusions by themselves. This chapter describes how to move from enriched terms, core genes, networks, expression trends, and prior knowledge to a transparent interpretation. AI assistance is presented as an optional evidence-synthesis layer after those checks, not as a replacement for the enrichment analysis or literature review.

Enrichment results identify terms and genes associated with the input, but they do not by themselves establish a mechanism. Interpretation therefore starts with the result object, core genes, background, database provenance, and any supporting expression or network evidence.

35.1 The interpret function

interpret() accepts enrichResult, gseaResult, or compareClusterResult objects and asks an LLM to organize the supplied evidence into a structured report. The report is a draft for evidence review, not a replacement for the enrichment test or literature validation.

The function requires an API key for a provider supported by aisdk. If model is not supplied, it uses the current model from aisdk::get_model() / aisdk::set_model(); an explicit model argument overrides that default for one call. The examples below use DeepSeek through DEEPSEEK_API_KEY, but other aisdk providers can be used.

library(aisdk)

# Credentials come from the environment; a local .env file works too
if (file.exists(".env") && requireNamespace("dotenv", quietly = TRUE)) {
    dotenv::load_dot_env()
}

# Set a session-wide default model. Any provider supported by aisdk works here;
# in CI the key is supplied as the DEEPSEEK_API_KEY repository secret.
set_model("deepseek:deepseek-v4-flash")

# Check the current default model
get_model()
[1] "deepseek:deepseek-v4-flash"
library(clusterProfiler)
library(DOSE)

# A self-contained enrichment result: `edo` is built offline from the demo gene
# list shipped with DOSE, so the example depends neither on a previous chapter
# (`edo` is defined in the enrichplot chapter) nor on a network service.
data(geneList, package = "DOSE")
de <- names(geneList)[abs(geneList) > 1.5]
edo <- enrichDO(de)

# Basic usage
# 'edo' is your enrichment result object
res <- interpret(edo)

if (interpret_failed(res)) {
    stop("interpret() returned no report -- check the API key and quota:\n",
         res$overview)
}
cat(render_interpretation_blocks(res), sep = "\n")
Interpretation — cluster Default (Not returned)

Overview:

Source deconvolution indicates that the supplied enrichment terms are disease/phenotype outcomes (DOID terms), not explicit GO Biological Process, pathway, or transcription-factor terms. The significant terms fall into three major themes: a cell-cycle/DNA-replication and proliferation theme (Meier-Gorlin syndrome; stomach cancer; breast cancer; esophageal cancer and esophageal carcinoma; urinary bladder cancer; female reproductive organ cancer; in situ carcinoma), an immune/inflammatory/fibrotic and cardiovascular theme (myocarditis; cardiomyopathy; extrinsic cardiomyopathy; congestive heart failure; rheumatic disease; systemic scleroderma and scleroderma; viral infectious disease; bronchiolitis obliterans), and a metabolic/vascular theme (type 2 diabetes mellitus). Marker genes strongly reinforce these themes, with DNA replication/licensing and mitotic genes (CDC45, CDT1, MCM5, CDC6, ORC6, ORC1, CDK1, CCNB1, CCNE1, CDC25A, PLK1, AURKA, AURKB, TOP2A, MKI67, ASPM, HMMR) and inflammatory/ECM genes (S100A8, S100A9, CXCL10, CCL5, CXCL8, MMP1, MMP9, MMP12, CTLA4, ICOS, TNFRSF11B).

Regulatory drivers:

  • No explicit upstream-regulator or TF enrichment term was supplied, so regulatory drivers are restricted to TFs represented among the highest-fold markers or disease gene lists. Candidate drivers include FOXM1 (2305, a top marker and present in stomach cancer and type 2 diabetes mellitus), EZH2 (2146, present in stomach cancer, breast cancer, esophageal cancer, urinary bladder cancer, and female reproductive organ cancer), MYBL2 (4605, a top marker consistent with the G2/M module), FOSL1 (8061, present in stomach cancer, female reproductive organ cancer, in situ carcinoma, and congestive heart failure), AR (367, present in breast cancer, female reproductive organ cancer, and type 2 diabetes mellitus), FOXA1 (3169, present in stomach cancer, esophageal cancer, esophageal carcinoma, and esophagus squamous cell carcinoma), and TBX3 (6926, present in stomach cancer and female reproductive organ cancer). These TFs are positioned to connect the proliferative and inflammatory/fibrotic disease modules, but their driver status is inferred from gene membership rather than from a TF enrichment result.

Key mechanisms:

The mechanisms group into four modules. First, a DNA replication-origin licensing module is directly supported by Meier-Gorlin syndrome genes CDC45 (8318), CDT1 (81620), MCM5 (4174), CDC6 (990), ORC6 (23594), and ORC1 (4998). Second, a mitotic/proliferation module is supported by cancer terms including stomach cancer, breast cancer, esophageal cancer, esophageal carcinoma, esophagus squamous cell carcinoma, urinary bladder cancer, female reproductive organ cancer, and in situ carcinoma, with genes such as CDK1 (983), CCNB1 (891), CCNE1 (898), CDC25A (993), PLK1 (5347), AURKA (6790), AURKB (9212), RRM2 (6241), TOP2A (7153), MKI67 (4288), ASPM (259266), and HMMR (3161). Third, an immune/inflammatory and ECM-remodeling module is supported by myocarditis, cardiomyopathy, extrinsic cardiomyopathy, congestive heart failure, rheumatic disease, systemic scleroderma/scleroderma, viral infectious disease, and bronchiolitis obliterans, with S100A8 (6279), S100A9 (6280), CXCL10 (3627), CCL5 (6352), CXCL8 (3576), MMP1 (4312), MMP9 (4318), MMP12 (4321), CTLA4 (1493), ICOS (29851), TNFRSF11B (4982), and HLA-DQA1 (3117). Fourth, a metabolic/vascular module is supported by type 2 diabetes mellitus, which shares FOXM1 (2305), CXCL10 (3627), CCL5 (6352), IKBKB (3551), IGF1 (3479), AGTR1 (185), AR (367), and HLA-DQA1 (3117).

Crosstalk and interactions:

The modules are not independent. S100A8/S100A9, CXCL10, CCL5, CTLA4, and ICOS co-occur in myocarditis, cardiomyopathy, and viral infectious disease, linking innate inflammation to T-cell co-signaling. MMP1, MMP9, MMP12, CXCL8, and CCL5 co-occur across stomach cancer, esophageal cancer, scleroderma, viral infectious disease, type 2 diabetes mellitus, and congestive heart failure, connecting ECM remodeling to chemokine-driven immune recruitment. DNA replication-licensing genes from Meier-Gorlin syndrome (CDC45, CDT1, MCM5, CDC6, ORC6, ORC1) connect developmentally to the mitotic kinase module seen in cancers (CDK1, CCNB1, CCNE1, CDC25A, PLK1, AURKA, AURKB, TOP2A, MKI67). Candidate TFs FOXM1, EZH2, MYBL2, FOSL1, AR, FOXA1, and TBX3 provide potential regulatory bridges between proliferation and inflammatory/fibrotic gene sets.

Hypothesis:

The enriched disease terms likely reflect a shared cross-tissue program rather than a single disease entity: a proliferative DNA-replication/mitotic module (Meier-Gorlin syndrome; stomach, breast, esophageal, urinary bladder, female reproductive, and in situ cancers) combined with an inflammatory/ECM-remodeling module (myocarditis, cardiomyopathy, congestive heart failure, scleroderma/rheumatic disease, viral infectious disease, bronchiolitis obliterans, and type 2 diabetes mellitus). The So What is that the experimental signal may represent a proliferative progenitor or tumor-like state accompanied by innate/adaptive immune activation and fibrotic remodeling, with candidate hubs such as FOXM1/EZH2/MYBL2, CDK1/PLK1/AURKA, S100A8/A9, MMP1/MMP9, and CXCL10/CCL5/CTLA4 coordinating the phenotype.

Narrative draft:

In this analysis, the top enriched terms were disease and phenotype terms rather than explicit GO Biological Process or transcription-factor terms. The strongest and most coherent theme was cell-cycle and DNA-replication activity, supported by Meier-Gorlin syndrome genes CDC45, CDT1, MCM5, CDC6, ORC6, and ORC1, and by a broader mitotic/proliferation module shared across stomach cancer, breast cancer, esophageal cancer and esophageal carcinoma, urinary bladder cancer, female reproductive organ cancer, and in situ carcinoma. A second major theme was immune/inflammatory and ECM remodeling, supported by myocarditis, cardiomyopathy, extrinsic cardiomyopathy, congestive heart failure, rheumatic disease, systemic scleroderma/scleroderma, viral infectious disease, and bronchiolitis obliterans, with S100A8/S100A9, CXCL10, CCL5, CXCL8, MMP1, MMP9, MMP12, CTLA4, ICOS, and TNFRSF11B. Type 2 diabetes mellitus formed a metabolic/vascular theme sharing inflammatory and vascular genes such as FOXM1, CXCL10, CCL5, IKBKB, IGF1, AGTR1, AR, and HLA-DQA1. Together, these results suggest that the biological signal is a combined proliferation-inflammatory-fibrotic program, and that the enriched disease phenotypes are downstream readouts of shared modules rather than unrelated pathologies.

Network evidence:

Specific modules support the conclusion. The Meier-Gorlin syndrome gene set defines an origin-licensing complex involving ORC1, ORC6, CDC6, CDT1, MCM5, and CDC45. Cancer terms define a mitotic kinase/proliferation module containing CDK1, CCNB1, CCNE1, CDC25A, PLK1, AURKA, AURKB, TOP2A, MKI67, ASPM, and HMMR. Myocarditis and cardiomyopathy terms define an S100A8/S100A9-chemokine-T-cell module containing S100A8, S100A9, CXCL10, CCL5, CTLA4, ICOS, and TNFRSF11B. Scleroderma, cardiomyopathy, cancer, and type 2 diabetes mellitus terms define an ECM/inflammatory module containing MMP1, MMP9, MMP12, TGFB2, SPARC, CXCL8, and AGTR1. These modules, rather than isolated genes, support a combined proliferation-inflammatory-fibrotic interpretation of the enrichment results.

Raw object print
## Interpretation Result

### Cluster: Default

### 1. Overview
Source deconvolution indicates that the supplied enrichment terms are disease/phenotype outcomes (DOID terms), not explicit GO Biological Process, pathway, or transcription-factor terms. The significant terms fall into three major themes: a cell-cycle/DNA-replication and proliferation theme (Meier-Gorlin syndrome; stomach cancer; breast cancer; esophageal cancer and esophageal carcinoma; urinary bladder cancer; female reproductive organ cancer; in situ carcinoma), an immune/inflammatory/fibrotic and cardiovascular theme (myocarditis; cardiomyopathy; extrinsic cardiomyopathy; congestive heart failure; rheumatic disease; systemic scleroderma and scleroderma; viral infectious disease; bronchiolitis obliterans), and a metabolic/vascular theme (type 2 diabetes mellitus). Marker genes strongly reinforce these themes, with DNA replication/licensing and mitotic genes (CDC45, CDT1, MCM5, CDC6, ORC6, ORC1, CDK1, CCNB1, CCNE1, CDC25A, PLK1, AURKA, AURKB, TOP2A, MKI67, ASPM, HMMR) and inflammatory/ECM genes (S100A8, S100A9, CXCL10, CCL5, CXCL8, MMP1, MMP9, MMP12, CTLA4, ICOS, TNFRSF11B). 

### 2. Regulatory Drivers
No explicit upstream-regulator or TF enrichment term was supplied, so regulatory drivers are restricted to TFs represented among the highest-fold markers or disease gene lists. Candidate drivers include FOXM1 (2305, a top marker and present in stomach cancer and type 2 diabetes mellitus), EZH2 (2146, present in stomach cancer, breast cancer, esophageal cancer, urinary bladder cancer, and female reproductive organ cancer), MYBL2 (4605, a top marker consistent with the G2/M module), FOSL1 (8061, present in stomach cancer, female reproductive organ cancer, in situ carcinoma, and congestive heart failure), AR (367, present in breast cancer, female reproductive organ cancer, and type 2 diabetes mellitus), FOXA1 (3169, present in stomach cancer, esophageal cancer, esophageal carcinoma, and esophagus squamous cell carcinoma), and TBX3 (6926, present in stomach cancer and female reproductive organ cancer). These TFs are positioned to connect the proliferative and inflammatory/fibrotic disease modules, but their driver status is inferred from gene membership rather than from a TF enrichment result. 

### 3. Key Mechanisms
The mechanisms group into four modules. First, a DNA replication-origin licensing module is directly supported by Meier-Gorlin syndrome genes CDC45 (8318), CDT1 (81620), MCM5 (4174), CDC6 (990), ORC6 (23594), and ORC1 (4998). Second, a mitotic/proliferation module is supported by cancer terms including stomach cancer, breast cancer, esophageal cancer, esophageal carcinoma, esophagus squamous cell carcinoma, urinary bladder cancer, female reproductive organ cancer, and in situ carcinoma, with genes such as CDK1 (983), CCNB1 (891), CCNE1 (898), CDC25A (993), PLK1 (5347), AURKA (6790), AURKB (9212), RRM2 (6241), TOP2A (7153), MKI67 (4288), ASPM (259266), and HMMR (3161). Third, an immune/inflammatory and ECM-remodeling module is supported by myocarditis, cardiomyopathy, extrinsic cardiomyopathy, congestive heart failure, rheumatic disease, systemic scleroderma/scleroderma, viral infectious disease, and bronchiolitis obliterans, with S100A8 (6279), S100A9 (6280), CXCL10 (3627), CCL5 (6352), CXCL8 (3576), MMP1 (4312), MMP9 (4318), MMP12 (4321), CTLA4 (1493), ICOS (29851), TNFRSF11B (4982), and HLA-DQA1 (3117). Fourth, a metabolic/vascular module is supported by type 2 diabetes mellitus, which shares FOXM1 (2305), CXCL10 (3627), CCL5 (6352), IKBKB (3551), IGF1 (3479), AGTR1 (185), AR (367), and HLA-DQA1 (3117). 

### 4. Crosstalk & Interactions
The modules are not independent. S100A8/S100A9, CXCL10, CCL5, CTLA4, and ICOS co-occur in myocarditis, cardiomyopathy, and viral infectious disease, linking innate inflammation to T-cell co-signaling. MMP1, MMP9, MMP12, CXCL8, and CCL5 co-occur across stomach cancer, esophageal cancer, scleroderma, viral infectious disease, type 2 diabetes mellitus, and congestive heart failure, connecting ECM remodeling to chemokine-driven immune recruitment. DNA replication-licensing genes from Meier-Gorlin syndrome (CDC45, CDT1, MCM5, CDC6, ORC6, ORC1) connect developmentally to the mitotic kinase module seen in cancers (CDK1, CCNB1, CCNE1, CDC25A, PLK1, AURKA, AURKB, TOP2A, MKI67). Candidate TFs FOXM1, EZH2, MYBL2, FOSL1, AR, FOXA1, and TBX3 provide potential regulatory bridges between proliferation and inflammatory/fibrotic gene sets. 

### 5. Hypothesis
The enriched disease terms likely reflect a shared cross-tissue program rather than a single disease entity: a proliferative DNA-replication/mitotic module (Meier-Gorlin syndrome; stomach, breast, esophageal, urinary bladder, female reproductive, and in situ cancers) combined with an inflammatory/ECM-remodeling module (myocarditis, cardiomyopathy, congestive heart failure, scleroderma/rheumatic disease, viral infectious disease, bronchiolitis obliterans, and type 2 diabetes mellitus). The So What is that the experimental signal may represent a proliferative progenitor or tumor-like state accompanied by innate/adaptive immune activation and fibrotic remodeling, with candidate hubs such as FOXM1/EZH2/MYBL2, CDK1/PLK1/AURKA, S100A8/A9, MMP1/MMP9, and CXCL10/CCL5/CTLA4 coordinating the phenotype. 

### 6. Narrative Draft
In this analysis, the top enriched terms were disease and phenotype terms rather than explicit GO Biological Process or transcription-factor terms. The strongest and most coherent theme was cell-cycle and DNA-replication activity, supported by Meier-Gorlin syndrome genes CDC45, CDT1, MCM5, CDC6, ORC6, and ORC1, and by a broader mitotic/proliferation module shared across stomach cancer, breast cancer, esophageal cancer and esophageal carcinoma, urinary bladder cancer, female reproductive organ cancer, and in situ carcinoma. A second major theme was immune/inflammatory and ECM remodeling, supported by myocarditis, cardiomyopathy, extrinsic cardiomyopathy, congestive heart failure, rheumatic disease, systemic scleroderma/scleroderma, viral infectious disease, and bronchiolitis obliterans, with S100A8/S100A9, CXCL10, CCL5, CXCL8, MMP1, MMP9, MMP12, CTLA4, ICOS, and TNFRSF11B. Type 2 diabetes mellitus formed a metabolic/vascular theme sharing inflammatory and vascular genes such as FOXM1, CXCL10, CCL5, IKBKB, IGF1, AGTR1, AR, and HLA-DQA1. Together, these results suggest that the biological signal is a combined proliferation-inflammatory-fibrotic program, and that the enriched disease phenotypes are downstream readouts of shared modules rather than unrelated pathologies. 

### 7. Refined Regulatory Network
Key Interactions:
  FOXM1 -- CDK1 (transcriptional activation) - FOXM1 is a top marker and CDK1 is part of the breast cancer proliferation module; both support G2/M cell-cycle progression.
  FOXM1 -- AURKA (transcriptional activation) - FOXM1 is a top marker and AURKA is co-enriched in breast cancer; both belong to the mitotic kinase module.
  EZH2 -- CDK1 (co-regulation) - EZH2 and CDK1 are co-enriched in breast cancer, linking epigenetic regulation to cell-cycle progression.
  FOXM1 -- EZH2 (epigenetic regulation) - EZH2 and FOXM1 are co-enriched in stomach cancer, supporting a proliferative TF module.
  MYBL2 -- CCNB1 (transcriptional activation) - MYBL2 is a top marker and CCNB1 is co-enriched in breast cancer; both are G2/M proliferation genes.
  CDT1 -- CDC45 (co-complex) - Both are in the Meier-Gorlin syndrome DNA replication-origin licensing module.
  CDT1 -- ORC1 (recruitment) - Both are in Meier-Gorlin syndrome; ORC1 and CDT1 act in replication-origin licensing.
  CDT1 -- CDC6 (co-complex) - Both are in the Meier-Gorlin syndrome replication-licensing module.
  S100A8 -- S100A9 (binding) - S100A8 and S100A9 are co-enriched in myocarditis, cardiomyopathy, and urinary bladder cancer, consistent with S100A8/S100A9 heterodimer function.
  S100A8 -- CXCL10 (activation) - S100A8/S100A9 and CXCL10 are co-enriched in myocarditis, linking innate inflammation to chemokine signaling.
  CXCL10 -- CTLA4 (recruitment) - CXCL10 and CTLA4 are co-enriched in myocarditis, connecting chemokine signaling to T-cell regulation.
  CTLA4 -- ICOS (co-regulation) - CTLA4 and ICOS are co-enriched in myocarditis, supporting T-cell co-signaling crosstalk.
  MMP1 -- MMP9 (co-regulation) - MMP1 and MMP9 are co-enriched in stomach cancer, esophageal cancer, scleroderma, viral infectious disease, and type 2 diabetes mellitus, supporting ECM remodeling.
  MMP9 -- CXCL8 (activation) - MMP9 and CXCL8 are co-enriched in stomach cancer and esophageal cancer, linking ECM degradation to chemokine inflammation.
  MMP9 -- FOSL1 (transcriptional activation) - FOSL1 and MMP9 are co-enriched in stomach cancer, supporting an AP-1/MMP inflammatory program.
  CTLA4 -- CCL5 (recruitment) - CCL5 and CTLA4 are co-enriched in breast cancer and viral infectious disease, connecting chemokine recruitment to T-cell regulation.
  AR -- FOXA1 (transcriptional regulation) - AR and FOXA1 are co-enriched in breast cancer, supporting a TF-driven breast cancer module.
  TGFB2 -- SPARC (activation) - TGFB2 and SPARC are co-enriched in cardiomyopathy, supporting a fibrotic ECM module.
  TGFB2 -- AGTR1 (activation) - AGTR1 and TGFB2 are co-enriched in cardiomyopathy, linking vascular signaling to fibrosis.
  AGTR1 -- IGF1 (co-regulation) - IGF1 and AGTR1 are co-enriched in type 2 diabetes mellitus, supporting a metabolic/vascular signaling module.

**Network Evidence:**
Specific modules support the conclusion. The Meier-Gorlin syndrome gene set defines an origin-licensing complex involving ORC1, ORC6, CDC6, CDT1, MCM5, and CDC45. Cancer terms define a mitotic kinase/proliferation module containing CDK1, CCNB1, CCNE1, CDC25A, PLK1, AURKA, AURKB, TOP2A, MKI67, ASPM, and HMMR. Myocarditis and cardiomyopathy terms define an S100A8/S100A9-chemokine-T-cell module containing S100A8, S100A9, CXCL10, CCL5, CTLA4, ICOS, and TNFRSF11B. Scleroderma, cardiomyopathy, cancer, and type 2 diabetes mellitus terms define an ECM/inflammatory module containing MMP1, MMP9, MMP12, TGFB2, SPARC, CXCL8, and AGTR1. These modules, rather than isolated genes, support a combined proliferation-inflammatory-fibrotic interpretation of the enrichment results. 

35.1.1 Tasks and Inputs

interpret() supports three tasks:

  • task = "interpretation": organize enrichment evidence into a biological narrative;
  • task = "annotation": combine marker genes and enrichment terms for cell-type annotation;
  • task = "phenotyping": propose a state or phenotype label for a group.

The input can be one result object, a list of compatible objects, or a compareCluster result processed by cluster. For example, list(go_res, kegg_res) combines compatible knowledge sources, while a compareCluster result returns one report per cluster. The returned fields are structured so that reports can be checked, compared, and rendered consistently.

For single-cell data, the marker table can come from Seurat::FindAllMarkers() or another marker-calling method. Keep the cluster and gene columns, use the same identifier namespace in the marker and CellMarker tables, and pass the grouped markers through compareCluster() before annotation. The executable example below uses the repository-local CellMarker table so that it does not depend on a separate count matrix or a pasted annotation report. A complete Seurat marker workflow is available in the pbmc3k tutorial.

35.1.2 Cell Type Annotation

The cell-type example reads the local datasets/Cell_marker_Human.xlsx marker table, builds four marker profiles, runs compareCluster() with enricher(), and passes the result to interpret(task = "annotation") when DEEPSEEK_API_KEY is available.

library(clusterProfiler)
library(readxl)
library(dplyr)

cell_marker_path <- file.path("datasets", "Cell_marker_Human.xlsx")
if (!file.exists(cell_marker_path)) {
    stop("The cell-marker dataset is missing: ", cell_marker_path)
}

cell_marker <- readxl::read_excel(cell_marker_path)
TERM2GENE_cell <- cell_marker |>
    transmute(
        cell_name = .data[["Cell name"]],
        marker = toupper(.data[["Marker"]])
    ) |>
    filter(
        !is.na(cell_name), !is.na(marker),
        nzchar(cell_name), nzchar(marker)
    ) |>
    distinct()

# A compact marker panel keeps the example transparent and the prompt small.
marker_sets <- list(
    T_cell = c("CD3D", "CD3E", "TRBC1", "IL7R", "LTB", "MAL", "CCR7", "LST1"),
    B_cell = c("CD79A", "MS4A1", "CD37", "CD79B", "HLA-DRA", "CD74", "BANK1"),
    Monocyte = c("LYZ", "S100A8", "S100A9", "CTSS", "FCN1", "LGALS3", "TYROBP", "LST1"),
    NK_cell = c("NKG7", "GNLY", "PRF1", "GZMB", "KLRD1", "FCGR3A", "XCL1", "XCL2")
)
marker_table <- do.call(
    rbind,
    lapply(names(marker_sets), function(cluster) {
        data.frame(
            cluster = cluster,
            gene = marker_sets[[cluster]],
            stringsAsFactors = FALSE
        )
    })
)

cell_marker_enrichment <- compareCluster(
    gene ~ cluster,
    data = marker_table,
    fun = enricher,
    TERM2GENE = TERM2GENE_cell,
    pvalueCutoff = 1,
    qvalueCutoff = 1,
    minGSSize = 2,
    maxGSSize = 500
)

annotation_reports <- interpret(
    cell_marker_enrichment,
    task = "annotation",
    context = paste(
        "Human single-cell marker panels. Each cluster is a compact set of",
        "top marker genes and was tested against the local CellMarker database.",
        "Use the enrichment terms as supporting evidence, but prefer markers",
        "that distinguish closely related cell types. Return a concise label",
        "and explain which supplied markers and cell-marker terms support it."
    ),
    n_pathways = 12,
    max_tokens = 4096,
    temperature = 0.1
)

if (inherits(annotation_reports, "interpretation")) {
    annotation_reports <- list(Default = annotation_reports)
}
if (!is.list(annotation_reports) || length(annotation_reports) == 0) {
    stop("DeepSeek returned no cell-type annotation reports.")
}
for (report in annotation_reports) {
    if (annotation_failed(report)) {
        stop(
            "DeepSeek cell-type annotation failed for cluster ",
            if (!is.null(report$cluster)) report$cluster else "(unknown)",
            ": ",
            if (!is.null(report$overview)) report$overview else "no diagnostic returned"
        )
    }
}

The result below is generated from the live object returned by DeepSeek. It is rendered as an HTML block, not Markdown headings: the preview is readable in the chapter, while the raw print() output remains available in a collapsed section without entering the book’s table of contents.

cat(render_interpretation_blocks(annotation_reports), sep = "\n")
Cluster B_cell: Cell type: Follicular B cell (High)

Cell type:

Follicular B cell

Confidence:

High

Reasoning:

The top enriched term ‘Follicular B cell’ matches 5/7 supplied markers (CD79A, MS4A1, CD79B, CD74, BANK1; p.adjust 1.03e-10). Competing B-cell terms are less specific: ‘Mature B cell’ uses CD79A/CD37/HLA-DRA/CD74 but lacks MS4A1, CD79B, and BANK1; ‘Naive B cell’ uses CD79A/MS4A1/CD37/CD74 but lacks CD79B and BANK1. The presence of MS4A1 together with CD79B and BANK1 supports follicular B cell identity over naive/mature B cell alternatives. HLA-DRA/CD74 and CD79A/CD79B indicate MHC class II antigen presentation and B-cell receptor signaling, consistent with a mature follicular B-cell state.

Supporting markers/pathways:

  • CD79A
  • MS4A1
  • CD37
  • CD79B
  • HLA-DRA
  • CD74
  • BANK1
Raw object print
## Cell Type Annotation

### Cluster: B_cell

**Cell Type:** Follicular B cell
**Confidence:** High

**Reasoning:**
 The top enriched term 'Follicular B cell' matches 5/7 supplied markers (CD79A, MS4A1, CD79B, CD74, BANK1; p.adjust 1.03e-10). Competing B-cell terms are less specific: 'Mature B cell' uses CD79A/CD37/HLA-DRA/CD74 but lacks MS4A1, CD79B, and BANK1; 'Naive B cell' uses CD79A/MS4A1/CD37/CD74 but lacks CD79B and BANK1. The presence of MS4A1 together with CD79B and BANK1 supports follicular B cell identity over naive/mature B cell alternatives. HLA-DRA/CD74 and CD79A/CD79B indicate MHC class II antigen presentation and B-cell receptor signaling, consistent with a mature follicular B-cell state. 

**Supporting Markers/Pathways:**
- CD79A
- MS4A1
- CD37
- CD79B
- HLA-DRA
- CD74
- BANK1 
Cluster Monocyte: Cell type: Classical monocyte (Medium)

Cell type:

Classical monocyte

Confidence:

Medium

Reasoning:

The supplied marker set is dominated by myeloid/monocyte genes: LYZ, S100A8, S100A9, FCN1, CTSS, TYROBP, LST1, and LGALS3. The Classical monocyte term directly contains LYZ/S100A8/S100A9/FCN1, and CD14 monocyte contains LYZ/S100A8/FCN1. Although Myeloid cell and Macrophage terms match 7/8 genes, they are broader/shared myeloid labels, and the input lacks canonical macrophage-discriminating markers such as CD68, MRC1, or CD163. Neutrophil matches 5/8 but lacks FCN1 and the classical monocyte signature. Therefore the best-supported label is Classical monocyte, with medium confidence because several markers are shared across myeloid subsets and no direct CD14/CD16 readout is provided.

Supporting markers/pathways:

  • LYZ
  • S100A8
  • S100A9
  • FCN1
  • CTSS
  • TYROBP
  • LST1
  • LGALS3
Raw object print
## Cell Type Annotation

### Cluster: Monocyte

**Cell Type:** Classical monocyte
**Confidence:** Medium

**Reasoning:**
 The supplied marker set is dominated by myeloid/monocyte genes: LYZ, S100A8, S100A9, FCN1, CTSS, TYROBP, LST1, and LGALS3. The Classical monocyte term directly contains LYZ/S100A8/S100A9/FCN1, and CD14 monocyte contains LYZ/S100A8/FCN1. Although Myeloid cell and Macrophage terms match 7/8 genes, they are broader/shared myeloid labels, and the input lacks canonical macrophage-discriminating markers such as CD68, MRC1, or CD163. Neutrophil matches 5/8 but lacks FCN1 and the classical monocyte signature. Therefore the best-supported label is Classical monocyte, with medium confidence because several markers are shared across myeloid subsets and no direct CD14/CD16 readout is provided. 

**Supporting Markers/Pathways:**
- LYZ
- S100A8
- S100A9
- FCN1
- CTSS
- TYROBP
- LST1
- LGALS3 
Cluster NK_cell: Cell type: Natural killer cell (High)

Cell type:

Natural killer cell

Confidence:

High

Reasoning:

The top enriched term is Natural killer cell with 8/8 marker-gene coverage and p.adjust 1.03e-12, including all supplied cluster markers NKG7, GNLY, PRF1, GZMB, KLRD1, FCGR3A, XCL1, and XCL2. Although CD8+ T cell and cytotoxic T-cell terms are also enriched, they cover only 6/8 and lack the XCL1/XCL2 component present in the NK term. No CD3 or CD8A/CD8B markers are supplied to support a T-cell assignment. KLRD1 and FCGR3A further support NK identity, while the shared PRF1/GZMB/GNLY/NKG7 profile supports a cytotoxic NK effector state.

Supporting markers/pathways:

  • NKG7
  • GNLY
  • PRF1
  • GZMB
  • KLRD1
  • FCGR3A
  • XCL1
  • XCL2
Raw object print
## Cell Type Annotation

### Cluster: NK_cell

**Cell Type:** Natural killer cell
**Confidence:** High

**Reasoning:**
 The top enriched term is Natural killer cell with 8/8 marker-gene coverage and p.adjust 1.03e-12, including all supplied cluster markers NKG7, GNLY, PRF1, GZMB, KLRD1, FCGR3A, XCL1, and XCL2. Although CD8+ T cell and cytotoxic T-cell terms are also enriched, they cover only 6/8 and lack the XCL1/XCL2 component present in the NK term. No CD3 or CD8A/CD8B markers are supplied to support a T-cell assignment. KLRD1 and FCGR3A further support NK identity, while the shared PRF1/GZMB/GNLY/NKG7 profile supports a cytotoxic NK effector state. 

**Supporting Markers/Pathways:**
- NKG7
- GNLY
- PRF1
- GZMB
- KLRD1
- FCGR3A
- XCL1
- XCL2 
Cluster T_cell: Cell type: Naive CD8+ T cell (Medium)

Cell type:

Naive CD8+ T cell

Confidence:

Medium

Reasoning:

The cluster is T-lineage by CD3D, CD3E, and TRBC1, which are present in the general T cell term (7/8). Among subtype terms, Naive CD8+ T cell has 6/8 matching markers (CD3D, CD3E, IL7R, LTB, MAL, CCR7), whereas the top Memory CD8+ T cell term matches only 5/8 and lacks MAL. The naive/central-memory markers CCR7, IL7R, LTB, and MAL support a naive T-cell state, and MAL specifically favors Naive CD8+ over Memory CD8+ in the supplied enrichment. However, CD4 and CD8A/CD8B are not in the marker list, and the CD4+ T cell term shares the same 6/8 gene set, so CD4 vs CD8 subtype resolution is limited; confidence is therefore Medium.

Supporting markers/pathways:

  • CD3D
  • CD3E
  • TRBC1
  • IL7R
  • LTB
  • MAL
  • CCR7
Raw object print
## Cell Type Annotation

### Cluster: T_cell

**Cell Type:** Naive CD8+ T cell
**Confidence:** Medium

**Reasoning:**
 The cluster is T-lineage by CD3D, CD3E, and TRBC1, which are present in the general T cell term (7/8). Among subtype terms, Naive CD8+ T cell has 6/8 matching markers (CD3D, CD3E, IL7R, LTB, MAL, CCR7), whereas the top Memory CD8+ T cell term matches only 5/8 and lacks MAL. The naive/central-memory markers CCR7, IL7R, LTB, and MAL support a naive T-cell state, and MAL specifically favors Naive CD8+ over Memory CD8+ in the supplied enrichment. However, CD4 and CD8A/CD8B are not in the marker list, and the CD4+ T cell term shares the same 6/8 gene set, so CD4 vs CD8 subtype resolution is limited; confidence is therefore Medium. 

**Supporting Markers/Pathways:**
- CD3D
- CD3E
- TRBC1
- IL7R
- LTB
- MAL
- CCR7 

When the book is rendered without DEEPSEEK_API_KEY, the two chunks above are skipped and the rest of the chapter still renders. When the key is present, a render performs a real DeepSeek call; keep the cache enabled for ordinary builds and clear interpretation_cache/ deliberately when a fresh report is wanted.

35.2 Extended evidence inputs

interpret_agent() applies three sequential stages to an interpretation request:

  1. Term curation selects and organizes the supplied enrichment terms in the stated biological context; it does not rerun the enrichment test.
  2. Evidence inspection combines the result object with optional gene-level changes and interaction data to identify genes or modules that support each term.
  3. Narrative drafting writes the checked inputs into the structured interpretation fields used by the report and plotting methods.

The implementation refers to these stages as Cleaner, Detective, and Storyteller. They are components of one shared-model pipeline, not separate statistical analyses. The stages share one evidence bundle, and their output remains a model-generated draft that should be checked against the original result object.

context <- "scRNA-seq analysis of CD8+ T cells in tumor microenvironment, comparing exhausted and naive states."
res <- interpret_agent(edo, context = context)

35.3 PPI and expression evidence

Set add_ppi = TRUE to request protein interactions from STRING. Pass a named gene_fold_change vector to retain expression direction in the interpretation. These inputs add network and expression evidence; they do not establish pathway activity or causality.

# Prepare a named vector of fold changes
gene_list <- c("CD8A" = 2.5, "PDCD1" = 1.8, "GZMB" = 3.2)

res <- interpret(
    edo,
    task = "interpretation",
    add_ppi = TRUE,
    gene_fold_change = gene_list
)

35.4 Prior labels and hierarchical inputs

For cell-type annotation, prior supplies an existing label for comparison. The returned annotation can agree with, refine, or disagree with that label; inspect the markers and enrichment terms before accepting a change.

my_priors <- c("Cluster1" = "T cells")
res <- interpret(edo, prior = my_priors, task = "annotation")

interpret_hierarchical() accepts major- and minor-cluster enrichment objects together with a mapping. It constrains each minor-cluster interpretation to the supplied major-cluster context; the mapping itself must be checked against the experimental design.

cluster_mapping <- c(
    "SubCluster1_1" = "MajorCluster1",
    "SubCluster1_2" = "MajorCluster1",
    "SubCluster2_1" = "MajorCluster2"
)
cluster_mapping
  SubCluster1_1   SubCluster1_2   SubCluster2_1 
"MajorCluster1" "MajorCluster1" "MajorCluster2" 
res_hier <- interpret_hierarchical(
    x_minor = enrich_minor,
    x_major = enrich_major,
    mapping = cluster_mapping
)

35.5 When enrichment returns no terms

When a result has no enriched terms, interpret_agent() can be given the input genes and optional PPI data. The implementation warns that no significant pathways were found, passes the raw genes to the Detective and Storyteller stages, and marks the returned object with data_source = "gene_list_only". The output should therefore be reported as a gene-based hypothesis; its confidence is taken from the returned object rather than assigned a fixed value.

res <- interpret_agent(tough_genes, add_ppi = TRUE)

35.6 Visualization of interpretation objects

The plot() method displays relationships stored in an interpretation object. When the returned object contains them, the plot can distinguish key drivers, activation or inhibition labels, and physical interactions. These labels are model outputs and require review against the supplied expression and interaction evidence.

plot(res)

The complete hand-off is:

enrichment result → optional fold-change/PPI/prior evidence
                  → interpretation object → report or plot

The final report and plot are views of the interpretation object. They do not constitute a second enrichment test, and interaction edges remain external supporting evidence.

35.7 Operational checks

context should identify the experiment, biological setting, contrast direction, and any relevant cell-type or tissue resolution. interpret() cannot infer these details from pathway names alone.

A weak context names only the assay:

context <- "scRNA-seq of T cells"
context
[1] "scRNA-seq of T cells"

A strong context answers six questions in one or two sentences:

Question Example
Species and tissue human breast tumour, bulk tissue
Disease / biological setting breast carcinoma, tumour grade
Experimental design 200 samples from the MAINZ cohort
Contrast tested, and its direction grade III vs. grade I; positive values are higher in grade III
Cell type / composition bulk tissue, no cell-type resolution
Hypothesis under test progression involves loss of epithelial differentiation and ECM remodelling

Written out, that is still only a few lines:

context <- paste(
  "Human breast-cancer transcriptome (MAINZ cohort, bulk tumour tissue, 200",
  "samples). Genes are ranked by the log2 ratio of geometric-mean expression in",
  "grade III versus grade I tumours, so positive values are higher in the",
  "higher-grade tumours. No cell-type resolution is available. Hypothesis:",
  "progression from grade I to grade III involves loss of epithelial",
  "differentiation and increased extracellular-matrix remodelling."
)
context
[1] "Human breast-cancer transcriptome (MAINZ cohort, bulk tumour tissue, 200 samples). Genes are ranked by the log2 ratio of geometric-mean expression in grade III versus grade I tumours, so positive values are higher in the higher-grade tumours. No cell-type resolution is available. Hypothesis: progression from grade I to grade III involves loss of epithelial differentiation and increased extracellular-matrix remodelling."

Two rules of thumb follow. First, state the direction of the contrast – “A vs. B” without saying which side is up is a common way to get a report with the regulation backwards. Second, do not put the answer in the context: if you write “we expect apoptosis to be suppressed”, the model will often agree with you regardless of the data. Describe the design, not the conclusion you are hoping for. (If your data are from single cells, add the cell type or the compartment the cluster belongs to; for bulk tissue, saying that no cell-type resolution exists is more useful than omitting the point.)

35.7.1 Choosing a Model and Switching Provider

Model selection is delegated to aisdk. interpret() itself has no model registry and no provider logic: when model is left at its default (NULL) it uses whatever aisdk currently considers the default, and model = "provider:model" overrides that default for a single call.

library(aisdk)

# Session-wide default, used by every interpret() call that omits `model`
set_model("deepseek:deepseek-v4-flash")
get_model()

Calls that omit model use the session-wide setting selected with set_model(). Pass model for a one-off provider or model.

res <- interpret(edo, model = "openai:gpt-4o")

Credentials follow the same rule. aisdk reads each provider’s key from an environment variable: OPENAI_API_KEY, ANTHROPIC_API_KEY and GEMINI_API_KEY for the three providers bundled with aisdk, and the corresponding variable for the adapters in aisdk.providers (for example DEEPSEEK_API_KEY, which is what this chapter uses). Put the key in a project .Renviron or export it in the shell; interpret() never takes a key argument. If you never call set_model(), aisdk falls back to its built-in default, openai:gpt-4o – which is why the examples you may have seen elsewhere appear to use GPT-4o by default.

aisdk ships a catalogue of the providers and models it knows about:

list_models()            # every provider and model aisdk knows about
list_models("openai")    # just one provider

Model choice affects latency, cost, context capacity, and output variability. Fix the model when comparing reports, because different models can produce different summaries from the same input.

35.7.2 Multi-Model and Consensus Workflows

There is no built-in consensus or ensemble mode in interpret() or interpret_agent(). A call goes to exactly one model. interpret_agent() is a multi-agent pipeline, not a multi-model one: its three agents share a single model.

What you can do today is run the same input through several models and compare the reports yourself. Because model = is a per-call argument, this needs no extra machinery:

res_deepseek <- interpret(edo, model = "deepseek:deepseek-v4-flash")
res_gpt      <- interpret(edo, model = "openai:gpt-4o")

Each call is a separate, billable request, and the two reports will not be identical even for the same model (see below). A pragmatic middle ground is to use one model to write the report and a second, independent call only to criticise it: ask a different model whether every gene and pathway named in the narrative is actually present in the input table. That is a manual workflow, but it catches the most common failure mode – plausible-sounding genes that were never in the data. For provider failover, aisdk provides generate_text_fallback() for its own generation calls, but interpret() does not expose a fallback argument.

35.7.3 Practical Guidance and Pitfalls

Non-determinism. interpret() samples at temperature = 0.3 by default, so two calls with identical input will differ in wording and occasionally in emphasis. This is expected, not a bug. It has a direct consequence for reproducible builds: Quarto’s chunk cache (cache: true) is what keeps the published page stable – the LLM call runs once and its output is reused on later renders. Clear the cache and you will get a different report. If you need the exact same text in two places, cache the object and reuse it.

Unsupported entities. The model is instructed to ground claims in the supplied table, but it can still produce incorrect output. Before quoting a report, check that every gene named in the narrative appears in the geneID (or, for GSEA, core_enrichment) column and every pathway named appears in Description. If add_ppi = TRUE, identify the cited edges as STRING evidence, not measurements from the experiment.

n_pathways. Only the top n_pathways terms (default 20) are sent to the model, ordered by adjusted p-value (p.adjust, falling back to pvalue). Raising it gives the model more to work with but dilutes the signal and enlarges the prompt; lowering it forces a tighter focus. For a compareClusterResult, interpret() splits the result by cluster and returns one report per cluster, so the number of calls – and the cost – scales with the number of clusters, not with n_pathways.

max_tokens. The default is 8192. Reasoning models spend part of that budget deliberating before they emit the JSON, and if they run out, the reply is truncated and cannot be parsed; the symptom is a warning mentioning finish_reason: length and a placeholder report. If you hit it, raise max_tokens (the diagnostic suggests 16384 or more) or switch to a model that does not reason before answering.

Seeing the cost. interpret() returns only the parsed report; token usage is not part of the returned object. Run with verbose = TRUE to print the raw response and the prompt/completion/total token counts – the practical way to watch spend while you tune n_pathways and max_tokens.

add_ppi. Setting add_ppi = TRUE queries STRING for the genes in the top terms and injects the edge list into the prompt, which lets the model identify functional modules from individual genes. It requires network access, adds latency, and is a second failure point; the query is wrapped so that a STRING outage degrades to “no network evidence” instead of an error. Leave it at its default (FALSE) unless module-level reasoning is what you need.

gene_fold_change. Passing a named numeric vector of log fold changes adds the direction of regulation to the prompt. Note the limitation: the helper intersects your vector with the genes in the result’s geneID column, and a gseaResult table has no geneID column (it carries core_enrichment instead). So gene_fold_change is used for over-representation results (enrichResult, compareClusterResult) and silently ignored for GSEA results – which is harmless, because a GSEA result already encodes direction in the sign of its enrichment score.

Ranking. For over-representation results the terms are ordered by p.adjust; for GSEA the direction the model sees is the sign of NES. If your GSEA ranked list was built so that positive means “up in the condition of interest”, say so in context – otherwise the model has to guess the orientation.

Treat the output as an unverified draft. Check every gene and pathway named in the narrative against the input table; then assess whether each mechanistic statement has supporting evidence.

35.8 Worked Example: From Enrichment to a Report

This example builds a GSEA result offline from the geneList shipped with DOSE, passes a defined context to interpret(), and renders the returned report. The interpret_agent() example above is disabled because it makes multiple model calls.

library(clusterProfiler)
library(org.Hs.eg.db)

data(geneList, package = "DOSE")

# A real enrichment result, computed offline: GSEA over GO cellular components.
# geneList is the DOSE demo list -- log2 ratios of grade III vs. grade I tumours
# from the MAINZ breast-cancer cohort.
gse <- gseGO(
    geneList      = geneList,
    OrgDb         = org.Hs.eg.db,
    keyType       = "ENTREZID",
    ont           = "CC",
    minGSSize     = 15,
    maxGSSize     = 100,
    eps           = 0,
    pvalueCutoff  = 0.05,
    pAdjustMethod = "BH"
)

# A context that names the species, tissue, design, contrast and hypothesis.
context <- paste(
    "Human breast-cancer transcriptome (MAINZ cohort, bulk tumour tissue).",
    "Genes are ranked by the log2 ratio of geometric-mean expression in grade",
    "III versus grade I tumours, so positive values are higher in the",
    "higher-grade tumours. Hypothesis: progression from grade I to grade III",
    "involves loss of epithelial differentiation and increased",
    "extracellular-matrix remodelling."
)

report <- interpret(gse, context = context, n_pathways = 15)

if (interpret_failed(report)) {
    stop("interpret() returned no report -- check the API key and quota:\n",
         report$overview)
}

cat(render_interpretation_blocks(report), sep = "\n")
Interpretation — cluster Default (Not returned)

Overview:

GSEA of grade III versus grade I breast tumors separates two coherent programs. Negative-NES terms (higher in grade I) are extracellular-matrix/basement-membrane/elastic-fiber/collagen modules: interstitial matrix, solid/gel/non-collagenous interstitial matrix, elastic fiber, microfibril, basement membrane, collagen trimer and complex of collagen trimers. Positive-NES terms (higher in grade III) are mitotic/proliferative and proteostasis/immune modules: spindle midzone, spindle microtubule, outer kinetochore, kinesin complex, proteasome complex and immunoglobulin complex. Thus bulk transcriptomes show loss of matrix/differentiation components and gain of mitotic machinery in higher grade, rather than a simple increase in ECM-remodeling transcripts.

Regulatory drivers:

  • No transcription-factor or upstream-regulator terms appear in the top enriched list, so specific master regulators cannot be assigned from these data. The grade-III-positive spindle midzone (GO:0051233), spindle microtubule (GO:0005876), outer kinetochore (GO:0000940) and kinesin complex (GO:0005871) terms point to regulators of mitosis/chromosome segregation, but no named TF is supported. The grade-I-enriched matrix terms imply loss of transcriptional programs maintaining basement membrane/collagen/elastic-fiber differentiation, but the responsible TFs are not identified in the provided enrichment output.

Key mechanisms:

Theme 1, grade-I-enriched structural matrix/differentiation: interstitial matrix (GO:0005614), solid phase of interstitial matrix (GO:0140151), non-collagenous component of interstitial matrix (GO:0140149), gel phase of interstitial matrix (GO:0140150), elastic fiber (GO:0071953), microfibril (GO:0001527), basement membrane (GO:0005604), collagen trimer (GO:0005581) and complex of collagen trimers (GO:0098644). Theme 2, grade-III-enriched mitotic apparatus: spindle midzone (GO:0051233), spindle microtubule (GO:0005876), outer kinetochore (GO:0000940) and kinesin complex (GO:0005871). Theme 3, grade-III-enriched proteostasis/immune: proteasome complex (GO:0000502) and immunoglobulin complex (GO:0019814).

Crosstalk and interactions:

ECM/basement-membrane loss may accompany epithelial dedifferentiation, while mitotic spindle/kinetochore/kinesin terms reflect proliferation (GO:0051233, GO:0005876, GO:0000940, GO:0005871). Proteasome complex (GO:0000502) is co-enriched with the mitotic terms in grade III, consistent with proteostasis support of proliferating cells and possible matrix-protein turnover, but the enrichment data only show co-occurrence. Immunoglobulin complex (GO:0019814) co-enriched in grade III suggests an immune/plasma-cell component in bulk tumor tissue, which may confound tumor-cell-intrinsic interpretation of some grade-III terms. No direct regulatory edge between these modules is proven by the enrichment data.

Hypothesis:

Progression from grade I to grade III in this cohort is associated with reduced expression of interstitial-matrix/basement-membrane/elastic-fiber/collagen components and increased expression of mitotic spindle/kinetochore/kinesin, proteasome and immunoglobulin-complex programs. This supports loss of epithelial/structural differentiation and acquisition of proliferative/proteostatic and immune-associated features. The original hypothesis of increased ECM remodeling is not supported at the bulk transcript level; ECM remodeling could still occur post-transcriptionally or in a compartment not reflected by bulk RNA.

Narrative draft:

GSEA of grade III versus grade I breast tumors revealed a reciprocal shift in two major programs. Grade I tumors were enriched for structural extracellular-matrix and adhesion terms, including interstitial matrix, solid/gel/non-collagenous interstitial matrix, elastic fiber, microfibril, basement membrane, collagen trimer and complex of collagen trimers (negative NES). In contrast, grade III tumors were enriched for mitotic apparatus terms—spindle midzone, spindle microtubule, outer kinetochore and kinesin complex—as well as proteasome complex and immunoglobulin complex (positive NES). These results indicate that higher-grade tumors have lower expression of matrix/basement-membrane differentiation components and higher expression of proliferation/proteostasis/immune-associated components. Thus, in this bulk transcriptome cohort, grade progression is more consistent with loss of epithelial-matrix differentiation and gain of mitotic machinery than with a global increase in ECM-remodeling transcripts.

Network evidence:

No PPI or gene-level network file was provided, so no experimentally supported edges or key hubs can be refined. Enrichment data define two separable modules: an ECM/basement-membrane/elastic-fiber/collagen module enriched in grade I (GO:0005614, GO:0140151, GO:0140149, GO:0140150, GO:0071953, GO:0001527, GO:0005604, GO:0005581, GO:0098644) and a grade-III module containing mitotic spindle/kinetochore/kinesin terms (GO:0051233, GO:0005876, GO:0000940, GO:0005871) plus proteasome and immunoglobulin complexes (GO:0000502, GO:0019814). These are co-enrichment modules, not resolved PPI hubs.

Raw object print
## Interpretation Result

### Cluster: Default

### 1. Overview
GSEA of grade III versus grade I breast tumors separates two coherent programs. Negative-NES terms (higher in grade I) are extracellular-matrix/basement-membrane/elastic-fiber/collagen modules: interstitial matrix, solid/gel/non-collagenous interstitial matrix, elastic fiber, microfibril, basement membrane, collagen trimer and complex of collagen trimers. Positive-NES terms (higher in grade III) are mitotic/proliferative and proteostasis/immune modules: spindle midzone, spindle microtubule, outer kinetochore, kinesin complex, proteasome complex and immunoglobulin complex. Thus bulk transcriptomes show loss of matrix/differentiation components and gain of mitotic machinery in higher grade, rather than a simple increase in ECM-remodeling transcripts. 

### 2. Regulatory Drivers
No transcription-factor or upstream-regulator terms appear in the top enriched list, so specific master regulators cannot be assigned from these data. The grade-III-positive spindle midzone (GO:0051233), spindle microtubule (GO:0005876), outer kinetochore (GO:0000940) and kinesin complex (GO:0005871) terms point to regulators of mitosis/chromosome segregation, but no named TF is supported. The grade-I-enriched matrix terms imply loss of transcriptional programs maintaining basement membrane/collagen/elastic-fiber differentiation, but the responsible TFs are not identified in the provided enrichment output. 

### 3. Key Mechanisms
Theme 1, grade-I-enriched structural matrix/differentiation: interstitial matrix (GO:0005614), solid phase of interstitial matrix (GO:0140151), non-collagenous component of interstitial matrix (GO:0140149), gel phase of interstitial matrix (GO:0140150), elastic fiber (GO:0071953), microfibril (GO:0001527), basement membrane (GO:0005604), collagen trimer (GO:0005581) and complex of collagen trimers (GO:0098644). Theme 2, grade-III-enriched mitotic apparatus: spindle midzone (GO:0051233), spindle microtubule (GO:0005876), outer kinetochore (GO:0000940) and kinesin complex (GO:0005871). Theme 3, grade-III-enriched proteostasis/immune: proteasome complex (GO:0000502) and immunoglobulin complex (GO:0019814). 

### 4. Crosstalk & Interactions
ECM/basement-membrane loss may accompany epithelial dedifferentiation, while mitotic spindle/kinetochore/kinesin terms reflect proliferation (GO:0051233, GO:0005876, GO:0000940, GO:0005871). Proteasome complex (GO:0000502) is co-enriched with the mitotic terms in grade III, consistent with proteostasis support of proliferating cells and possible matrix-protein turnover, but the enrichment data only show co-occurrence. Immunoglobulin complex (GO:0019814) co-enriched in grade III suggests an immune/plasma-cell component in bulk tumor tissue, which may confound tumor-cell-intrinsic interpretation of some grade-III terms. No direct regulatory edge between these modules is proven by the enrichment data. 

### 5. Hypothesis
Progression from grade I to grade III in this cohort is associated with reduced expression of interstitial-matrix/basement-membrane/elastic-fiber/collagen components and increased expression of mitotic spindle/kinetochore/kinesin, proteasome and immunoglobulin-complex programs. This supports loss of epithelial/structural differentiation and acquisition of proliferative/proteostatic and immune-associated features. The original hypothesis of increased ECM remodeling is not supported at the bulk transcript level; ECM remodeling could still occur post-transcriptionally or in a compartment not reflected by bulk RNA. 

### 6. Narrative Draft
GSEA of grade III versus grade I breast tumors revealed a reciprocal shift in two major programs. Grade I tumors were enriched for structural extracellular-matrix and adhesion terms, including interstitial matrix, solid/gel/non-collagenous interstitial matrix, elastic fiber, microfibril, basement membrane, collagen trimer and complex of collagen trimers (negative NES). In contrast, grade III tumors were enriched for mitotic apparatus terms—spindle midzone, spindle microtubule, outer kinetochore and kinesin complex—as well as proteasome complex and immunoglobulin complex (positive NES). These results indicate that higher-grade tumors have lower expression of matrix/basement-membrane differentiation components and higher expression of proliferation/proteostasis/immune-associated components. Thus, in this bulk transcriptome cohort, grade progression is more consistent with loss of epithelial-matrix differentiation and gain of mitotic machinery than with a global increase in ECM-remodeling transcripts. 

The printed report follows the schema described at the top of this chapter. Read it in this order:

  1. 1. Overview – the model’s one-paragraph summary. If it is vague, the context was probably too vague.
  2. 2. Regulatory Drivers and 3. Key Mechanisms – the “who” and the “how”. Check every named gene against your input table.
  3. 5. Hypothesis – the “so what”. This is the part worth arguing with.
  4. 6. Narrative Draft – a paragraph written for a Results or Discussion section. It is a draft: edit it, do not paste it.
  5. 7. Refined Regulatory Network – populated only when the model can support edges; plot(report) draws the same network with ggtangle when it is available.

35.9 Next steps

  • For the preceding evidence objects, see evidence integration.
  • For a reproducible hand-off, record the analysis in the reference appendix.
  • Keep optional AI assistance after statistical checking and external evidence review.