Skip to main content

crc-mets-vis: CRC metastasis explorer

A Streamlit app with a custom D3 component, organized as overview → explore → details:

  1. Who has metastases? A matrix of any two attributes (default: primary site group × race/ethnicity). Each bar shows the share of the cell's patients with metastasis, split into at diagnosis (first metastasis within N days, set in the sidebar) and found later. The whisker is the 95% CI and the dashed tick is the rate for all patients.
  2. Which organs, and how do patients fare? A transposed UpSet plot for the selected cell. Each row is one organ combination with its patient count (at diagnosis / later) and a survival curve measured from the first metastasis, drawn against all metastatic patients. The bars above the organ columns show 1-year survival by organ involved.
  3. Patients. A swimmer plot for the clicked combination: one lane per patient, with organ markers at the time of each metastasis and follow-up ending in death (×) or alive (›).

Groups smaller than Hide counts below (sidebar; default 11, the SEER-Medicare rule) are hidden in every view. Lower it only for exploring; anything shared must use at least 11.

Which data file is used

  1. --data <folder> / --file <csv> given to crc-mets-vis run (the launcher does this)
  2. otherwise DATA_FILE at the top of src/crc_mets_vis/app.py (default None)

There is no fallback: without a defined file the app shows nothing. The sidebar always shows which file is loaded.

Layout

crc-mets-vis/                      (same layout as the project folder in the secure environment)
├── final_CRC_mets_full.csv        (the app reads this file)
└── vis-app/
    ├── app.py                     dev entry: streamlit run app.py
    ├── make_synthetic_data.py     writes fake CSVs to ../
    ├── pyproject.toml             package metadata (name on PyPI: crc-mets-vis)
    └── src/crc_mets_vis/
        ├── app.py                 the Streamlit page
        ├── analysis.py            loading, summaries, small-cell rule, Kaplan-Meier
        ├── attributes.py          attribute bins / labels / order  <- edit here
        ├── cli.py                 crc-mets-vis run | make-launcher | demo-data
        ├── synth.py               synthetic data generator
        └── component/frontend/    index.html, main.js, style.css, d3.v7.min.js

Develop locally

cd vis-app
conda create -y -n crcvis python=3.12 && conda activate crcvis
python -m pip install -e .
python make_synthetic_data.py      # fake data in ../ (no real patients)
python -m streamlit run app.py

After editing analysis.py or attributes.py, press C in the app (clear cache) or restart.

Publish to PyPI (no file transfer needed)

python -m pip install build twine
# bump __version__ in src/crc_mets_vis/__init__.py first
python -m build                     # -> dist/*.whl, dist/*.tar.gz
python -m twine upload dist/*       # username: __token__, password: your PyPI API token

The package contains code only, never data. It's public once uploaded.

Install in a secure environment (once)

In Anaconda Prompt inside the secure environment (set DATA to the folder that holds final_CRC_mets_full.csv):

set DATA=<project folder>
C:\ProgramData\anaconda3\python.exe -m venv "%DATA%\crcvis-env"
"%DATA%\crcvis-env\Scripts\python.exe" -m pip install crc-mets-vis
"%DATA%\crcvis-env\Scripts\python.exe" -m crc_mets_vis make-launcher --data "%DATA%"

This writes two files next to the data:

  • Open CRC metastasis explorer.bat: double-click to start the app. A browser tab opens, and closing the black window stops the app.
  • Update CRC metastasis explorer.bat: double-click to install the newest version from PyPI.

The launcher calls the environment's Python by its full path, so users never activate anything. Each user gets their own free port, so several people can use it at once on the shared desktop. If pip can't reach PyPI, set your environment's proxy first (set HTTPS_PROXY=... and HTTP_PROXY).

Metadata

Release files for crc-mets-vis 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crc-mets-vis 0.1.0
File Size Uploaded Provenance Actions
crc_mets_vis-0.1.0.tar.gz 122.9 kB Without provenance Details for crc_mets_vis-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for crc-mets-vis 0.1.0
File Interpreter ABI Platform Actions
crc_mets_vis-0.1.0-py3-none-any.whl Python 3 none any Details for crc_mets_vis-0.1.0-py3-none-any.whl

Total release size: 247.4 kB

Release files / crc_mets_vis-0.1.0.tar.gz

Download URL crc_mets_vis-0.1.0.tar.gz
Size 122.9 kB
Tags Source
SHA-256 checksum
How to use checksums
29ddf90ecdcb6c3f9e4515372acfe556b21c4c53d066745dac8f9f02c45a30e0
BLAKE2b-256 checksum
How to use checksums
6f4c33ab1b467214c5ffa8951c9651f88c43800614fc9a542f0f59259f212109
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.11

Release files / crc_mets_vis-0.1.0-py3-none-any.whl

Download URL crc_mets_vis-0.1.0-py3-none-any.whl
Size 124.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc6af0a9058737a989781b9c3b83c6aadadc666db8a37e259619817c5584ddb2
BLAKE2b-256 checksum
How to use checksums
cb196f1b3b9259d9d36331d991778f06a0c1b0fbc76d31ce0ab4012576f37419
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.11

Security for crc-mets-vis 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page