mecfs_bio.asset_generator.protein_coloc_asset_generator
Asset generator for colocalizing one trait GWAS with the proteins of one proteomics GWAS (UKB-PPP plasma, Western et al. CSF).
Builds, for one GRCh38-harmonized trait: the TraitProteinColocTask (raw results and aligned windows) and the docs-facing display table of the pairs with PP.H4 above a threshold. Stacked locus plots are not built per run: generate_coloc_locus_plot_task makes them for hand-picked pairs of a run. The proteomics source supplies the hit table, the dense window fetcher and the gene coordinates; the GRCh38 genome, allele-frequency panel and gene track are shared by every source.
Classes:
-
ColocStackPlotGroup–plot_task: the per-locus stacked plots (PNG, SVG and an index table in one directory).
-
ColocTaskGroup– -
ProteomicsColocSource–asset_infix: names the source in the asset ids ({base}_{infix}_coloc, ...).
Functions:
-
generate_coloc_locus_plot_task–Stacked locus plots of chosen tested pairs of one coloc run.
-
generate_coloc_locus_stack_plot_task–Per-locus stacked trait and protein Manhattan plots of the top display-table loci.
-
generate_coloc_protein_info_task–UniProt and Ensembl annotations of the colocalizing proteins at the top display-table loci.
-
generate_protein_coloc_tasks–base_name: prefix of the asset ids.
Attributes:
ColocStackPlotGroup
plot_task: the per-locus stacked plots (PNG, SVG and an index table in one directory). svg_task: just the SVG figures, copied out of plot_task's directory. png_task: just the PNG figures, copied out of plot_task's directory.
Methods:
-
terminal_tasks–
Attributes:
-
plot_task(ColocLocusStackPlotTask) – -
png_task(CopyFilesWithSuffixFromDirectoryTask) – -
svg_task(CopyFilesWithSuffixFromDirectoryTask) –
ColocTaskGroup
ProteomicsColocSource
asset_infix: names the source in the asset ids ({base}_{infix}_coloc, ...). hit_table_task: the source's protein hit-segment table. gene_coords_task, gene_coords_reader: the GRCh38 gene-coordinate table and its reader. fetcher: dense window source of the proteomics GWAS.
Attributes:
-
asset_infix(ProteomicsSourceInfix) – -
fetcher(DenseWindowFetcher) – -
gene_coords_reader(GeneCoordsReader) – -
gene_coords_task(Task) – -
hit_table_task(ProteinHitTableTask) –
generate_coloc_locus_plot_task
generate_coloc_locus_plot_task(
asset_id: str,
group: ColocTaskGroup,
pairs: tuple[ColocPair, ...],
) -> ColocLocusPlotTask
Stacked locus plots of chosen tested pairs of one coloc run.
Source code in mecfs_bio/asset_generator/protein_coloc_asset_generator.py
generate_coloc_locus_stack_plot_task
generate_coloc_locus_stack_plot_task(
asset_id: str,
group: ColocTaskGroup,
max_loci: int = 10,
trait_name: str | None = None,
) -> ColocStackPlotGroup
Per-locus stacked trait and protein Manhattan plots of the top display-table loci.
trait_name, if given, labels the trait row in place of "trait".
The SVG and PNG figures are also copied out into their own directories (asset ids with _svg and _png appended).
Source code in mecfs_bio/asset_generator/protein_coloc_asset_generator.py
generate_coloc_protein_info_task
generate_coloc_protein_info_task(
asset_id: str, group: ColocTaskGroup, max_loci: int = 10
) -> ColocProteinInfoTask
UniProt and Ensembl annotations of the colocalizing proteins at the top display-table loci.
Only UKB-PPP runs are supported: the UniProt accessions of each protein are read from the Sun et al. 2023 ST3 sheet, the run's gene-coordinate table.
Source code in mecfs_bio/asset_generator/protein_coloc_asset_generator.py
generate_protein_coloc_tasks
generate_protein_coloc_tasks(
base_name: str,
source: ProteomicsColocSource,
trait_task: Task,
trait_model: TraitModel,
config: ColocRunConfig,
h4_threshold: float = 0.8,
) -> ColocTaskGroup
base_name: prefix of the asset ids. trait_task: the trait GWAS, genome-reference harmonized to GRCh38. trait_model: quantitative or case-control, as coloc.abf needs.