mecfs_bio.asset_generator.h_magma_asset_generator
Asset generator for running H-MAGMA against GWAS summary statistics.
H-MAGMA (Sey et al. 2020) maps SNPs to genes using tissue-specific Hi-C
chromatin interaction data. The upstream project at
https://github.com/thewonlab/H-MAGMA/tree/master/Input_Files publishes six
pre-built .genes.annot files, one per tissue/cell type (adult brain, fetal
brain, cortical neurons, midbrain dopaminergic neurons, iPSC-derived
astrocytes, iPSC-derived neurons). This generator runs the MAGMA gene
analysis step against each of those six annotation files and produces a
gene-level Manhattan plot for each.
H-MAGMA's pre-built annotations replace the usual magma --annotate step,
so this generator skips :class:MagmaAnnotateTask and feeds the static
annotation directly into
:meth:MagmaGeneAnalysisTask.create_with_prebuilt_annotation.
The H-MAGMA annotation files are aligned to GRCh37/hg19 and key SNPs by RSID, so the standard EUR build-37 1000 Genomes LD reference is used.
Classes:
-
HMagmaTasks–The aggregate result of running H-MAGMA against all six annotations.
-
HMagmaTasksForAnnotation–All tasks produced for a single H-MAGMA tissue annotation.
Functions:
-
generate_h_magma_tasks–Generate one MAGMA gene analysis task and one gene-level Manhattan plot
Attributes:
-
H_MAGMA_ANNOTATION_TASKS(list[tuple[str, Task]]) –
H_MAGMA_ANNOTATION_TASKS
module-attribute
H_MAGMA_ANNOTATION_TASKS: list[tuple[str, Task]] = [
("adult_brain", ADULT_BRAIN_H_MAGMA_ANNOT_RAW),
("cortical_neuron", CORTICAL_NEURON_H_MAGMA_ANNOT_RAW),
("fetal_brain", FETAL_BRAIN_H_MAGMA_ANNOT_RAW),
("midbrain_da", MIDBRAIN_DA_H_MAGMA_ANNOT_RAW),
(
"ipsc_derived_astro",
IPSC_DERIVED_ASTRO_H_MAGMA_ANNOT_RAW,
),
(
"ipsc_derived_neuro",
IPSC_DERIVED_NEURO_H_MAGMA_ANNOT_RAW,
),
]
HMagmaTasks
The aggregate result of running H-MAGMA against all six annotations.
Methods:
Attributes:
labeled_by_annotation
HMagmaTasksForAnnotation
All tasks produced for a single H-MAGMA tissue annotation.
Attributes:
generate_h_magma_tasks
generate_h_magma_tasks(
base_name: str,
gwas_parquet_with_rsids_task: Task,
sample_size: int,
pipes: list[DataProcessingPipe] | None = None,
) -> HMagmaTasks
Generate one MAGMA gene analysis task and one gene-level Manhattan plot task per H-MAGMA tissue annotation (six in total).
gwas_parquet_with_rsids_task must produce a parquet with the GWASLAB
column names plus an RSID column (the standard input to MAGMA in this
repository).