Skip to content

Commit

Permalink
fix(l2g): remove custom session params + other fixes (#841)
Browse files Browse the repository at this point in the history
* chore: delete l2g custom spark session

* fix: add neighbourhood features in `LocusToGeneFeatureMatrixConfig`

* fix(feature_matrix): use right config for default values
  • Loading branch information
ireneisdoomed authored Oct 14, 2024
1 parent d461e38 commit 6817aad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
21 changes: 9 additions & 12 deletions src/gentropy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,7 @@ class LDBasedClumpingConfig(StepConfig):
class LocusToGeneConfig(StepConfig):
"""Locus to gene step configuration."""

session: Any = field(
default_factory=lambda: {
"extended_spark_conf": {
"spark.dynamicAllocation.enabled": "false",
"spark.driver.memory": "48g",
"spark.executor.memory": "48g",
"spark.sql.shuffle.partitions": "800",
}
}
)
session: Any = field(default_factory=lambda: {"extended_spark_conf": None})
run_mode: str = MISSING
predictions_path: str = MISSING
credible_set_path: str = MISSING
Expand Down Expand Up @@ -313,12 +304,18 @@ class LocusToGeneFeatureMatrixConfig(StepConfig):
"eQtlColocClppMaximum",
"pQtlColocClppMaximum",
"sQtlColocClppMaximum",
"tuQtlColocClppMaximum",
# max H4 for each (study, locus, gene) aggregating over a specific qtl type
"eQtlColocH4Maximum",
"pQtlColocH4Maximum",
"sQtlColocH4Maximum",
"tuQtlColocH4Maximum",
# max CLPP for each (study, locus, gene) aggregating over a specific qtl type and in relation with the mean in the vicinity
"eQtlColocClppMaximumNeighbourhood",
"pQtlColocClppMaximumNeighbourhood",
"sQtlColocClppMaximumNeighbourhood",
# max H4 for each (study, locus, gene) aggregating over a specific qtl type and in relation with the mean in the vicinity
"eQtlColocH4MaximumNeighbourhood",
"pQtlColocH4MaximumNeighbourhood",
"sQtlColocH4MaximumNeighbourhood",
# distance to gene footprint
"distanceSentinelFootprint",
"distanceSentinelFootprintNeighbourhood",
Expand Down
4 changes: 2 additions & 2 deletions src/gentropy/l2g.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from gentropy.common.session import Session
from gentropy.common.utils import access_gcp_secret
from gentropy.config import LocusToGeneConfig
from gentropy.config import LocusToGeneConfig, LocusToGeneFeatureMatrixConfig
from gentropy.dataset.colocalisation import Colocalisation
from gentropy.dataset.gene_index import GeneIndex
from gentropy.dataset.l2g_feature_matrix import L2GFeatureMatrix
Expand All @@ -31,7 +31,7 @@ def __init__(
self,
session: Session,
*,
features_list: list[str] = LocusToGeneConfig().features_list,
features_list: list[str] = LocusToGeneFeatureMatrixConfig().features_list,
credible_set_path: str,
variant_index_path: str | None = None,
colocalisation_path: str | None = None,
Expand Down

0 comments on commit 6817aad

Please sign in to comment.