Visualise API¶
Cohort Overview¶
customics.plot_cohort_overview(mdata, show=True)
¶
Plot the subtype distribution and survival-time histogram side by side.
Reads the clinical column names from mdata.uns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mdata
|
MuData
|
Multi-omics object with clinical columns registered in |
required |
show
|
bool
|
If True, display the figure interactively. |
True
|
Source code in customics/visualization.py
Latent Representation¶
customics.CustOMICS.get_latent_representation(mdata)
¶
Compute the integrated central latent representation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mdata
|
MuData
|
Multi-omics object with all sources (same keys as used in |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Latent matrix, shape |
ndarray
|
correspond to |
Raises:
| Type | Description |
|---|---|
ModelNotFittedError
|
If called before |
Source code in customics/model.py
customics.CustOMICS.plot_representation(mdata, color=None, show=True)
¶
Compute latent representations and save a t-SNE scatter plot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mdata
|
MuData
|
Multi-omics object. |
required |
color
|
str | None
|
Column in |
None
|
show
|
bool
|
Display the figure interactively. |
True
|
Source code in customics/model.py
Survival Stratification¶
customics.CustOMICS.stratify(mdata, show=True)
¶
Stratify patients by predicted risk and plot Kaplan-Meier curves.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mdata
|
MuData
|
Multi-omics object. |
required |
show
|
bool
|
Display the figure interactively. |
True
|
Source code in customics/model.py
Explainability¶
customics.CustOMICS.explain(sample_ids, mdata, source, subtype, device=None, show=True)
¶
Compute and plot SHAP values for one omics source and one subtype.
Uses shap.DeepExplainer on the single-source forward path.
SHAP values are computed for subtype against all other classes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample_ids
|
list[str]
|
Sample IDs to use as the SHAP background and foreground sets. |
required |
mdata
|
MuData
|
Multi-omics object whose |
required |
source
|
str
|
Omics source key to explain. |
required |
subtype
|
str
|
Class label to explain. |
required |
device
|
str | None
|
Device for SHAP tensors. |
None
|
show
|
bool
|
Display the SHAP plot interactively. |
True
|
Raises:
| Type | Description |
|---|---|
ModelNotFittedError
|
If called before |
Source code in customics/model.py
610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 | |