> For the complete documentation index, see [llms.txt](https://docs.owkin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.owkin.com/explore-and-analyse-data/data-analysis/expression-molecular-profiles/target-metafeatures.md). Agents can also search and read this documentation through its [MCP server](https://docs.owkin.com/~gitbook/mcp).

# Target metafeatures

Combine sample-level features into cohort-level scores for comparing individual target genes using principal component analysis, summarizing expression, tumor homogeneity, cancer-cell and healthy-tiss

Combine sample-level features into cohort-level scores for comparing individual target genes using principal component analysis, summarizing expression, tumor homogeneity, cancer-cell and healthy-tissue specificity, genomic alterations, and spatial proximity of expression regions.

## Target metafeatures (PC1 of a feature group)

### Description

#### Analysis summary

Derives, per single-gene target, the cohort-level PC1 score of each feature group of the patient\_features analysis: overall expression level, expression homogeneity across the tumor and its subclones, cancer-cell specificity, genomic alteration load, how close the low- and high-expression regions sit, and healthy-tissue specificity.

#### Computation

One value per (metafeature, target) at the cohort level; no statistical tests are computed — the scores are descriptive projections. **The six metafeatures (each the PC1 of a group of patient features)**

* metafeature\_expression\_level\_pc1: PC1 of fractional\_ranks, mean\_express\_malignant, pseudobulk\_malignant\_spots, pseudobulk\_malignant\_cells — how highly the target is expressed overall.
* metafeature\_expression\_homogeneity\_pc1: PC1 of the homogeneity features (diversity index, subclone entropy/variance/coverage, Moran's I, tumor coverage, malignant expressing-fraction) — how uniformly the target is expressed across the tumor.
* metafeature\_cancer\_cell\_specificity\_pc1: PC1 of the two malignant-vs-rest differential expressing-fractions — how selective the target is for malignant cells.
* metafeature\_genomic\_alterations\_pc1: PC1 of mutation\_prevalence and amplification\_prevalence — how often the target gene is altered.
* metafeature\_low\_to\_high\_distance\_pc1: the mean low-to-high distance NEGATED — higher means the low- and high-expression regions sit CLOSER together.
* metafeature\_healthy\_tissue\_specificity\_pc1: PC1 of the six non-malignant expression features — higher means more tumor-specific. **The fit**
* Complete observations only: a group runs only when ALL its members were computed, and only the (sample, target) rows where every member was observed enter the fit — partial coverage would median-impute holes, so an incomplete group is reported as not computed instead.
* Those rows are averaged per target (one coherent sample set per target, its size reported as the backing 'N samples' of each cell), then the PCA is fitted ACROSS the targets: one observation each.
* Member z-scores are negated where a HIGH value is BAD for a target, so every member of a group points the same way, and the component's sign is oriented against the aligned member mean — a group reads the same way on every cohort. The orientation is a guarantee about the group, not about any one member: verify direction against the aligned member mean, never against a single member.
* The fit is THE REQUEST's: it uses the assembled samples and targets, so rank targets within one result rather than across requests.

#### When to use

Use AFTER the per-modality patient\_features runs have been computed and persisted: assemble their feature tables (all targets, every modality block) into one long table and run this analysis on it. Never per chunk — the PCA is fitted across targets, so it needs every target's feature rows assembled before it runs. The end-to-end two-stage procedure (per-modality runs, batching, assembly, this stage) is documented in the `patient-feature-workflow` skill.

#### Caveats

A metafeature needs EVERY member of its group computed, and their (sample, target) observations to intersect: an absent modality, a skipped feature, or disjoint sample sets each skip the group with a reason rather than narrowing the fit. Assembly must be conservative (same dataset version, cohort definition and feature parameters across the assembled runs); identical duplicates collapse and conflicting duplicates raise. The cancer-cell-specificity and healthy-tissue-specificity components are narrower constructs than their full registry groups (missing members are documented in the module docstring).

### Example questions

<details>

<summary><code>example questions</code></summary>

* Rank the targets by overall expression level and cancer specificity across the assembled feature results
* Compute the cohort-level metafeatures for the targets we scored with the per-modality runs

</details>

### Input columns

<details>

<summary><code>input columns</code></summary>

| column        | type        | required | description                                                                                                                                                       |
| ------------- | ----------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| patient\_id   | categorical | required | Patient identifier, as carried by the assembled feature rows.                                                                                                     |
| sample\_id    | categorical | required | Sample identifier, as carried by the assembled feature rows.                                                                                                      |
| feature\_name | categorical | required | The patient\_features feature names. Only the declared metafeature groups' members are read; every other row (unknown features, the metafeatures themselves) is … |
| target        | categorical | required | Target label: a single gene ('GENE'). Pair rows ('GENE\_A + GENE\_B') are excluded — metafeatures are computed for single-gene targets only.                      |
| value\_num    | numeric     | required | The feature's numeric value. Non-finite values (NaN/inf) are dropped before the fit.                                                                              |

</details>

### Visualizations

* `patient_features_table` How to read: A Markdown summary table, not a chart: one row per target, one column per metafeature. Each cell shows the cohort-level PC1 value and, in parentheses, the number of complete samples backing it. A '—' cell means that (target, metafeature) combination produced no value. Metafeatures that could not be computed at all are listed under '\_Not computed — :' below the table, each with its reason (the missing members, or disjoint member sample sets).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.owkin.com/explore-and-analyse-data/data-analysis/expression-molecular-profiles/target-metafeatures.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
