diff --git a/src/gentropy/config.py b/src/gentropy/config.py index 6592b9cfc..2925d73fd 100644 --- a/src/gentropy/config.py +++ b/src/gentropy/config.py @@ -17,8 +17,7 @@ class SessionConfig: write_mode: str = "errorifexists" spark_uri: str = "local[*]" hail_home: str = os.path.dirname(hail_location) - extended_spark_conf: dict[str, str] | None = field( - default_factory=dict[str, str]) + extended_spark_conf: dict[str, str] | None = field(default_factory=dict[str, str]) output_partitions: int = 200 _target_: str = "gentropy.common.session.Session" @@ -40,8 +39,7 @@ class ColocalisationConfig(StepConfig): credible_set_path: str = MISSING coloc_path: str = MISSING colocalisation_method: str = MISSING - colocalisation_method_params: dict[str, Any] = field( - default_factory=dict[str, Any]) + colocalisation_method_params: dict[str, Any] = field(default_factory=dict[str, Any]) _target_: str = "gentropy.colocalisation.ColocalisationStep" @@ -126,8 +124,7 @@ class EqtlCatalogueConfig(StepConfig): eqtl_catalogue_paths_imported: str = MISSING eqtl_catalogue_study_index_out: str = MISSING eqtl_catalogue_credible_sets_out: str = MISSING - mqtl_quantification_methods_blacklist: list[str] = field( - default_factory=lambda: []) + mqtl_quantification_methods_blacklist: list[str] = field(default_factory=lambda: []) eqtl_lead_pvalue_threshold: float = 1e-3 _target_: str = "gentropy.eqtl_catalogue.EqtlCatalogueStep" @@ -313,6 +310,7 @@ class LocusToGeneFeatureMatrixConfig(StepConfig): colocalisation_path: str | None = None study_index_path: str | None = None gene_index_path: str | None = None + interval_path: str | None = None feature_matrix_path: str = MISSING features_list: list[str] = field( default_factory=lambda: [ @@ -688,8 +686,7 @@ class Config: """Application configuration.""" # this is unfortunately verbose due to @dataclass limitations - defaults: List[Any] = field(default_factory=lambda: [ - "_self_", {"step": MISSING}]) + defaults: List[Any] = field(default_factory=lambda: ["_self_", {"step": MISSING}]) step: StepConfig = MISSING datasets: dict[str, str] = field(default_factory=dict) @@ -723,8 +720,7 @@ def register_config() -> None: name="gwas_catalog_top_hit_ingestion", node=GWASCatalogTopHitIngestionConfig, ) - cs.store(group="step", name="ld_based_clumping", - node=LDBasedClumpingConfig) + cs.store(group="step", name="ld_based_clumping", node=LDBasedClumpingConfig) cs.store(group="step", name="ld_index", node=LDIndexConfig) cs.store(group="step", name="locus_to_gene", node=LocusToGeneConfig) cs.store( @@ -742,8 +738,7 @@ def register_config() -> None: cs.store(group="step", name="pics", node=PICSConfig) cs.store(group="step", name="gnomad_variants", node=GnomadVariantConfig) - cs.store(group="step", name="ukb_ppp_eur_sumstat_preprocess", - node=UkbPppEurConfig) + cs.store(group="step", name="ukb_ppp_eur_sumstat_preprocess", node=UkbPppEurConfig) cs.store(group="step", name="variant_index", node=VariantIndexConfig) cs.store(group="step", name="variant_to_vcf", node=ConvertToVcfStepConfig) cs.store( @@ -776,7 +771,5 @@ def register_config() -> None: name="locus_to_gene_associations", node=LocusToGeneAssociationsStepConfig, ) - cs.store(group="step", name="finngen_ukb_meta_ingestion", - node=FinngenUkbMetaConfig) - cs.store(group="step", name="credible_set_qc", - node=CredibleSetQCStepConfig) + cs.store(group="step", name="finngen_ukb_meta_ingestion", node=FinngenUkbMetaConfig) + cs.store(group="step", name="credible_set_qc", node=CredibleSetQCStepConfig) diff --git a/src/gentropy/l2g.py b/src/gentropy/l2g.py index faee1e79e..9f75adaf4 100644 --- a/src/gentropy/l2g.py +++ b/src/gentropy/l2g.py @@ -139,7 +139,7 @@ def __init__( variant_index_path (str | None): Path to the variant index gene_interactions_path (str | None): Path to the gene interactions dataset gene_index_path (str | None = None): Path to the gene index - interval_path (dict[str, str] | None) : Path and source of interval input datasets + interval_path (str | None = None) : Path and source of interval input datasets predictions_path (str | None): Path to the L2G predictions output dataset l2g_threshold (float | None): An optional threshold for the L2G score to filter predictions. A threshold of 0.05 is recommended. hf_hub_repo_id (str | None): Hugging Face Hub repository ID. If provided, the model will be uploaded to Hugging Face. @@ -181,8 +181,8 @@ def __init__( if gene_index_path else None ) - self.intervals = Intervals.from_parquet( - session, interval_path, recursiveFileLookup=True + self.intervals = ( + Intervals.from_parquet(session, interval_path) if interval_path else None ) if run_mode == "predict":