Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pyprophet/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,13 @@ def pemp(stat, stat0):
m = len(stat)
m0 = len(stat0)

statc = np.concatenate((stat, stat0))
v = np.array([True] * m + [False] * m0)
# ------- originally (as in r implementation):
#statc = np.concatenate((stat, stat0))
#v = np.array([True] * m + [False] * m0)
# ------- switching the positions of Targets and decoys to avoid pi0 becoming negative, basically, decoys win ties making p values more conservative
statc = np.concatenate((stat0, stat))
v = np.array( [False] * m0 + [True] * m)

perm = np.argsort(-statc, kind="mergesort") # reversed sort, mergesort is stable
v = v[perm]

Expand Down
Loading