gitbenlewis docs

Available Documentation

  • pyoncoplot Documentation
    • Start Here
    • Minimal Example
    • Documentation Map
      • Installation
        • Development Install
        • Runtime Dependencies
        • Verify The Install
        • Next Step
      • Quickstart
        • Input Data
        • Interactive Plotly Plot
        • Static Matplotlib Plot
        • Result Object
        • Where To Go Next
      • Data Inputs
        • Required Columns
        • Example Mutation Table
        • Multi-Hit Behavior
        • Gene Selection
        • Sample Selection
        • Row and Sample Filters
        • Validation Rules
      • API Reference
        • oncoplot
        • merge_oncoplot_params
        • OncoplotResult
        • prepare_oncoplot_data
        • identify_top_genes
        • score_sample_by_gene_rank
        • rank_genes_by_pathway
        • prettify
        • Palette Helpers
      • Options Reference
        • Size and Layout
        • Labels and Axes
        • Legends
        • Tile Styling
        • Fonts
        • Titles
        • TMB and Gene Bar
        • Pathways
        • Metadata
        • Text Prettification
        • Common Bundles
      • Palettes
        • Mutation Palette
        • Metadata Palette
        • Variant Value Palette
        • TMB Palette
        • Default Palettes
        • Practical Color Guidance
      • Metadata and TMB
        • Metadata Table Schema
        • Metadata Columns in Mutation Data
        • Metadata Filtering
        • Numeric Metadata
        • Categorical Metadata Order
        • TMB Inference
        • Custom TMB Data
      • Pathways and Sorting
        • Default Gene Ranking
        • Explicit Gene Order
        • Pathway Input
        • Sample Ordering
        • Metadata Sorting
        • Showing All Samples
      • Rendering Backends
        • Plotly
        • Matplotlib
        • Choosing A Backend
        • Backend Support Matrix
      • Example Gallery
        • Render The Clean Gallery
        • Regenerate Gallery Inputs
        • BRCA Comparison Sheets
        • Accepted Clean Baselines
        • Presets
        • Config-Driven Runs
        • Input Families
        • Related Examples
      • Example Plot Source Citations
        • Plot-To-Source Map
        • Directly Used Papers
        • TCGA And Xena Data Sources
        • Documentation And Source Image Pages
        • Notes
      • Basic Example
      • Metadata Example
      • BRCA Gallery Example
        • Render The Default BRCA Outputs
        • Render Comparison Sheets
        • Inputs
        • Inspect The Preset Code
      • Migration From ggoncoplot
        • Argument Mapping
        • Options Mapping
        • R-Style Concept
        • Python Version
        • Important Differences
        • ggoncoplot Parity Status
        • Recommended Migration Path
      • Development
        • Local Setup
        • Repository Layout
        • Regenerate Gallery Inputs
        • Regenerate Gallery Images
        • Adding A Gallery Preset
        • Documentation Changes
      • Troubleshooting
        • Missing Column Errors
        • Empty Or Missing Sample/Gene Identifiers
        • Palette Coverage Errors
        • Metadata Duplicate Sample Errors
        • Samples Disappear
        • Plotly Image Export Fails
        • Matplotlib Font Warnings
        • Very Large Cohorts
  • adata_science_tools docs
    • Available pages
    • Notes
      • _IO
        • save_dataset
        • make_df_obs_adataX
        • Data source selection
        • Column labeling
        • Row indexing
        • include_obs
        • Dense conversion and scale
        • Current limitations and caveats
      • _column_plots
        • Public entry points
        • Shared data model
        • barh_column
        • l2fc_dotplot_single
        • l2fc_dotplot_column
        • barh_l2fc_dotplot_column
        • Advanced composite variants
        • Common caveats
      • _corr_dotplots
        • Main entry points
        • corr_dotplot
        • corr_dotplot_dev
        • spearman_cor_dotplot
        • Secondary helpers
        • Example with plain DataFrame
      • _datapoints
        • datapoints
      • _diff_test
        • Full signature
        • Supported test families
        • Input modes
        • Required keys and pairing rules
        • Examples by workflow
        • Output table shape
        • Save and storage behavior
        • Validation and edge cases
        • Practical notes
      • _expectation_based_covar_correction
        • Core model
        • calculate_expectations
        • Expectation table schema
        • model_spec
        • Saving and reloading artifacts
        • predict_expectation
        • regress_out
        • excess_expectation
        • convert_ols_summary_to_expectation_df
        • reconstruct_expectation_model_spec
        • Wrapper workflow
        • Common validation errors
        • Practical workflow summary
      • _histograms
        • Main entry point
        • adata_histograms
        • Full signature
        • Basic example
        • Legend positioning
        • Supported input modes
        • All-variable stacked histogram
        • Variable-grouped histograms
        • Filtering and Subsets
        • Important behavior
      • _metab_IO
        • Full signature
        • Basic parsing workflow
        • Layer creation
        • Returned AnnData
        • Save behavior
        • External metadata merge
        • Example with external metadata
        • Current implementation caveats
        • When to use this module
      • _model_fit
        • OLS workflow
        • MixedLM workflow
        • Filtering before fit
        • Low-level *_wide(...) APIs
        • Result table schema
        • Sidecar YAML model specs
        • adata.uns storage
        • Behavior and constraints
        • Feature annotation merge
        • Practical guidance
      • _paired_datapoints
        • Main entry point
        • paired_datapoints
        • Full signature
        • Basic AnnData example
        • Title and axis label placement
        • Synthetic example plot
        • Supported input modes
        • Pairing behavior
        • Bounds
        • ref_vs_target_adata() source values
        • Filtering and subsets
        • Variable grouping and collapse
        • Logging
        • Return value
      • _plots
        • volcano_plot_generic
        • qqplot
        • timeseries_paired_datapoints
        • Coverage note
      • _plots_depreciated
        • Legacy entry points
        • Preferred replacements
        • Important differences from the modern APIs
        • Recommendation
        • Coverage note
      • _preprocessing
        • Main row-operation entry points
        • ref_vs_target_adata
      • _row_plots
        • plot_columns
        • Coverage note
      • _simulate_data
        • Main entry points
        • sim_observations_covars
        • sim_covar_dependent_features
        • sim_covar_dependent_dataset
        • Repo example workflow
      • _somascan_IO
        • read_adat_2_AnnData
        • soma_fill_sampletype_obs_values
        • soma_make_adata_index_unique_by_merge
        • make_df_obs_adataX_soma
        • Practical guidance
        • Current caveats
      • _utils
        • Public entry points
        • show_tol_colors
        • show_colors
        • Coverage note
      • _venn_plots
        • Public functions
        • venn_plot_2list
        • venn_plot_3list
        • geneset_enrichment_venn
        • geneset_enrichemnt_ol_ven_M_n_N_x
        • Coverage note
      • palettes
        • Main palette constants
        • Typical usage
        • Internal helper
        • Coverage note
  • single_cell_python_tools docs
    • Documentation Pages
    • Source Links
      • Installation
        • Conda Environment
        • Editable Install
        • Verify Import
      • Quickstart
        • Notebook Path Setup
        • Function-Based Workflow
        • DATASET_class Workflow
      • DATASET_class
        • Constructor
        • Data And Output Methods
        • QC And Filtering Methods
        • Transform Methods
        • Clustering Methods
        • Plotting Methods
        • Notes
      • Preprocessing IO
        • reset_cellxgene_var_names
        • downcast_layers_to_float32
      • Preprocessing QC
        • annotate_QC_genes
        • calculate_qc_metrics
        • plot_QC_metrics_scatter
        • plot_QC_metrics_violin
        • plot_qc_metrics
        • annotate_n_view_adata_raw_counts
        • basic_filitering
        • filter_cells_by_anotated_QC_gene
        • remove_genes
      • Preprocessing Transform Data
        • process2scaledPCA
        • norm_log
        • HVG_selection_log_norm_seurat
        • HVG_selection_log_norm_seurat_v3
        • HVG_removal
        • regress_out_anotated_QC_genes
        • scale_func
        • PCA_func
        • calc_cell_cycle_score
        • regress_cell_cycle_score_func
      • Preprocessing Clustering
        • leiden_clustering
        • rename_leiden_clusters
        • Legacy Rename Helpers
        • leiden_cluster_sil_score
        • silhouette_walk_Largest_drop
        • silhouette_walk_4_Largest_drops
      • Plotting
        • silhouette_score_n_plot
        • silhouette_score_of_obs_key_n_plot
        • plot_batch_obs_key_of_obs_key2
        • plot_adata_row_total_dist
        • plot_adata_raw_and_X_rowdist_old
        • plot_adata_raw_and_X_rowdist
      • Deprecated Plotting Helpers
        • plot_batch_obs_key_of_obs_key2_old
        • plot_percent_obs_key2_per_batch_obs_key
      • Scanpy Tools
        • General Utilities
        • Annotation Helpers
        • Differential Expression And Enrichment
        • Filtering And Summaries
        • Notes
      • Ingest Verbose
        • ingest_verbose
        • Ingest
        • Export Note
      • Example Notebooks
        • PBMC3k
        • Publishing Policy
      • API Reference
        • Top-Level Namespace
        • DATASET_class
        • sctl.pp
        • sctl.pl
        • sctl.tl
        • Direct Module APIs
      • Development
        • Repository Layout
        • Documentation Maintenance
        • Public API Notes
      • Troubleshooting
        • Import Fails With Missing Scanpy
        • Python Version Mismatch
        • Notebook Cannot Find The Package
        • Output Directories Are Missing
        • Links In Published Docs Go To GitHub
  • Coding Cheatsheets
    • Documentation
    • Full Cheatsheets
    • Fast Project Startup
    • GitHub and Git
      • Clone, Status, and History
      • Stage, Commit, and Push
      • Branches, Remotes, and Pull Requests
      • Submodules
    • Conda Environments
      • Setup and Channels
      • Create, Use, and Remove Environments
      • Packages, Environment Files, and Jupyter
    • Bash
      • Navigation and Files
      • View, Search, and Redirect
      • Permissions, Environment, and Processes
    • Python
      • Run Python and Manage Packages
      • Script Pattern, Paths, and Files
      • Arguments, Testing, and Debugging
    • R
      • Run R and Manage Packages
      • Files and Data Frames
      • dplyr, ggplot2, and Jupyter
    • SQL and PostgreSQL
      • Connect and Navigate
      • Query Data
      • Join, Group, and Modify
      • Import, Export, and Back Up
    • Legacy Material
      • GitHub and Git Cheatsheet
        • Repository Setup
        • Status and History
        • Stage, Commit, and Push
        • Pull and Sync
        • Submodules
        • Branches
        • Merge Basics
        • Undo Common Mistakes
        • GitHub CLI
      • Conda Environments Cheatsheet
        • Setup
        • Create and Activate
        • Install and Update Packages
        • Environment Files
        • Jupyter Kernels
        • Clean Up
      • Bash Cheatsheet
        • Navigation
        • Files and Directories
        • View Files
        • Search
        • Pipes and Redirects
        • Permissions
        • Environment and History
        • Processes
      • Python Cheatsheet
        • Run Python
        • Virtual Environments and Packages
        • Basic Script Pattern
        • Imports and Paths
        • File I/O
        • Lists and Dictionaries
        • Functions and Errors
        • Command Line Arguments
        • Debugging
      • R Cheatsheet
        • Run R
        • Packages
        • Working Directory and Files
        • Vectors, Lists, and Factors
        • Data Frames
        • dplyr
        • Plotting
        • Jupyter and RStudio
      • SQL and PostgreSQL Cheatsheet
        • Connect with psql
        • psql Navigation
        • Databases and Tables
        • Select and Filter
        • Joins and Grouping
        • Insert, Update, and Delete
        • CSV Import and Export
        • Backup and Restore
        • Admin
gitbenlewis docs
  • pyoncoplot Documentation
  • Example Gallery
  • Edit on GitHub

Example Gallery

The gallery recreates reference-style oncoplot figures from deterministic local inputs. Active goal plots are limited to figures that can be rendered directly through the public oncoplot() API with renderer: oncoplot.

Runtime choices live in python_refactor_goal_sources/config.yaml under the gallery_params block. recreate_gallery.py loads that YAML and renders clean runs by passing params.oncoplot to public oncoplot(), including table sources, gene choices, sample or mutation filters, metadata tracks, legends, and layout options.

Render The Clean Gallery

python3 python_refactor_goal_sources/recreate_gallery.py

Outputs are written to:

python_refactor_goal_sources/generated_plots/clean/

Regenerate Gallery Inputs

python3 python_refactor_goal_sources/generate_synthetic_inputs.py

This regenerates the deterministic non-fuc fixtures. The Python/fuc AML fixtures are derived from upstream sbslee/fuc-data files with:

python3 python_refactor_goal_sources/fuc_sources/rebuild_fuc_fixtures.py --source-dir /path/to/fuc-data

Gallery inputs are checked in under:

python_refactor_goal_sources/syntheitic_goal_data/

BRCA Comparison Sheets

python3 python_refactor_goal_sources/recreate_gallery.py --style comparison --preset brca_large
python3 python_refactor_goal_sources/recreate_gallery.py --style comparison --preset brca_compact_complex

Comparison sheets contain two panels: the original source image and the clean generated image.

Outputs are written to:

python_refactor_goal_sources/generated_plots/comparison/

Accepted Clean Baselines

The generated AML metadata plots are treated as approved clean baselines:

python_refactor_goal_sources/generated_plots/clean/gen.goal_plot_11.png
python_refactor_goal_sources/generated_plots/clean/gen.goal_plot_12.png
python_refactor_goal_sources/generated_plots/clean/gen.goal_plot_13.png

Do not tune these toward the originals if it makes the generated versions worse.

Presets

Goal plots are compactly numbered by source family: ggoncoplot/R oncoplot examples first, other R-based oncoplot-style examples next, and Python/fuc AML examples last.

Preset

Output

Size

Notes

brca_large

gen.goal_plot_01.png

3600 x 1800

ggoncoplot/R large BRCA oncoplot

ggoncoplot_readme_small

gen.goal_plot_02.png

672 x 480

ggoncoplot/R small README oncoplot

ggoncoplot_readme_basic

gen.goal_plot_03.png

7200 x 3000

ggoncoplot/R README basic oncoplot

ggoncoplot_readme_marginal

gen.goal_plot_04.png

7200 x 3600

ggoncoplot/R oncoplot with marginal bars

ggoncoplot_readme_metadata

gen.goal_plot_05.png

7200 x 3600

ggoncoplot/R oncoplot with clinical metadata

paper_gbm_oncoplot

gen.goal_plot_06.png

864 x 432

ggoncoplot/R compact paper-style GBM oncoplot

brca_compact_complex

gen.goal_plot_07.png

850 x 683

other R-based paper compact BRCA oncoplot

cssc_compact

gen.goal_plot_08.png

1400 x 700

other R-based paper alteration matrix

gbm_clinical_molecular

gen.goal_plot_09.png

1080 x 436

other R-based paper GBM clinical/molecular heatmap

aml_basic

gen.goal_plot_10.png

1080 x 720

Python/fuc basic AML oncoplot

aml_metadata_unsorted

gen.goal_plot_11.png

1080 x 720

Python/fuc accepted clean baseline

aml_metadata_sorted

gen.goal_plot_12.png

1080 x 720

Python/fuc accepted clean baseline

aml_metadata_survival

gen.goal_plot_13.png

1080 x 720

Python/fuc survival-filtered AML baseline

Config-Driven Runs

Each plot_runs entry declares its renderer, output file, source goal plot, expected size, run toggle, and renderer params:

gallery_params:
  plot_runs:
    brca_large:
      run: true
      renderer: oncoplot
      style: clean
      output_name: gen.goal_plot_01.png
      goal_plot: goal_plot_01.png
      expected_size: [3600, 1800]
      params:
        oncoplot:
          data: {path: syntheitic_goal_data/brca_mutations.tsv, sep: "\t"}
          gene_col: gene
          sample_col: sample
          mutation_type_col: mutation_type
          include_genes: [PIK3CA, TP53, CDH1]
          options:
            width: 3600
            height: 1800

Generated outputs keep the zero-padded numbered naming convention: gen.goal_plot_NN.png for generated plots and compare.goal_plot_NN.png for comparison sheets.

Input Families

Family

Files

AML/fuc

aml_mutations.tsv, aml_metadata.tsv, aml_tmb.tsv, aml_palette.json, aml_gallery_params.json

BRCA

brca_mutations.tsv, brca_metadata.tsv, brca_tmb.tsv, brca_palette.json

CSSC

cssc_mutations.tsv, cssc_tmb.tsv, cssc_palette.json

GBM

gbm_clinical_tracks.tsv, gbm_events.tsv, gbm_palette.json

ggoncoplot README

ggoncoplot_readme_mutations.tsv, ggoncoplot_readme_metadata.tsv, ggoncoplot_readme_tmb.tsv, ggoncoplot_readme_palette.json

Related Examples

  • Metadata Example

  • BRCA Gallery Example

Previous Next

© Copyright 2026, Ben Lewis.

Built with Sphinx using a theme provided by Read the Docs.