mecfs_bio.build_system.task.lava_task
Compute local genetic correlation using LAVA (Local Analysis of [co]Variant Association).
Implemented by Github copilot
See: Werme et al. "An integrated framework for local genetic correlation analysis" Nature Genetics 54 (2022): 274-282.
LAVA estimates local heritability (h2) for each phenotype at each genomic locus, and local genetic correlation (rg) between pairs of phenotypes at loci where both show significant heritability.
This task wraps the R LAVA package via rpy2.
Classes:
-
LDReferenceInfo–Reference LD data for LAVA.
-
LavaBinarySampleInfo–Sample information for a binary (case/control) phenotype.
-
LavaContinuousSampleInfo–Marker indicating a continuous (quantitative) phenotype.
-
LavaPhenotypeDataSource–A source Task providing tabular GWAS summary statistics for a phenotype.
-
LavaTask–Given a locus definition file, does the following for each locus:
Functions:
Attributes:
-
BIVAR_RESULTS_FILENAME– -
LAVA_A1_COL– -
LAVA_A2_COL– -
LAVA_N_COL– -
LAVA_SNP_COL– -
LAVA_Z_COL– -
LavaSampleInfo– -
UNIV_RESULTS_FILENAME– -
logger–
LavaSampleInfo
module-attribute
LDReferenceInfo
Reference LD data for LAVA.
filename_prefix is the prefix of the PLINK-format LD reference files (i.e. the path without .bed/.bim/.fam extensions).
Attributes:
-
filename_prefix(str) – -
ld_ref_task(Task) –
LavaBinarySampleInfo
Sample information for a binary (case/control) phenotype.
LAVA uses cases and controls to determine if a phenotype is binary, and optionally uses prevalence to convert observed h2 to liability scale.
Methods:
Attributes:
from_ct_ldsc_sample_info
classmethod
Source code in mecfs_bio/build_system/task/lava_task.py
LavaContinuousSampleInfo
Marker indicating a continuous (quantitative) phenotype.
Attributes:
-
total_sample_size(int | None) –
LavaPhenotypeDataSource
A source Task providing tabular GWAS summary statistics for a phenotype.
Column names are assumed to be in GWASLAB format (see: mecfs_bio/constants/gwaslab_constants.py). Data will be copied and converted to the format expected by LAVA.
Attributes:
-
alias(str) – -
asset_id(AssetId) – -
pipe(DataProcessingPipe) – -
sample_info(LavaSampleInfo) – -
task(Task) –
LavaTask
Bases: Task
Given a locus definition file, does the following for each locus: - Estimates heritability for all phenotypes using LAVA - For each pair of phenotypes whose heritabilities are both significant at the locus, calculates local genetic correlation using LAVA
Outputs two CSV files to scratch_dir: - lava_univariate.csv: heritability estimates per phenotype per locus - lava_bivariate.csv: genetic correlation estimates per phenotype pair per locus
Methods:
Attributes:
-
ct_ldsc_task_for_overlap(Task | None) – -
deps(list[Task]) – -
heritability_task_for_overlap(Task | None) – -
lava_locus_definitions_task(Task) – -
ld_reference_info(LDReferenceInfo) – -
max_loci(int | None) – -
meta(Meta) – -
sources(Sequence[LavaPhenotypeDataSource]) – -
univ_p_threshold(float) –
ct_ldsc_task_for_overlap
class-attribute
instance-attribute
heritability_task_for_overlap
class-attribute
instance-attribute
create
classmethod
create(
asset_id: str,
sources: Sequence[LavaPhenotypeDataSource],
ld_reference_info: LDReferenceInfo,
lava_locus_definitions_task: Task,
ct_ldsc_task_for_overlap: Task | None = None,
heritability_task_for_overlap: Task | None = None,
univ_p_threshold: float = 0.05,
max_loci: int | None = None,
) -> LavaTask
Source code in mecfs_bio/build_system/task/lava_task.py
execute
Source code in mecfs_bio/build_system/task/lava_task.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |