Skip to content

Commit

Permalink
fix undeclared var
Browse files Browse the repository at this point in the history
  • Loading branch information
michabirklbauer committed Jan 24, 2024
1 parent 15a6b9a commit 3972e36
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions msannika_fdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ def get_cutoff(data: pd.DataFrame, fdr: float) -> float:
labels = data["Class_label"].to_numpy()
labels_sorted = labels[data["Combined Score"].to_numpy().argsort()]

for i, score in enumerate(sorted(data["Combined Score"].tolist())):
scores = sorted(data["Combined Score"].tolist())
for i, score in enumerate(scores):
if labels_sorted[i:].sum() / (labels_sorted[i:].shape[0] - labels_sorted[i:].sum()) < fdr:
return score

Expand Down Expand Up @@ -181,7 +182,8 @@ def get_cutoff(data: pd.DataFrame, fdr: float) -> float:
labels = data["Class_label"].to_numpy()
labels_sorted = labels[data["Best CSM Score"].to_numpy().argsort()]

for i, score in enumerate(sorted(data["Best CSM Score"].tolist())):
scores = sorted(data["Best CSM Score"].tolist())
for i, score in enumerate(scores):
if labels_sorted[i:].sum() / (labels_sorted[i:].shape[0] - labels_sorted[i:].sum()) < fdr:
return score

Expand Down

0 comments on commit 3972e36

Please sign in to comment.