Skip to content

Commit

Permalink
Merge pull request #17 from wfondrie/0.6.0rc
Browse files Browse the repository at this point in the history
Final updates for the 0.6.0 release
  • Loading branch information
Will Fondrie authored Mar 3, 2021
2 parents 8fbc621 + baedbf7 commit 005340d
Show file tree
Hide file tree
Showing 16 changed files with 381 additions and 310 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ For more information, check out our
## Citing
If you use mokapot in your work, please cite:

> Fondrie, W. E. & Noble, W. S. mokapot: Fast and flexible semi-supervised
> learning for peptide detection. *bioRxiv* (2020)
> doi:10.1101/2020.12.01.407270.
> Fondrie W. E. & Noble W. S. mokapot: Fast and Flexible Semisupervised
> Learning for Peptide Detection. J Proteome Res (2021) doi:
> 10.1021/acs.jproteome.0c01010. PMID: 33596079.
> [Link](https://doi.org/10.1021/acs.jproteome.0c01010)
## Installation

Expand Down Expand Up @@ -76,6 +77,3 @@ interpreter and affords greater flexibility:

Check out our [documentation](https://mokapot.readthedocs.io) for more details
and examples of mokapot in action.


[![Built with Spacemacs](https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg)](http://spacemacs.org)
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/source/api/dataset.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Datasets
========
Collections of PSMs
===================
.. automodule:: mokapot.dataset
:members:
:inherited-members:
1 change: 1 addition & 0 deletions docs/source/api/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Functions
Primary Functions
-----------------
.. autofunction:: read_pin
.. autofunction:: read_pepxml
.. autofunction:: brew


Expand Down
50 changes: 37 additions & 13 deletions docs/source/api/index.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
Python API
==========

The Python API enables maximum flexibility using mokapot. It also aids in
The Python API enables maximum flexibility when using mokapot. It also aids in
making analyses reproducible by easily integrating into Jupyter notebooks and
Python scripts.

Basic analyses with mokapot can be conducted using only the :ref:`Primary
Functions`. PSMs not saved in the Percolator tab-delimited format can be loaded
from a :py:class:`~pandas.DataFrame` using the :ref:`Dataset` classes. Finally,
custom models can be created using the :ref:`Model` class.
Read PSMs using the :py:func:`~mokapot.read_pin()` or
:py:func:`~mokapot.read_pepxml()` functions for files in the Percolator
tab-delimited format or PepXML format, respectively. Once a collection of PSMs
has been read, the :py:func:`~mokapot.brew()` function will apply the mokapot
algorithm to learn models from the PSMs and assign confidence estimates based on
their new scores. Alternatively, the
:py:meth:`~mokapot.dataset.LinearPsmDataset.assign_confidence()` method will
assign confidence estimates to PSMs based on the best feature, which is often
the primary score from the database search engine.

Using :py:func:`mokapot.brew()` or the
:py:meth:`~mokapot.datasets.LinearPsmDataset.assign_confidence()` method return
objects that contain :ref:`Confidence Estimates`.
Alternatively, PSMs that are already represented in a
:py:class:`pandas.DataFrame` can be directly used to create a
:py:class:`~mokapot.dataset.LinearPsmDataset`.

Finally, custom machine learning models can be created using the
:py:class:`mokapot.model.Model` class.

.. toctree::
:maxdepth: 1
Expand All @@ -35,6 +43,7 @@ Primary Functions
:nosignatures:

read_pin
read_pepxml
brew

Utility Functions
Expand All @@ -50,26 +59,41 @@ Utility Functions
digest


Model
-----
Machine Learning Models
-----------------------

Use a model that emulates the Linear support vector machine used by Percolator
or create a custom model from anything with a Scikit-Learn interface.

.. currentmodule:: mokapot.model
.. autosummary::
:nosignatures:

Model
PercolatorModel
Model


Collections of PSMs
-------------------

PSMs can be parsed from Percolator tab-delimited files, PepXML files, or
directly from a :py:class:`pandas.DataFrame`.

Dataset
-------
.. currentmodule:: mokapot.dataset
.. autosummary::
:nosignatures:

LinearPsmDataset
.. CrossLinkedPsmDataset
Confidence Estimates
--------------------

An analysis with mokapot yields two forms of confidence estimates---q-values and
posterior error probabilities (PEPs)---at various levels: PSMs, peptides, and
optionally, proteins.

.. currentmodule:: mokapot.confidence
.. autosummary::
:nosignatures:
Expand Down
4 changes: 2 additions & 2 deletions docs/source/api/model.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Model
=====
Machine Learning Models
=======================
.. automodule:: mokapot.model

2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
intersphinx_mapping = {
"pandas": ("https://pandas.pydata.org/docs", None),
"sklearn": ("https://scikit-learn.org/stable", None),
"numpy": ("https://docs.scipy.org/doc/numpy", None),
"numpy": ("https://numpy.org/doc/stable", None),
"matplotlib": ("https://matplotlib.org", None),
}

Expand Down
27 changes: 14 additions & 13 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ Citing
If you use mokapot in your work, please cite:

.. epigraph::
Fondrie, W. E. & Noble, W. S. mokapot: Fast and flexible semi-supervised
learning for peptide detection. bioRxiv 2020.12.01.407270 (2020)
doi:10.1101/2020.12.01.407270. `[Link]
<https://www.biorxiv.org/content/10.1101/2020.12.01.407270v2>`_
Fondrie W. E. & Noble W. S. mokapot: Fast and Flexible Semisupervised
Learning for Peptide Detection. J Proteome Res (2021) doi:
10.1021/acs.jproteome.0c01010. PMID: 33596079. `[Link]
<https://doi.org/10.1021/acs.jproteome.0c01010>`_


Introduction
Expand Down Expand Up @@ -86,6 +86,7 @@ mokapot also depends on several Python packages:
- `scikit-learn <https://scikit-learn.org/stable/>`_
- `Numba <http://numba.pydata.org/>`_
- `triqler <https://github.com/statisticalbiotechnology/triqler>`_
- `lxml <https://lxml.de/>`_


We recommend using `conda` to install mokapot. Missing dependencies will also
Expand All @@ -106,19 +107,19 @@ Basic Usage
-----------

Before you can use mokapot, you need PSMs assigned by a search engine available
in the `Percolator tab-delimited file format
in either the `Percolator tab-delimited file format
<https://github.com/percolator/percolator/wiki/Interface#tab-delimited-file-format>`_
(often referred to as the Percolator input, or "PIN", file format). These files can
be generated from various search engines, such as `Comet
<http://comet-ms.sourceforge.net/>`_ or `Tide
(often referred to as the Percolator input, or "PIN", file format) or as a
PepXML file. These files can be generated from various search engines, such as
`Comet <http://comet-ms.sourceforge.net/>`_ or `Tide
<http://crux.ms/commands/tide-search.html>`_ (which is part of the `Crux mass
spectrometry toolkit <http://crux.ms>`_).

If you need an example file to get started with, a selection of PSMs from
Hogrebe et al. [1]_ is available to download from the mokapot
repository, `phospho_rep1.pin
<https://github.com/wfondrie/mokapot/raw/master/tests/data/phoshpo_rep1.pin>`_. This
is the file we'll use in the examples below.
Hogrebe et al. [1]_ is available to download from the mokapot repository,
`phospho_rep1.pin
<https://github.com/wfondrie/mokapot/raw/master/tests/data/phoshpo_rep1.pin>`_.
This is the file we'll use in the examples below.


Run **mokapot** from the command line
Expand Down Expand Up @@ -155,7 +156,7 @@ Then conduct your mokapot analysis:
>>> results.to_txt()
This is great for when your upstream and/or downstream analyses are also
conducted in Python. Additionally, a great deal more flexibility is available
conducted in Python. Additionally, a good deal more flexibility is available
when using mokapot from the Python interpreter. For more details, see the
:doc:`Python API <api/index>`.

Expand Down
30 changes: 16 additions & 14 deletions docs/source/vignettes/basic_python_api.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 005340d

Please sign in to comment.