Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/api #108

Merged
merged 46 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
0240521
Added preprocessing, plotting submodules
victorgiurcoiu Jul 28, 2023
0c57a60
Fixed pre-commit
victorgiurcoiu Jul 28, 2023
e7cefa7
Added predict, preprocessing submodules
victorgiurcoiu Jul 29, 2023
e87a64b
Added rescore submodule
victorgiurcoiu Jul 31, 2023
52dd237
Modified runner to work with the new api
victorgiurcoiu Aug 16, 2023
cf561c4
Merge branch 'development' into feature/api
picciama Aug 25, 2023
309a428
correct line numbers and lists
picciama Aug 26, 2023
24cd7cd
2 levels of toc and hidden on page
picciama Aug 26, 2023
89c308e
removed files that are no longer required
picciama Aug 26, 2023
1dfeebb
rename submodules to use aliases
picciama Aug 26, 2023
01a8f35
added news and citations for publication
picciama Sep 12, 2023
1ff03bd
fix style of autosummary tables
picciama Sep 12, 2023
8298425
added all major important functions in sections
picciama Sep 13, 2023
674fe88
cleanup and added RST304 ignore to silence :doc:
picciama Sep 13, 2023
2eecae2
added exports for Spectra and FragmentType
picciama Sep 13, 2023
3ecd5f6
fixed variables
picciama Sep 13, 2023
4cba8be
move plotting to pl submodule and updated API docs
picciama Sep 13, 2023
703ebbd
moved logic to new api and updated runners
picciama Sep 13, 2023
f0af9cd
fixed nox tests
picciama Sep 13, 2023
a3de371
removed old API
picciama Sep 13, 2023
8dee1ea
added tmt tag model check and fixed default tag
picciama Sep 15, 2023
fcc9a8b
added missing space
picciama Sep 15, 2023
2313f3c
updated docs for new percolator version
picciama Sep 19, 2023
efdc5dc
changed fragment type to str type
picciama Sep 19, 2023
0bddf71
follow proforma standard
picciama Sep 19, 2023
0c7eabd
return correct default paths for thermo_exe
picciama Sep 19, 2023
8793802
exploit expmass for tdc within files
picciama Sep 19, 2023
c7d41a9
filter out phospho as it is not supported
picciama Sep 22, 2023
759806c
properly use classmethod to read from file
picciama Sep 22, 2023
bd3b061
bugfixes after runing tutorial notebook
picciama Sep 22, 2023
00ee30a
cleanup library generation and support dlib
picciama Sep 22, 2023
64c7ec8
updated spectrum io and fundamentals deps
picciama Sep 22, 2023
74761de
updated dependencies
picciama Sep 23, 2023
0467c63
restrict tritonclient to avoid cuda-python dep
picciama Sep 23, 2023
1b4e47c
support reading from csv
picciama Oct 2, 2023
a2241a7
added unit test for tmt prosit predictions
picciama Oct 2, 2023
baa5c5a
cleanup
picciama Oct 2, 2023
b53013b
cleanup and added unit test for processing step
picciama Oct 2, 2023
a78fb34
corrected koina URL
picciama Oct 2, 2023
fd66b66
migrate to new format required for readthedocs.io
picciama Oct 3, 2023
464ec54
better instructions for prerequisites
picciama Oct 3, 2023
edba9b9
make autosummary link to actual source
picciama Oct 3, 2023
9bba077
fix missing ssl for public koina server
picciama Oct 3, 2023
d445834
corrected port of publikc koina server
picciama Oct 3, 2023
e677999
Bump version from 0.4.0 to 0.5.0
picciama Oct 3, 2023
167c943
fix typeguard using correct typhint
picciama Oct 3, 2023
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
2 changes: 1 addition & 1 deletion .cookietemple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ full_name: Victor Giurcoiu
email: [email protected]
project_name: oktoberfest
project_short_description: Public repo oktoberfest
version: 0.4.0
version: 0.5.0
license: MIT
4 changes: 2 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[flake8]
select = B,B9,C,D,DAR,E,F,N,RST,S,W
ignore = E203,E501,RST201,RST203,RST301,W503,D100,D212,S404,S602,B905
ignore = E203,E501,RST201,RST203,RST301,RST304,W503,D100,D212,S404,S602,B905
max-line-length = 120
max-complexity = 10
docstring-convention = google
per-file-ignores =
tests/*:S101
oktoberfest/__init__.py:F401
**/__init__.py:F401,F403
docs/conf.py:S404,S607,S603
docstring_style = sphinx
4 changes: 2 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name-template: "0.4.0 🌈" # <<COOKIETEMPLE_FORCE_BUMP>>
tag-template: 0.4.0 # <<COOKIETEMPLE_FORCE_BUMP>>
name-template: "0.5.0 🌈" # <<COOKIETEMPLE_FORCE_BUMP>>
tag-template: 0.5.0 # <<COOKIETEMPLE_FORCE_BUMP>>
exclude-labels:
- "skip-changelog"

Expand Down
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ coverage.xml
.hypothesis/
.pytest_cache/

# ignore unit test data folder
tests/unit_tests/data/mokapot/**
!tests/unit_tests/data/mokapot/*.tab
!tests/unit_tests/data/predictions/


# Translations
*.mo
*.pot
Expand All @@ -71,6 +77,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/api/

# PyBuilder
target/
Expand Down Expand Up @@ -139,3 +146,8 @@ dmypy.json

# Used by ProteomicsDB runs to describe the oktoberfest version
hash.file


# output files in tutorials folder
tutorials/
!tutorials/Oktoberfest Tutorial.ipynb
13 changes: 7 additions & 6 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@

version: 2

# Build documentation in the docs/ directory with Sphinx
# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.10"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.8
install:
- requirements: docs/requirements.txt
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ ADD poetry.lock /root/poetry.lock
RUN poetry install --no-root

# install percolator
RUN ZIP=ubuntu.tar.gz && \
wget https://github.com/percolator/percolator/releases/download/rel-3-05/$ZIP -O /tmp/$ZIP && \
tar xvzf /tmp/$ZIP && \
chmod -R 755 /tmp/* && \
dpkg -i percolator-v3-05-linux-amd64.deb && \
rm /tmp/$ZIP
RUN DEB=percolator-v3-06-linux-amd64.deb && \
wget https://github.com/percolator/percolator/releases/download/rel-3-06-01/$DEB -O /tmp/$DEB && \
dpkg -i /tmp/$DEB && \
rm /tmp/$DEB

# install ThermoRawFileParser
RUN ZIP=ThermoRawFileParser1.4.2.zip && \
Expand Down
19 changes: 11 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Oktoberfest: Rescoring and Spectral Library Generation for Proteomics
=====================================================================

|PyPI| |Python Version| |License| |Read the Docs| |Build| |Tests| |Codecov| |pre-commit| |Black|

.. |PyPI| image:: https://img.shields.io/pypi/v/oktoberfest.svg
Expand Down Expand Up @@ -28,9 +31,6 @@
:target: https://github.com/psf/black
:alt: Black

Oktoberfest: Rescoring and Spectral Library Generation for Proteomics
=====================================================================

Oktoberfest is a python tool for rescoring search results and generating spectral libraries for proteomics research within the Prosit ecosystem. It offers an end to end pipeline that takes search results, predicts peptide properties using koina, plots summaries and quality control figures and performs FDR estimation with either mokapot or percolator.

Installation
Expand All @@ -41,11 +41,14 @@ Prerequisites

Oktoberfest requires python >=3.8,<=3.11. Best practise is to use a clean conda environment (`Miniconda <https://docs.conda.io/en/latest/miniconda.html>`_).

If you provide thermo raw files, make sure `ThermoRawFileParser <https://github.com/compomics/ThermoRawFileParser>`_ is installed.
If you provide RAW files, you need ThermoRawFileParser for conversion to mzML.
Please download the latest release from the `github repository <https://github.com/compomics/ThermoRawFileParser>`_ using the provided zip file and unpack it in the desired location.
On linux and MacOS, the default location is "/opt/compomics/". On Windows, the default location is the directory from which Oktoberfest is executed.
You can provide the location of the executable in the config file when starting an Oktoberfest run.

If you are on linux or MacOS, make sure `mono <https://www.mono-project.com/>`_ is installed.
To make ThermoRawFileParser work on linux or MacOS, make sure mono `mono <https://www.mono-project.com/>`_ is installed.

If you want to use percolator, make sure you install version 3.05 (`percolator <https://github.com/percolator/percolator/releases/tag/rel-3-05>`_).
If you want to use percolator for rescoring, make sure you install version 3.06.1 (`percolator <https://github.com/percolator/percolator/releases/tag/rel-3-06-01>`_).

Using pip (recommended)
~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -58,8 +61,8 @@ Docker image
~~~~~~~~~~~~

Prerequisites:
- `make <https://www.gnu.org/software/make/>`_
- `docker <https://www.docker.com/>`_
- `make <https://www.gnu.org/software/make/>`_
- `docker <https://www.docker.com/>`_

After cloning the repository of oktoberfest, checkout the branch you want to build the container from.
The latest stable version is always on the main branch.
Expand Down
9 changes: 6 additions & 3 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@

Oktoberfest requires python >=3.8,<=3.11. Best practise is to use a clean conda environment (https://docs.conda.io/en/latest/miniconda.html).

If you provide thermo raw files, make sure ThermoRawFileParser(https://github.com/compomics/ThermoRawFileParser) is installed.
If you provide RAW files, you need ThermoRawFileParser for conversion to mzML.
Please download the latest release from the github repository (https://github.com/compomics/ThermoRawFileParser) using the provided zip file and unpack it in the desired location.
On linux and MacOS, the default location is "/opt/compomics/". On Windows, the default location is the directory from which Oktoberfest is executed.
You can provide the location of the executable in the config file when starting an Oktoberfest run.

If you are on linux or MacOS, make sure mono (https://www.mono-project.com/) is installed.
To make ThermoRawFileParser work on linux or MacOS, make sure mono (https://www.mono-project.com/) is installed.

If you want to use percolator, make sure you install version 3.05 (https://github.com/percolator/percolator/releases/tag/rel-3-05)
If you want to use percolator for rescoring, make sure you install version 3.06.1 (https://github.com/percolator/percolator/releases/tag/rel-3-06-01).

### Using pip (recommended)

Expand Down
2 changes: 1 addition & 1 deletion cookietemple.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.4.0
current_version = 0.5.0

[bumpversion_files_whitelisted]
init_file = oktoberfest/__init__.py
Expand Down
122 changes: 115 additions & 7 deletions docs/API.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,117 @@
API (under development)
=======================
.. module:: oktoberfest

.. toctree::
:maxdepth: 4
.. automodule:: oktoberfest
:noindex:

oktoberfest
oktoberfest.data
oktoberfest.utils
API
===

Import Oktoberfest using

.. code-block:: python

import oktoberfest as ok

Preprocessing: :code:`pp`
-------------------------

.. module:: oktoberfest.pp

.. currentmodule:: oktoberfest

Generating libraries

.. autosummary::
:toctree: api/pp

pp.digest
pp.gen_lib
pp.merge_spectra_and_peptides

Spectra preprocessing

.. autosummary::
:toctree: api/pp

pp.list_spectra
pp.convert_spectra
pp.load_spectra


Peptide preprocessing

.. autosummary::
:toctree: api/pp

pp.convert_search
pp.load_search
pp.filter_peptides


Predicting: :code:`pr`
----------------------

.. module:: oktoberfest.pr

.. currentmodule:: oktoberfest

All things predictions

Koina interface
~~~~~~~~~~~~~~~

.. autosummary::
:toctree: api/pr

pr.grpc_predict
pr.infer_predictions

Postprocessing koina response
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autosummary::
:toctree: api/pr


pr.parse_fragment_labels


Rescoring: :code:`re`
---------------------

.. module:: oktoberfest.re

.. currentmodule:: oktoberfest

General
~~~~~~~

.. autosummary::
:toctree: api/re

re.generate_features
re.merge_input
re.rescore_with_mokapot
re.rescore_with_percolator


Plotting: :code:`pl`
---------------------

.. module:: oktoberfest.pl

.. currentmodule:: oktoberfest

General
~~~~~~~

.. autosummary::
:toctree: api/pl

pl.plot_score_distribution
pl.joint_plot
pl.plot_gain_loss
pl.plot_mean_sa_ce
pl.plot_violin_sa_ce
pl.plot_pred_rt_vs_irt
pl.plot_all
17 changes: 15 additions & 2 deletions docs/_static/custom_cookietemple.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,32 @@ table.align-default {
}

.fixed-table th:first-child,
.fixed-table td:first-child {
.fixed-table td:first-child,
.autosummary th:first-child,
.autosummary td:first-child {
min-width: 250px;
}

.autosummary th:first-child,
.autosummary td:first-child {
min-width: 400px;
}

.fixed-table th:last-child,
.fixed-table td:last-child {
.fixed-table td:last-child,
.autosummary th:last-child,
.autosummary td:last-child {
width: 100%;
}

.fixed-table {
margin-left: 0;
}

.autosummary {
margin-left: 0 !important;
}

.main-config-table tbody tr:nth-child(n + 4):nth-child(-n + 5) td:nth-child(1) {
padding-left: 50px;
}
Expand Down
5 changes: 5 additions & 0 deletions docs/_templates/autosummary/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:github_url: {{ fullname | modurl }}

{% extends "!autosummary/base.rst" %}

.. http://www.sphinx-doc.org/en/stable/ext/autosummary.html#customizing-templates
1 change: 0 additions & 1 deletion docs/code_of_conduct.rst

This file was deleted.

Loading
Loading