Skip to content

Commit

Permalink
Fixed bug reporting decoys
Browse files Browse the repository at this point in the history
  • Loading branch information
wfondrie committed Oct 28, 2020
1 parent 8ba607f commit 7e9cadf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mokapot/confidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ def _assign_confidence(self, desc=True):
LOGGER.info("\t- Found %i unique protein groups.", len(proteins))

for level, data in zip(levels, level_data):
data = data.sort_values(
self._score_column, ascending=False
).reset_index(drop=True)
scores = data.loc[:, self._score_column].values
targets = data.loc[:, self._target_column].astype(bool).values

Expand All @@ -300,11 +303,8 @@ def _assign_confidence(self, desc=True):
data["mokapot q-value"] = qvalues.tdc(scores, targets, desc=True)

# Make output tables pretty
data = (
data.sort_values(self._score_column, ascending=False)
.reset_index(drop=True)
.drop(self._target_column, axis=1)
.rename(columns={self._score_column: "mokapot score"})
data = data.drop(self._target_column, axis=1).rename(
columns={self._score_column: "mokapot score"}
)

# Set scores to be the correct sign again:
Expand Down

0 comments on commit 7e9cadf

Please sign in to comment.