Skip to content

Commit

Permalink
test: join credsets using variantId instead of overlap
Browse files Browse the repository at this point in the history
  • Loading branch information
xyg123 committed Feb 10, 2025
1 parent 3f66d87 commit a268312
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/gentropy/dataset/l2g_features/intervals.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,15 @@ def common_interval_feature_logic(
intervals_filtered = intervals.df.filter(
f.col("datasourceId") == interval_source
).select(
"chromosome",
f.col("start").cast("integer"),
f.col("end").cast("integer"),
"variantId",
"geneId",
"resourceScore",
)

# Overlapping join:
joined_data = study_loci_exploded.join(
intervals_filtered,
(study_loci_exploded["chromosome"] == intervals_filtered["chromosome"])
& (study_loci_exploded["position"] >= intervals_filtered["start"])
& (study_loci_exploded["position"] <= intervals_filtered["end"]),
on="variantId",
how="inner",
)

Expand Down

0 comments on commit a268312

Please sign in to comment.