Migration From ggoncoplot
pyoncoplot uses Pythonic argument names rather than preserving R argument
names. This keeps the API natural for pandas, Plotly, and Matplotlib users.
Argument Mapping
R |
Python |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Options Mapping
ggoncoplot_options() is represented by OncoplotOptions. R argument names are
not accepted directly, but the same concepts are available with Python names.
R option concept |
Python option |
|---|---|
pathway strip text angle |
|
gene bar percentage label padding/nudge |
|
gene bar axis breaks |
|
layout buffers |
|
mutation legend key size |
|
metadata legend layout/key size |
|
metadata NA marker size |
|
metadata label style |
|
numeric metadata label size |
|
metadata heatmap legend orientation |
|
R-Style Concept
ggoncoplot(
data = mutations,
col_genes = "gene",
col_samples = "sample",
col_mutation_type = "mutation_type",
topn = 10
)
Python Version
from pyoncoplot import oncoplot
result = oncoplot(
mutations,
gene_col="gene",
sample_col="sample",
mutation_type_col="mutation_type",
top_n=10,
)
Important Differences
Python output can be Plotly or Matplotlib.
Plotly output is interactive and can export standalone HTML.
Matplotlib output is better for deterministic PNG/SVG/PDF figures.
The goal is feature parity, not pixel-identical ggplot output.
Synthetic gallery examples are checked in as TSV/JSON inputs rather than real patient data.
ggoncoplot Parity Status
Area |
Status |
Notes |
|---|---|---|
mutation validation, top genes, ties, multi-hit collapse |
supported |
behavior follows ggoncoplot semantics with Python errors |
sample sorting, metadata sorting, pathways, TMB inference |
supported |
custom TMB sample columns may appear in any position |
Matplotlib pathway strips, gene bars, metadata tracks, legends |
supported with renderer differences |
static output targets equivalent information, not ggplot pixel parity |
Plotly hover, click-to-copy, and linked selection |
supported with HTML hooks |
hover and clipboard behavior are provided in exported HTML; linked selection uses Plotly selection events |
R argument names and ggplot/ggiraph return objects |
intentionally different |
use Pythonic names and Plotly/Matplotlib objects |
Recommended Migration Path
Rename input columns explicitly through
gene_col,sample_col, andmutation_type_col.Start with
backend="matplotlib"if you are replacing static R figures.Add metadata and TMB inputs after the basic mutation matrix is correct.
Add palettes last, once all displayed mutation and metadata levels are known.
Compare against the synthetic gallery examples for layout patterns.