Skip to content

Commit 1e7493f

Browse files
committed
Remove unused get_wilcoxon_test_pvalues and ray wrapped version.
Remove unused `get_wilcoxon_test_pvalues` and ray wrapped version.
1 parent 064d28d commit 1e7493f

File tree

1 file changed

+0
-65
lines changed

1 file changed

+0
-65
lines changed

src/pycisTopic/diff_features.py

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@
1212
import numpy.typing as npt
1313
import pandas as pd
1414
import polars as pl
15-
import ray
16-
import scipy
1715
import scipy.sparse as sparse
18-
import sklearn
19-
from scipy.stats import ranksums
2016

2117
if TYPE_CHECKING:
2218
from pycisTopic.cistopic_class import CistopicObject
@@ -1487,67 +1483,6 @@ def find_diff_accessible_regions(
14871483
return markers_dict
14881484

14891485

1490-
def get_wilcoxon_test_pvalues(fg_mat, bg_mat):
1491-
"""
1492-
Calculate wilcoxon test p-values between foreground and background matrix.
1493-
1494-
Parameters
1495-
----------
1496-
fg_mat
1497-
2D-numpy foreground matrix.
1498-
bg_mat
1499-
2D-numpy background matrix.
1500-
1501-
"""
1502-
if fg_mat.shape[0] != bg_mat.shape[0]:
1503-
raise ValueError(
1504-
"Foreground matrix and background matrix have a different first dimension:"
1505-
f" {fg_mat.shape[0]} vs {bg_mat.shape[0]}"
1506-
)
1507-
1508-
wilcoxon_test_pvalues = [
1509-
wilcoxon_test.pvalue
1510-
for wilcoxon_test in [
1511-
ranksums(fg_mat[i], y=bg_mat[i]) for i in range(fg_mat.shape[0])
1512-
]
1513-
]
1514-
1515-
return wilcoxon_test_pvalues
1516-
1517-
1518-
@ray.remote
1519-
def get_wilcoxon_test_pvalues_ray(fg_mat, bg_mat, start, end):
1520-
"""
1521-
Calculate wilcoxon test p-values with ray between a subset of foreground and background matrix.
1522-
1523-
Parameters
1524-
----------
1525-
fg_mat
1526-
2D-numpy foreground matrix.
1527-
bg_mat
1528-
2D-numpy background matrix.
1529-
start
1530-
Starting row index (included).
1531-
end
1532-
Ending row index (excluded).
1533-
1534-
"""
1535-
if fg_mat.shape[0] != bg_mat.shape[0]:
1536-
raise ValueError(
1537-
"Foreground matrix and background matrix have a different first dimension:"
1538-
f" {fg_mat.shape[0]} vs {bg_mat.shape[0]}"
1539-
)
1540-
1541-
wilcoxon_test_pvalues_part = [
1542-
wilcoxon_test.pvalue
1543-
for wilcoxon_test in [
1544-
ranksums(fg_mat[i], y=bg_mat[i]) for i in range(start, end)
1545-
]
1546-
]
1547-
1548-
return wilcoxon_test_pvalues_part
1549-
1550-
15511486
# TODO: Add these generic functions to another package
15521487
def p_adjust_bh(p: npt.NDArray):
15531488
"""Benjamini-Hochberg p-value correction for multiple hypothesis testing."""

0 commit comments

Comments
 (0)