mecfs_bio.build_system.task.lcv.lcv_task
Task to apply the Latent Causal Variable technique of O'Connor and Price to attempt to estimate the causal director between two genetically correlated traits. The key output value is GCP: Genetic Causality Proportion.
Citation: O’Connor, Luke J., and Alkes L. Price. "Distinguishing genetic correlation from causation across 52 diseases and complex traits." Nature genetics 50.12 (2018): 1728-1734.
Classes:
-
LCVConfig– -
LCVTask–Task to apply the Latent Causal Variable technique of O'Connor and Price to attempt
Functions:
Attributes:
-
DOWNSTREAM_TRAIT_COL– -
UPSTREAM_TRAIT_COL– -
Z_SCORE_1– -
Z_SCORE_2– -
Z_SCORE_COL– -
logger–
LCVConfig
Attributes:
-
build(GenomeBuild) – -
chisq_exclude_factor_threshold(float) – -
exclude_mhc_region(MHCRegion | None) –
LCVTask
Bases: Task
Task to apply the Latent Causal Variable technique of O'Connor and Price to attempt to estimate the causal director between two genetically correlated traits. The key output value is GCP: Genetic Causality Proportion.
Assume that the trat 1 and trait 2 datasets have already been harmonized via HarmonizeGWASWithReferenceViaRSIDTask
Methods:
Attributes:
-
config(LCVConfig) – -
consolidated_ld_scores(Task) – -
deps(list[Task]) – -
meta(Meta) – -
trait_1_data(Task) – -
trait_1_pipe(DataProcessingPipe) – -
trait_2_data(Task) – -
trait_2_pipe(DataProcessingPipe) –
create
classmethod
create(
asset_id: str,
trait_1_data: Task,
trait_2_data: Task,
consolidated_ld_scores: Task,
config: LCVConfig,
trait_1_pipe: DataProcessingPipe = IdentityPipe(),
trait_2_pipe: DataProcessingPipe = IdentityPipe(),
)
Source code in mecfs_bio/build_system/task/lcv/lcv_task.py
execute
Source code in mecfs_bio/build_system/task/lcv/lcv_task.py
align_traits_and_ld
align_traits_and_ld(
df_trait_1: LazyFrame,
df_trait_2: LazyFrame,
ld_scores: LazyFrame,
) -> nw.DataFrame