A CLI tool (not intended for API use) for performing data-driven protein engineering by building machine learning models from sequence variant-fitness data (e.g., provided as CSV data).
Reason this release was yanked:
Version has strict third-party package dependencies
Project description
This repository contains supplementary information to
Niklas E. Siedhoff1,§, Alexander-Maurice Illig1,§, Ulrich Schwaneberg1,2, Mehdi D. Davari1,*,
PyPEF – An Integrated Framework for Data-Driven Protein Engineering, J. Chem. Inf. Model. 2021, 61, 3463-3476
https://doi.org/10.1021/acs.jcim.1c00099
1Institute of Biotechnology, RWTH Aachen University, Worringer Weg 3, 52074 Aachen, Germany
2DWI-Leibniz Institute for Interactive Materials, Forckenbeckstraße 50, 52074 Aachen, Germany
*Corresponding author
§Equal contribution
PyPEF: Pythonic Protein Engineering Framework
a framework written in Python 3 for performing sequence-based machine learning-assisted protein engineering.
Protein engineering by rational or random approaches generates data that can aid the construction of self-learned sequence-function landscapes to predict beneficial variants by using probabilistic methods that can screen the unexplored sequence space with uncertainty in silico. Such predictive methods can be applied for increasing the success/effectivity of an engineering campaign while partly offering the prospect to reveal (higher-order) epistatic effects. Here we present an engineering framework termed PyPEF for assisting the tuning and validation of models for combination of identified substitutions using machine learning algorithms (partial least squares (PLS), support vector machines (SVR), random forest (RF), and multilayer perceptron (MLP)-based regression) from the scikit-learn package. As training input, the developed software tool requires the sequence and the corresponding screening results (fitness labels) of the identified variants as CSV (or FASTA-like datasets following a self-defined convention). Using PLS, SVR, RF, or MLP regression, PyPEF trains on the given learning data while optimizing model hyperparameters and validates model performances on left-out data. Finally, the selected or best model for validation can be used to perform directed evolution walks in silico (see Church-lab implementation or the reimplementation) or to predict natural diverse or recombinant sequences that subsequently are to be designed and validated in the wet-lab.
For detailed information, please refer to the above-mentioned publication and related Supporting Information.
The workflow procedure is explained in the Jupyter notebook (.ipynb) protocol (see Tutorial section below and the ./workflow directory).
Running example
PyPEF was developed to be run using a command-line interface:
python3 run_pypef.py --help
python3 run_pypef.py mklsvs -w WT_SEQUENCE.FASTA -i VARIANT-FITNESS_DATA.CSV
python3 run_pypef.py run -l LEARNING_SET.FASTA -v VALIDATION_SET.FASTA --regressor TYPE
python3 run_pypef.py --show
python3 run_pypef.py run -m MODEL12345 -f VALIDATION_SET.FASTA
python3 run_pypef.py run -m MODEL12345 -p PREDICTION_SET.FASTA
python3 run_pypef.py mkps -w WT_SEQUENCE.FASTA -i VARIANT-FITNESS_DATA.CSV --drecomb
python3 run_pypef.py run -m MODEL12345 --pmult --drecomb
python3 run_pypef.py directevo -m MODEL12345 --ywt WT_FITNESS -w WT_SEQUENCE.FASTA --usecsv -i VARIANT-FITNESS_DATA.CSV
PyPEF's package dependencies are linked here. A small API for sequence encoding and model validation is provided in the encoding_validation_api directory. Further, for designing your own API based on the PyPEF workflow, modules can be adapted from the source code provided in the pypef source directory. A quick installation of the PyPEF command line framework using PyPI (only for Linux OS) can be performed with:
pip install pypef
After successful installation, PyPEF should work by calling pypef
in the shell, e.g.:
pypef --help
The detailed routine for setting up a new virtual environment using Anaconda, installing required Python packages for that environment, and running the Jupyter Notebook tutorial is given below.
Tutorial
Before starting running the tutorial, it is a good idea to set-up a new Python environment using Anaconda, https://www.anaconda.com/, e.g. using Anaconda (Anaconda3-2020.11-Linux-x86_64.sh installer download) or Miniconda. Change to the download directory and run the installation, e.g. in Linux:
bash Anaconda3-2020.11-Linux-x86_64.sh
After accepting all steps, the conda setup should also be written to your ~/.bashrc
file, so that you can call anaconda typing conda
.
Next, to download this repository click Code > Download ZIP and unzip the zipped file, e.g. with unzip PyPEF-main.zip
, or just clone this repository using your bash shell to your local machine git clone https://github.com/niklases/PyPEF
.
To setup a new environment with conda you can either create the conda environment from the provided YAML file inside the PyPEF directory (cd PyPEF
or cd PyPEF-main
dependent on the downloaded file name):
conda env create --file pypef_environment.yml
or you can create a new environment yourself. You just need to specify the name of the environment and the Python version, e.g.:
conda create --name pypef python=3.7
To activate the environment you can define:
conda activate pypef
After activating the environment you can install required packages after changing the directory to the PyPEF directory (cd PyPEF
or cd PyPEF-main
) and install required packages with pip if you did not use the YAML file for creating the environment (when using conda packages will be installed in anaconda3/envs/pypef/lib/python3.7/site-packages):
python3 -m pip install -r requirements.txt
and optionally:
python3 -m pip install -r requirements_parallelization.txt
Now, after installing required packages, you should be able to directly run pypef in your preferred command-line interface (see running example).
To run the tutorial after installing required packages either from the YAML environment file or the TEXT file(s), you have to open a Jupyter Notebook. If you have installed Anaconda, Jupyter Notebook and other commonly used packages for scientific computing and data science should be already installed in Python. If not, you can also install Jupyter via conda install ipython jupyter
. To use the pypef environment as kernel inside the Jupyter Notebook, you need to install the ipykernel:
conda install -c anaconda ipykernel
python3 -m ipykernel install --user --name=pypef
Now change the directory to ./workflow (cd workflow
) and run the .ipynb file:
jupyter notebook
Copy the notebook URL in your internet browser and select the Workflow_PyPEF.ipynb file to open it. Now you can select the pypef Python environment at the top Notebook menu: Kernel > Change kernel > pypef (otherwise you would use your default Python version as environment, i.e. you would have to install the required packages for this interpreter as well; for this case the installation of the prerequisite packages can also be done within the notebook in provided code fields).
Good luck and have fun!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pypef-0.1.3.tar.gz
.
File metadata
- Download URL: pypef-0.1.3.tar.gz
- Upload date:
- Size: 179.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d013829d53ca006b65e21829d957cb8a2a5e8cce8d0970736e1fd6297a452fe |
|
MD5 | 2087a498cbac01790a2fbbf019e09f4c |
|
BLAKE2b-256 | 999215b94a7905033d5773e0c8de367dcb8c2138c55aa2cfd3513e97385e88d4 |
File details
Details for the file pypef-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: pypef-0.1.3-py3-none-any.whl
- Upload date:
- Size: 412.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7c9f154f363cd46eec87e013373356375ca13b6bde730f490913c07af3c1493 |
|
MD5 | 58cb8b5ed9a4f4ac429170adf3a55ae1 |
|
BLAKE2b-256 | 996173dad280d163ff472250a1fd6ac7b7627e076f32091a86ef9125691185bc |