Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: updating step config file #580

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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