Reusable Reflex UI components for Polygenic Risk Score computation with PGS Catalog
Project description
prs-ui
Reusable Reflex UI components for Polygenic Risk Score (PRS) computation using the PGS Catalog.
Built on top of just-prs for the computation engine and reflex-mui-datagrid for data grid display.
Installation
pip install prs-ui
Quick Start
import polars as pl
import reflex as rx
from reflex_mui_datagrid import LazyFrameGridMixin
from prs_ui import PRSComputeStateMixin, prs_section
class MyAppState(rx.State):
genome_build: str = "GRCh38"
cache_dir: str = ""
status_message: str = ""
class PRSState(PRSComputeStateMixin, LazyFrameGridMixin, MyAppState):
def load_genotypes(self, parquet_path: str) -> None:
lf = pl.scan_parquet(parquet_path)
self.set_prs_genotypes_lf(lf) # preferred: provide a LazyFrame
self.prs_genotypes_path = parquet_path
def prs_page() -> rx.Component:
return prs_section(PRSState)
Components
| Component | Description |
|---|---|
prs_section(state) |
Complete PRS section: build selector + score grid + compute button + progress + results |
prs_build_selector(state) |
Genome build dropdown (GRCh37/GRCh38) |
prs_scores_selector(state) |
MUI DataGrid for score selection with checkboxes and filtering |
prs_compute_button(state) |
Compute button with disclaimer callout |
prs_progress_section(state) |
Progress bar and status text during computation |
prs_results_table(state) |
Results table with quality badges, interpretation cards, and CSV download |
State Mixin
PRSComputeStateMixin provides all PRS computation logic as a Reflex state mixin. Mix it into your concrete state class alongside LazyFrameGridMixin to get the full PRS workflow.
The preferred input method is a polars LazyFrame via set_prs_genotypes_lf() -- memory-efficient and avoids re-reading VCF files on each computation. A parquet path (prs_genotypes_path) is supported as a fallback.
Documentation
See the just-prs documentation for the full Python API, CLI reference, and integration guide.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prs_ui-0.1.2.tar.gz.
File metadata
- Download URL: prs_ui-0.1.2.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7b588841bc881bb87d1b097058cea68e92907ee2b8794750916be07914b4b5c
|
|
| MD5 |
88ad106b8cd3366f43b149c7048194bc
|
|
| BLAKE2b-256 |
642a9e58e7f04f4197b47790b4977504dd26008fb0eb17485d311e653d75f044
|
File details
Details for the file prs_ui-0.1.2-py3-none-any.whl.
File metadata
- Download URL: prs_ui-0.1.2-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f25ed6a8c10e85ef19cb34bcee6881edec2c9dc2cc7bb42ed90b12f1edae83a8
|
|
| MD5 |
632e762fb165531f14f9ef68def3e75b
|
|
| BLAKE2b-256 |
88fdbe58d27e2fe32695b8602735ee5a2af7c1acf9098f2f393edec76b868ee3
|