Skip to content

Commit

Permalink
Merge pull request #205 from wilhelm-lab/release/0.6.2
Browse files Browse the repository at this point in the history
Release/0.6.2
  • Loading branch information
picciama authored Mar 25, 2024
2 parents 6623d11 + d38bbf1 commit d9c4a09
Show file tree
Hide file tree
Showing 15 changed files with 1,640 additions and 875 deletions.
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: victor.giurcoiu@tum.de
project_name: oktoberfest
project_short_description: Public repo oktoberfest
version: 0.6.1
version: 0.6.2
license: MIT
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.6.1 🌈" # <<COOKIETEMPLE_FORCE_BUMP>>
tag-template: 0.6.1 # <<COOKIETEMPLE_FORCE_BUMP>>
name-template: "0.6.2 🌈" # <<COOKIETEMPLE_FORCE_BUMP>>
tag-template: 0.6.2 # <<COOKIETEMPLE_FORCE_BUMP>>
exclude-labels:
- "skip-changelog"

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.6.1
current_version = 0.6.2

[bumpversion_files_whitelisted]
init_file = oktoberfest/__init__.py
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
# the built documents.
#
# The short X.Y version.
version = "0.6.1"
version = "0.6.2"
# The full version, including alpha/beta/rc tags.
release = "0.6.1"
release = "0.6.2"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
79 changes: 64 additions & 15 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,26 @@
Installation
============

Prerequisites
~~~~~~~~~~~~~
Oktoberfest can be installed on all three major platforms (Linux, MacOS, Windows).

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>`_).
An installer script is provided for Linux (installers for MacOS and Windows are currently prepared), which takes care of all dependencies. For MacOS and Windows, the Docker container or manual installation can be used.

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.
Installer script (Debian / Ubuntu only)
---------------------------------------

To make ThermoRawFileParser work on linux or MacOS, make sure mono `mono <https://www.mono-project.com/>`_ is installed.
The installer script automatically installs dependencies and creates a new conda environment for oktoberfest. The installation takes roughly 5 minutes and follows the steps outlined in the manual installation below. Get the installer and execute the script using

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>`_).
.. code-block:: bash
Using pip (recommended)
~~~~~~~~~~~~~~~~~~~~~~~
wget https://raw.githubusercontent.com/wilhelm-lab/oktoberfest/main/installer.sh -O install_oktoberfest.sh
bash install_oktoberfest.sh
.. code-block:: bash
The installer searches for existing anaconda / miniconda installation. If none was found, it will download and install miniconda.

pip install oktoberfest
Docker Image
------------

Docker image
~~~~~~~~~~~~
This is only recommended for experienced users and can take up to 30 minutes to install, depending on experience.

Prerequisites:
- `make <https://www.gnu.org/software/make/>`_
Expand All @@ -38,3 +35,55 @@ The latest stable version is always on the main branch. Then build the container
make build
Manual installation
-------------------

This is a step-by-step guide for the manual installation of all mandatory and optional dependencies which should roughly take up to 20 minutes if all dependencies are installed.

Install Python
~~~~~~~~~~~~~~

Oktoberfest requires python >=3.8 and <=3.11. Best practise is to use a clean conda environment (`Miniconda <https://docs.conda.io/en/latest/miniconda.html>`_).
Follow the installation guide for your operating system, then create a new environment using

.. code-block:: bash
conda create -y -n oktoberfest python==3.10
Optional dependencies
~~~~~~~~~~~~~~~~~~~~~

There are three dependencies that are required for specific tasks:


`ThermoRawFileParser v1.4.3 <https://github.com/compomics/ThermoRawFileParser/releases/tag/v1.4.3>`_:
For conversion of RAW to mzML format. Download and unpack the zip or tar.gz file. The default locations Oktoberfest expects the executable to be at "/opt/compomics/" (Linux/MacOS) or the folder from which you want to execute Oktoberfest (Windows).
You do not need this package if you only ever provide mzML file. However, it is recommended let Oktoberfest convert RAW files for you, to ensure the mzML files are formatted in the way Oktoberfest expects it.
For ThermoRawFileParser to work on Linux, you also need to ensure mono is installed using

.. code-block:: bash
sudo apt -y update && sudo apt -y install mono-devel # Debian / Ubuntu
For MacOS, follow the instructions provided by `Mono <https://www.mono-project.com/docs/getting-started/install/mac/>`_.


`Percolator v3.06.1 <https://github.com/percolator/percolator/releases/tag/rel-3-06-01>`_:
This is the tool Mokapot is based on. As it has more options and is generally more stable wrt. to FDR cutoffs and deduplication, it is recommended to use this tool instead of Mokapot.
Installable packages are provided for Linux/MacOS/Windows.


Installing Oktoberfest
~~~~~~~~~~~~~~~~~~~~~~

Oktoberfest is listed on the Python Package Index (PyPI) and can be installed with pip. Activate your conda environment (or skip this if you use a system wide python installation) and install the package (and optionally jupyterlab) using

.. code-block:: bash
conda activate oktoberfest
pip install oktoberfest jupyterlab
107 changes: 107 additions & 0 deletions installer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#!/bin/bash

# === install mono, ThermoRawFileParser and percolator as root === #

sudo apt -y update && sudo apt -y install mono-devel unzip

wget https://github.com/percolator/percolator/releases/download/rel-3-06-01/percolator-v3-06-linux-amd64.deb -O /tmp/percolator.deb
sudo dpkg -i /tmp/percolator.deb
rm /tmp/percolator.deb

ZIP=ThermoRawFileParser1.4.2.zip
wget https://github.com/compomics/ThermoRawFileParser/releases/download/v1.4.2/$ZIP -O /tmp/$ZIP
sudo mkdir -p /opt/compomics
yes | sudo unzip /tmp/$ZIP -d /opt/compomics
rm /tmp/$ZIP

# ============== user level conda setup installation ============= #

INSTALLED_MINICONDA=0
# Check if Anaconda is installed
if command -v conda &> /dev/null; then
CONDA_INSTALL_DIR=$(conda info --base)
else
CONDA_INSTALL_DIR="$HOME/miniconda3/"
echo "Miniconda not found. Installing Miniconda..."
wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh
bash /tmp/miniconda.sh -b -p "$CONDA_INSTALL_DIR"
rm /tmp/miniconda.sh
conda init
INSTALLED_MINICONDA=1
fi
# Add Miniconda/Anaconda binary directory to PATH if not already present
if [[ ":$PATH:" != *":$CONDA_INSTALL_DIR/bin:"* ]]; then
export PATH="$CONDA_INSTALL_DIR/bin:$PATH"
fi

# Configure conda in script
. "$CONDA_INSTALL_DIR/etc/profile.d/conda.sh"
# Activate base environment

conda activate base

# Check if the desired environment exists, create if not
if ! conda env list | grep -q "oktoberfest"; then
echo "Creating conda environment..."
conda create -y -n oktoberfest python==3.10
else
echo "Conda environment already exists. Skipping creation..."
fi

conda activate oktoberfest

# Check if pip installation succeeded
if [ $? -ne 0 ]; then
echo "Activating the envionment failed."
exit 1
fi

pip install oktoberfest jupyterlab

# Check if pip installation succeeded
if [ $? -ne 0 ]; then
echo "Pip installation failed."
exit 1
fi
# =========================== summary ============================ #

perc_version=`percolator --help 2>&1 | head -n 1`
if [ $? -ne 0 ]; then
echo "Percolator installation failed. Check logs."
exit 1
fi

mono_version=`mono --version | head -n 1`
if [ $? -ne 0 ]; then
echo "Mono installation failed. Check logs."
exit 1
fi

thermo_version=`mono /opt/compomics/ThermoRawFileParser.exe --version`
if [ $? -ne 0 ]; then
echo "ThermoRawFileParser installation failed. Check logs."
exit 1
fi

oktoberfest_version=`pip show oktoberfest | grep Version`
if [ $? -ne 0 ]; then
echo "Oktoberfest installation failed. Check logs."
exit 1
fi

echo -e "\n"
echo "percolator version: $perc_version"
echo "mono version: $mono_version"
echo "ThermoRawFileParser version: $thermo_version"
echo "Oktoberfest version: $oktoberfest_version"

echo -e "\nInstallation complete."
if [ $INSTALLED_MINICONDA -eq 1 ]; then
echo "Miniconda was installed. You need to restart your shell once before you can use oktoberfest."
fi
echo -e "\nTo use oktoberfest, perform the following steps:"
echo -e "\t 1. activate your environment, using \"conda activate oktoberfest\""
echo -e "\t 2. start jupyterlab using \"jupyter lab\" or run oktoberfest directly. Type \"python -m oktoberfest\" to get info."


exit 0
2 changes: 1 addition & 1 deletion oktoberfest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
__author__ = """The Oktoberfest development team (Wilhelmlab at Technical University of Munich)"""
__copyright__ = f"Copyright {datetime.now():%Y}, Wilhelmlab at Technical University of Munich"
__license__ = "MIT"
__version__ = "0.6.1"
__version__ = "0.6.2"

import logging.handlers
import sys
Expand Down
6 changes: 0 additions & 6 deletions oktoberfest/rescore/rescore.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,6 @@ def rescore_with_mokapot(

np.random.seed(123)

df = pd.read_csv(input_file, sep="\t", index=False)

# TODO remove this if not necessary
df = df.rename(columns={"Protein": "Proteins"})
df.to_csv(input_file, sep="\t")

psms = mokapot.read_pin(input_file)
logger.info(f"Number of PSMs used for training: {len(psms)}")

Expand Down
Loading

0 comments on commit d9c4a09

Please sign in to comment.