Skip to content

Commit

Permalink
feat: updating step config file
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Considine committed Apr 23, 2024
1 parent 78fcf1b commit 8d03d61
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
19 changes: 19 additions & 0 deletions src/gentropy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,24 @@ class WindowBasedClumpingStep(StepConfig):
_target_: str = "gentropy.window_based_clumping.WindowBasedClumpingStep"


@dataclass
class FinemapperConfig(StepConfig):
"""SuSiE fine-mapper step configuration."""

session: Any = field(
default_factory=lambda: {
"start_hail": True,
}
)
study_locus_to_finemap: str = MISSING
study_locus_collected_path: str = MISSING
study_index_path: str = MISSING
output_path: str = MISSING
locus_radius: int = MISSING
locus_l: int = MISSING
_target_: str = "gentropy.susie_finemapping.SusieFineMapperStep"


@dataclass
class Config:
"""Application configuration."""
Expand Down Expand Up @@ -385,3 +403,4 @@ def register_config() -> None:
cs.store(group="step", name="variant_index", node=VariantIndexConfig)
cs.store(group="step", name="variant_to_gene", node=VariantToGeneConfig)
cs.store(group="step", name="window_based_clumping", node=WindowBasedClumpingStep)
cs.store(group="step", name="susie_finemapping", node=FinemapperConfig)
6 changes: 3 additions & 3 deletions src/gentropy/susie_finemapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(
study_index_path: str,
output_path: str,
locus_radius: int = 500_000,
locus_L: int = 10,
locus_l: int = 10,
) -> None:
"""Run fine-mapping on a studyLocusId from a collected studyLocus table.
Expand All @@ -47,7 +47,7 @@ def __init__(
study_index_path (str): path to the study index
output_path (str): path to the output
locus_radius (int): Radius of base-pair window around the locus, default is 500_000
locus_L (int): Maximum number of causal variants in locus, default is 10
locus_l (int): Maximum number of causal variants in locus, default is 10
"""
# Read studyLocus
study_locus = (
Expand All @@ -62,7 +62,7 @@ def __init__(
study_locus,
study_index,
locus_radius * 2,
locus_L,
locus_l,
)
# Write result
result.df.write.mode(session.write_mode).parquet(
Expand Down

0 comments on commit 8d03d61

Please sign in to comment.