Skip to content

Commit

Permalink
Update summary_statistics.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Considine authored Mar 21, 2024
1 parent c17045c commit 7db9e45
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/gentropy/dataset/summary_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,24 +105,4 @@ def exclude_region(self: SummaryStatistics, region: str) -> SummaryStatistics:
_schema=SummaryStatistics.get_schema(),
)

def get_locus_sumstats(
self: SummaryStatistics,
locus: DataFrame,
window: int,
) -> DataFrame:
"""Get summary statistics for a studyLocus.
Args:
locus (DataFrame): studyLocus DataFrame
window (int): Window size

Returns:
DataFrame: Summary statistics for the studyLocus region
"""
chr = locus.select(f.first("chromosome")).collect()[0][0]
pos = locus.select(f.first("position")).collect()[0][0]
return self.df.filter(
(f.col("chromosome") == chr)
& (f.col("position") >= pos - (window / 2))
& (f.col("position") <= pos + (window / 2))
)

0 comments on commit 7db9e45

Please sign in to comment.