r/Python • u/AutoModerator • 26d ago
Showcase Showcase Thread
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
33
Upvotes
r/Python • u/AutoModerator • 26d ago
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
View all comments
1
u/DoctorKhru 18d ago
GitHub Repository: https://github.com/Lukecele/inflammatory-onco-physics
Google Colab Demo: https://colab.research.google.com/github/Lukecele/inflammatory-onco-physics/blob/main/demo_inflammatory_onco_physics.ipynb
Preprint (Springer Nature / Research Square): https://doi.org/10.21203/rs.3.rs-11695210/v1
What My Project Does
I developed an open-source Python framework (
inflammatory-onco-physics) that models how targeted cancer drugs (like osimertinib) diffuse from microvessels through solid tumor tissue, and why drug-tolerant persister cells survive in perivascular "sanctuary shells" without developing secondary resistance mutations.It couples continuous spatial reaction-diffusion physics with longitudinal liquid biopsy (ctDNA) shedding dynamics and complete-case survival analysis across 3,461 clinical patients.
How It’s Built & Key Python Components
simulation/model.py):Instead of computationally heavy 3D Finite Element (FEM) meshes, we solve steady-state cylindrical reaction-diffusion with clearance using
scipy.special.kn(modified Bessel function of the second kind, K₀). This calculates exact sub-therapeutic radii (r_crit = 165.9 μm) in microseconds, enabling 10,000+ Monte Carlo parameter draws in seconds.simulation/simulate_relapse.py):Simulates tumor cell turnover, metabolic dormancy (G0/G1 arrest), and mononucleosomal fragment intravasation into blood capillaries. Implements an algebraic lead-time identity (Δt = Ts · log₂(100)) predicting molecular relapse ~5.5 months prior to macroscopic imaging.
pipeline/):Uses
lifelinesandscikit-learnfor multivariate Cox Proportional Hazards modeling, non-parametric bootstrap resampling (B = 1,000) for Concordance Index (C-index) estimation, and permutation stress-tests with strict REMARK reporting compliance.app_bedside_calculator.py):A pure standard-library CLI interface for computing sanctuary volumes and relapse risk scores with zero external dependencies.
Target Audience
Computational biologists, biophysicists, data scientists working with clinical survival data, and anyone interested in mathematical oncology.
Code & Feedback
The repository includes a ready-to-run Google Colab notebook that executes the complete biophysical simulation, runs the Monte Carlo parameter sweep, and reproduces the figures on a free GPU/CPU instance.
I’d love any feedback on the Python architecture, performance optimizations for the Bessel parameter sweep, or the survival pipeline!