$ show statgen/pheweb
Pheweb is a full-stack web application for building interactive PheWAS (Phenome-Wide Association Study) websites from GWAS summary statistics. It provides a command-line pipeline to ingest association files, annotate variants with rsIDs and genes, compute Manhattan and QQ plots, and generate a searchable, browsable web interface with LocusZoom region views, phenotype correlations, and top hits tables. The architecture is a Flask monolith with a JavaScript frontend using D3.js, jQuery, and Bootstrap. While the codebase is well-organized for its domain and includes some reusable components (e.g., a simple flat-file indexer and a CFFI matrix builder), it suffers from significant technical drift: outdated dependencies (Flask 1.1, jQuery 1.12, Bootstrap 3.3.7, D3 v5), deprecated Python patterns, and a successor project (PheWeb2) explicitly recommended in the README. The project is functionally complete but in maintenance mode, with limited test coverage and several known bugs documented in the changelog.
The LLM identified 2 files worth highlighting for reuse:
A self-contained module that implements a simple byte-offset index for flat files using pickle. It provides append, get, and close operations, and can be used to index any flat file by key. No internal dependencies beyond the standard library, making it trivially reusable in other projects that need a lightweight, persistent key-value index for flat files.
A CFFI wrapper for a C++ module (x.cpp) that efficiently creates a tabixed matrix of all variants across all phenotypes. The C++ code uses raw pointers and manual memory management for performance. This component is self-contained and demonstrates a reusable pattern for integrating high-performance C++ code into Python for data-intensive operations, though it requires a C++ compiler and careful platform handling.