Skip to content

Commit

Permalink
Resolved outstanding issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wfondrie committed Jul 16, 2021
1 parent b308c42 commit 764a060
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# Changelog for mokapot

## [Unreleased]
## [0.7.2] - 2021-07-16
### Added
- `--keep_decoys` option to the command line interface. Thanks @jspaezp!
- Notes about setting a random seed to the Python API documentation. (Issue #30)
- Added more information about peptides that couldn't be mapped to proteins. (Issue #29)

### Fixed
- Loading a saved model with `mokapot.load_model()` would fail because of an
update to Pandas that introduced a new exception. We've updated mokapot
accordingly.

### Changed
- Updates to unit tests.
- Updates to unit tests. Warnings are now treated as errors for system tests.

## [0.7.1] - 2021-03-22
### Changed
Expand Down
15 changes: 15 additions & 0 deletions docs/source/api/index.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Python API
==========

Expand All @@ -22,6 +23,20 @@ Alternatively, PSMs that are already represented in a
Finally, custom machine learning models can be created using the
:py:class:`mokapot.model.Model` class.

.. note::

Set your NumPy random seed to ensure reproducibility:

.. code-block::
import numpy as np
np.random.seed(42)
In a future release, we will update mokapot to use the `new NumPy random
sampling API
<https://numpy.org/doc/stable/reference/random/index.html?highlight=random%20sampling%20numpy%20random#module-numpy.random>`_.


.. toctree::
:maxdepth: 1
:hidden:
Expand Down
14 changes: 7 additions & 7 deletions mokapot/picked_protein.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,19 @@ def picked_protein(

if shared_unmatched:
LOGGER.debug("%s", unmatched_prots.loc[~shared, "stripped sequence"])
if shared_unmatched / len(prots) > 0.10:
raise ValueError(
"Fewer than 90% of all peptides could be matched to proteins. "
"Verify that your digest settings are correct."
)

LOGGER.warning(
"%i out of %i peptides could not be mapped. "
"Check your digest settings.",
"Please check your digest settings.",
shared_unmatched,
len(prots),
)

if shared_unmatched / len(prots) > 0.10:
raise ValueError(
"Fewer than 90% of all peptides could be matched to proteins. "
"Please verify that your digest settings are correct."
)

# Verify that reasonable number of decoys were matched.
if proteins.has_decoys:
num_unmatched_decoys = unmatched_prots[target_column][~shared].sum()
Expand Down

0 comments on commit 764a060

Please sign in to comment.