mecfs_bio.build_system.task.protein_coloc.ppp_window_fetcher
Fetch dense protein summary statistics for a few locus windows, then discard the download.
The DenseWindowFetcher protocol is what the colocalization Task depends on, so any proteomics source (UKB-PPP, CSF pQTL, ...) can be plugged in. Fetched frames are in the common window schema (WINDOW_SCHEMA, positions in GRCh38) but NOT yet oriented to the reference genome: EA/NEA are whatever the source reports, and orientation happens downstream.
PppWindowFetcher downloads a protein's UKB-PPP tar from Synapse once per call, reads only the chromosome files the windows need (one at a time, only the needed columns), filters each window, and deletes the tar and the extracted files before returning. In PPP's regenie files ALLELE1 is the effect allele and A1FREQ its frequency; ALLELE0 is the other allele.
Classes:
-
DenseWindowFetcher– -
LocusWindow–A closed GRCh38 interval [start, end] on chromosome chrom (X coded as 23).
-
PppWindowFetcher–DenseWindowFetcher for UKB-PPP.
DenseWindowFetcher
LocusWindow
PppWindowFetcher
DenseWindowFetcher for UKB-PPP.
proteins: the manifest rows of every protein that may be requested, looked up by OID.
Methods:
-
fetch–
Attributes:
-
proteins(tuple[PppProteinFile, ...]) –
fetch
fetch(
protein_id: str,
windows: Sequence[LocusWindow],
scratch_dir: Path,
wf: WF,
) -> dict[str, pl.DataFrame]