scdecon.plotting¶
plotting ¶
Plotting: figures rendered from scdecon results.
This layer depends on the computational core (it consumes core outputs such as a
signature DataFrame), but the core never depends on plotting. matplotlib and
seaborn live only here.
plot_benchmark ¶
plot_benchmark(result: BenchmarkResult, path: str | Path, *, metric: str = 'overall_rmse', title: str | None = None) -> Path
Render a bar chart comparing solvers on a benchmark metric.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
BenchmarkResult
|
The :class: |
required |
path
|
str | Path
|
Destination image path. Missing parent directories are created. |
required |
metric
|
str
|
Column of |
'overall_rmse'
|
title
|
str | None
|
Optional figure title. |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
The path that was written. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the result is empty or |
plot_signature_heatmap ¶
Render a genes-by-cell-types signature heatmap and save it to path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signature
|
DataFrame
|
Signature matrix (genes x cell types), as returned by
:func: |
required |
path
|
str | Path
|
Destination image path (e.g. |
required |
title
|
str | None
|
Optional figure title. |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
The path that was written. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
plot_truth_vs_prediction ¶
plot_truth_vs_prediction(truth: DataFrame, prediction: DataFrame, path: str | Path, *, title: str | None = None) -> Path
Render a truth-vs-prediction scatter grid (one panel per cell type).
Each panel plots true (x) against predicted (y) proportions across samples,
with a y = x reference line and [0, 1] axes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
truth
|
DataFrame
|
Ground-truth proportions, cell types (index) x samples (columns). |
required |
prediction
|
DataFrame
|
Estimated proportions, same orientation and labels as |
required |
path
|
str | Path
|
Destination image path. Missing parent directories are created. |
required |
title
|
str | None
|
Optional overall figure title. |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
The path that was written. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the inputs cannot be aligned (see
:func: |