> 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-patient-features.md). Agents can also search and read this documentation through its [MCP server](https://docs.owkin.com/~gitbook/mcp).

# Target patient features

Characterize target genes and gene pairs in individual samples using expression levels, cancer selectivity, tumor-cell and spatial coverage, and mutation or amplification status, from bulk, single-cel

Characterize target genes and gene pairs in individual samples using expression levels, cancer selectivity, tumor-cell and spatial coverage, and mutation or amplification status, from bulk, single-cell, spatial, or whole-exome sequencing data.

## Target patient features (bulk RNA-seq)

### Description

#### Analysis summary

Computes, from bulk RNA-seq, how highly each target gene is expressed relative to the rest of the gene panel (fractional rank and low/medium/high category) and whether target pairs are jointly highly expressed.

#### Computation

Per sample, from the bulk rows; no statistical tests are computed — the features are descriptive. The two fractional\_ranks\_pairs\_\* features are computed only for pairs; mono features fall back to every target gene when no single-gene target is given. **Bulk (7; the bulk rows must carry ALL genes)**

* The gene panel is protein-coding genes only, so ranks and categories are relative to protein-coding genes, not the whole transcriptome; say so when reporting them.
* fractional\_ranks: percentile of the gene across all genes of the sample, in (0, 1].
* categorical\_expression\_level: verylow / low / medium / high from global quantile cut points (string in value\_str).
* binarized\_expression\_high (gene is 'high'), \_coexpressing (pair, both 'high'), \_any (pair, either 'high'): booleans in value\_str.
* fractional\_ranks\_pairs\_coexpressing / \_any: min / max of the two gene ranks (an AND-gate binder is limited by its weaker gene).

#### When to use

The cheap expression block: use it when the user asks only for bulk ranks / categories / binarizations and/or gene-pair co-expression at the bulk level.

#### Caveats

The bulk gene panel is protein-coding genes only, so expression ranks and categories are relative to protein-coding genes, not the whole transcriptome. The bulk rows must carry ALL genes — ranks are taken across the whole panel and only then subset — so constrain the cohort (patients / conditions) rather than the genes if the query is too large.

### Example questions

<details>

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

* Bulk expression ranks and categories for a list of target genes
* Per-sample bulk expression categories and gene-pair co-expression levels

</details>

### Input columns

<details>

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

| column      | type        | required | description                                                                                                                                                          |
| ----------- | ----------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| patient\_id | categorical | required | Patient identifier. Present for every modality.                                                                                                                      |
| sample\_id  | categorical | required | Sample identifier. Present for every modality; features are computed per sample.                                                                                     |
| entity\_id  | any         | required | Per-row entity id: cell id ('sc'), spot id ('spatial'), or the sample id for 'bulk' and both 'wes\_\*' modalities, whose entity is the sample itself.                |
| gene\_name  | categorical | required | Gene symbol. The 'sc' and 'spatial' rows are SPARSE: one row per (entity, gene) with a NON-ZERO value, plus one NULL-gene row per entity expressing none of the…     |
| value       | numeric     | required | Expression value: bulk count\_tpm ('bulk'), single-cell raw count ('sc'), spatial count\_lognorm ('spatial'). For the two 'wes\_\*' modalities it is instead a per-… |

</details>

### Visualizations

* `patient_features_table` How to read: A Markdown summary table, not a chart: one row per target, one column per computed feature. Numeric features show 'N= ~~samples,patients; mean \[min, max]'; categorical / boolean features show value counts; a '—' cell means that (target, feature) combination produced no value. Features that could not be computed at all are listed under '\_Not computed — :' below the table, each with its reason. A modality run appends a note stating which samples the table covers and that features from different runs are not on the same denominator.~~

~~Example analysis 1Name — Target patient features (bulk)Analysis parametersVisualization — `patient_features_table`Output tableTarget patient features (bulk)*Modality run (modality='bulk'): this table covers the bulk samples only; each feature carries its own N, and features from different modality runs are not on the same denominator.*&#x54;arget patient features (whole-exome sequencing)DescriptionAnalysis summaryComputes, from whole-exome sequencing, whether each target gene is mutated or duplicated / amplified in each sample.ComputationPer sample; no statistical tests are computed — the features are descriptive. Both features are mono only. **WES (2)**&#x6D;utation\_prevalence ('wes\_mutation' rows), amplification\_prevalence ('wes\_duplication' rows).Per sample each is the 0/1 alteration status, NOT a fraction; the cohort mean is the prevalence.A target absent from the WES rows scores 0 (not altered). A sample with NO WES rows is absent from both features (never sequenced = unknown).When to useUse it when the user asks only for the mutation / amplification status of the targets, or as the WES block of a multi-block request (the bulk / sc / spatial modes cover the rest).CaveatsDespite their names the two features are per-sample 0/1 statuses, not cohort fractions. A WES target absent from the input scores 0 — absent from a WES table means not altered, not unknown — and a sample with no WES rows is simply absent from the features (never sequenced = unknown).Example questionsInput columnsVisualizations`patient_features_table` How to read: A Markdown summary table, not a chart: one row per target, one column per computed feature. Numeric features show 'N= samples,patients; mean \[min, max]'; categorical / boolean features show value counts; a '—' cell means that (target, feature) combination produced no value. Features that could not be computed at all are listed under '\_Not computed — :' below the table, each with its reason. A modality run appends a note stating which samples the table covers and that features from different runs are not on the same denominator.Example analysis 1Name — Target patient features (WES)Analysis parametersVisualization — `patient_features_table`Output tableTarget patient features (WES)*Modality run (modality='wes'): this table covers the WES samples only; each feature carries its own N, and features from different modality runs are not on the same denominator.*&#x54;arget patient features (single-cell)DescriptionAnalysis summaryComputes, from single-cell RNA-seq, how strongly and how widely each target is expressed across malignant, stromal, epithelial and immune cells (and how cancer-selective that is), pseudobulk expression levels, and how unevenly a target is spread across the tumor cells and their subclones.ComputationPer sample, from the single-cell rows; no statistical tests are computed — the features are descriptive. Gene-pair features (\_coexpressing, \_any, \_with\_diff) are computed only for pairs. **Single-cell (30)**&#x6D;ean\_express\_malignant / \_stromal / \_epithelial / \_immune: mean log-normalized expression over cells of that type.frac\_{malignant,stromal,epithelial,immune}\_cell\_expressing\_target: fraction of cells of that type expressing the gene.frac\_malignant\_cell\_expressing\_target\_diff\_immune / \_diff\_stromal: malignant expressing-fraction minus the same fraction in the other type; in \[-1, 1], negative when the other type expresses it more widely.pseudobulk\_malignant\_cells: summed expression over malignant cells.frac\_malignant\_cell\_coexpressing\_targets / \_expressing\_any\_targets: pair, both / either gene.frac\_malignant\_cell\_expressing\_with\_diff: pair union fraction minus the best single-gene fraction.tumor\_specificity\_coexpressing\_targets / \_any\_targets: malignant (co-)expression fraction divided by the same fraction over every OTHER annotated cell of the sample. >1 = tumor-enriched, which separates a selective target from a merely abundant one.tumor\_specificity\_smoothed\_\*: same ratio, Laplace-smoothed by each population's cell count (a zero over few normal cells is not perfect specificity) and set to 0 when fewer than 5% of malignant cells pass the gate. **Intra-tumor heterogeneity (12, within the single-cell set)**&#x67;ene\_ith\_diversity\_index: how evenly malignant cells spread over the gene's expression range, in \[1/n\_bins, 1] (1/n\_bins = every cell at one level, 1 = evenly spread); bins shared by all samples, NaN below 30 malignant cells. The only one needing no subclone label.n\_subclones: number of distinct subclone labels among the sample's malignant cells, independent of the target list (emitted with target 'n\_subclones'). A sample with no labelled malignant cell is dropped; a single labelled subclone scores 1. Needs cell\_subclone. Read it alongside the coverage features below: it is the sample's subclone count, the denominator those coverage fractions are taken over.gene\_ith\_mean\_x\_entropy: variance of the per-subclone mean expression x entropy of the subclone sizes.gene\_ith\_subclone\_variance: variance across subclones of the gene's per-subclone mean expression (no entropy weighting). \_coexpressing\_targets / \_expressing\_any\_targets: pair, same variance over the min / max of the two genes' per-subclone means.gene\_ith\_subclone\_frac\_variance (gene) / \_coexpressing\_targets / \_expressing\_any\_targets (pair): same variance over the FRACTION of cells expressing the gene / passing the AND / OR gate (coverage rather than level).gene\_ith\_subclone\_coverage (gene) / \_coexpressing\_targets / \_expressing\_any\_targets (pair): fraction of the sample's subclones that are positive, i.e. with at least 30% of their cells expressing the gene / passing the AND / OR gate. Reads as reach (high = most clones reached); a single subclone scores 0 or 1.The 6 variance features and gene\_ith\_mean\_x\_entropy read as risk (high = some clones reached, others missed) and need a sample with 2+ subclones. All 11 subclone features need cell\_subclone.When to useThe single-cell block: use it when the user asks only for single-cell features, or as the single-cell block of a multi-block request (e.g. to feed the metafeature second stage).CaveatsThe features score the malignant compartment against the others, so the cell-type labels must carry every compartment, not only the malignant one; a compartment absent from the cohort is reported as not computed rather than failing the table. The mean-expression and five heterogeneity features are computed on log-normalized expression and reported as not computed when the query did not fetch that scale. The eleven subclone-grouped features need the optional subclone label — never fill it with a coarser cell-type column, which would make the scores silently meaningless; the variance ones need samples with two or more subclones, while the coverage ones and the subclone count still score single-subclone samples.Example questionsInput columnsVisualizations`patient_features_table` How to read: A Markdown summary table, not a chart: one row per target, one column per computed feature. Numeric features show 'N= samples,patients; mean \[min, max]'; categorical / boolean features show value counts; a '—' cell means that (target, feature) combination produced no value. Features that could not be computed at all are listed under '\_Not computed — :' below the table, each with its reason. A modality run appends a note stating which samples the table covers and that features from different runs are not on the same denominator.Example analysis 1Name — Target patient features (single-cell)Analysis parametersVisualization — `patient_features_table`Output tableTarget patient features (single-cell)*Modality run (modality='sc'): this table covers the single-cell samples only; each feature carries its own N, and features from different modality runs are not on the same denominator.gene\_ith\_diversity\_index bins are pooled over the samples of one call, so its values are comparable within this run only.*&#x54;arget patient features (spatial)DescriptionAnalysis summaryComputes, from spatial transcriptomics, what fraction of tumor area is covered by spots expressing each target, how the expressing spots are laid out on the slide (clustered or scattered, and how far the low-expression tissue lies from the high-expression region), and how each spot's expression profile correlates with the payload target TOP1.ComputationPer sample, from the spatial rows; no statistical tests are computed — the features are descriptive. Pair features (\_coexpressing, \_any, \_with\_diff) are computed only for pairs. **Spatial (9)**&#x73;patial\_tumor\_coverage\_expressing\_target / \_coexpressing\_targets / \_expressing\_any\_targets: fraction of tumor area covered by expressing spots (hexagonal dilation), per gene / pair both / pair either.spatial\_tumor\_coverage\_with\_diff: pair union coverage minus the best single-gene coverage.pseudobulk\_malignant\_spots: summed log-normalized expression over tumor spots.Whole-slide neighbourhood features (not limited to the tumor region):spatial\_morans\_i: autocorrelation in \[-1, 1] of the expressing/silent pattern (positive = patches, \~0 = scattered).minimum\_target\_high\_distance (gene) / minimum\_target\_coexpression\_high\_distance (pair, either gene): mean hex-grid distance from each silent spot to the nearest high spot. Large = high expression is a distant island. 'High' is a log-normalized value >= 6.0, 'silent' <= 0.0.spot\_top1\_correlation: Pearson correlation across spots with TOP1, the payload-class target. The spatial rows must carry TOP1 (or the gene set in spot\_correlation\_reference\_gene).When to useThe spatial block: use it when the user asks only for spatial features, or as the spatial block of a multi-block request (e.g. to feed the metafeature second stage).CaveatsThe rows are sparse — the silent-spot rows are the denominator of the coverage features, the tissue Moran's I measures clustering against and the low region the distance feature measures distance from — so keep them. The neighbourhood features read the whole slide, not only the tumor region. spot\_top1\_correlation needs the reference gene (TOP1 by default) to be fetched by the query even though it is not a target; the feature is skipped otherwise.Example questionsInput columnsVisualizations`patient_features_table` How to read: A Markdown summary table, not a chart: one row per target, one column per computed feature. Numeric features show 'N= samples,patients; mean \[min, max]'; categorical / boolean features show value counts; a '—' cell means that (target, feature) combination produced no value. Features that could not be computed at all are listed under '\_Not computed — :' below the table, each with its reason. A modality run appends a note stating which samples the table covers and that features from different runs are not on the same denominator.Example analysis 1Name — Target patient features (spatial)Analysis parametersVisualization — `patient_features_table`Output tableTarget patient features (spatial)*Modality run (modality='spatial'): this table covers the spatial samples only; each feature carries its own N, and features from different modality runs are not on the same denominator.*~~


---

# 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-patient-features.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.
