Skip to main content

peptidy

Welcome to peptidy — a tiny and tidy python library to vectorize peptide sequences (and proteins) for machine learning applications!

peptidy bridges the gap between peptide sequences and machine learning applications by converting peptide sequences into numerical vectors with a single function call. peptidy is obsessed with the simplicity and tidiness — it is designed to be as accessible as possible for everyone.

Key features of peptidy include:

  • Simple: The programming interface of peptidy is designed to be as simple as possible and well-documented to minimize entry barriers. Converting a peptide sequence into a numerical vector is just a single function call.
  • Tiny: peptidy is written in pure Python (>=3.6) and free from external dependencies. It is designed to be light-weight.
  • Broad: peptidy supports a wide range of encoding schemes for both discriminative and generative applications, e.g., one-hot encoding, BLOSUM62, and physicochemical descriptors. Moreover, peptidy can handle peptides with post-translational modifications.

Installation :hammer_and_wrench:

pip install peptidy

Simple :shrug:

Quick Start :rocket:

The most important module in peptidy is peptidy.encoding. This module provides functions to convert peptide sequences into numerical vectors. Five encoding methods are implemented: aminoacid_descriptor_encoding, blosum62_encoding, label_encoding, one_hot_encoding and peptide_descriptor_encoding. All of those functions take a peptide sequence as input and return a numerical vector or matrix. An extensive documentation is available for all encoding methods :book:

Here are some quick examples to start with:

# Represent a peptide sequence with label encoding
import peptidy
peptide = "ACD"
padded_labels = peptidy.encoding.label_encoding(peptide, padding_len=5)  # [1, 2, 3, 0, 0]

There you go! The peptide "ACD" is converted into a list of labels, padded, and is ready to be fed into a deep learning model.

Post-translational Modifications :sparkles:

peptidy can handle peptides with post-translational modifications, such as phosphorylation, acetylation, and glycosylation. You can find a full list of supported modifications in the documentation.

# Represent a peptide sequence with one-hot encoding and phosphorylation
peptide = "ACS_pD"  # S_p stands for phosphorylated Serine
padded_one_hot = peptidy.encoding.one_hot_encoding(peptide, padding_len=5)  # (5, 29)

Computing Peptide Descriptors :desktop_computer:

Peptides are commonly represented by their physicochemical properties in machine learning models and peptidy provides functions to facilitate those models. In addition to providing peptidy.encoding.peptide_descriptor_encoding function, peptidy also exposes a module, peptidy.descriptors with many peptide descriptors, e.g., charge, hydrophobicity, and instability index. The full list and descriptions of supported descriptors is available on the documentation page.

# Compute molecular weight of a peptide
peptide = "ACS_pD"
descriptors = peptidy.descriptors.molecular_weight(peptide)  # 474.375

Concluding Remarks

This was a quick introduction to capabilities of peptidy. But peptidy can empower much more! We provide classification and generation examples using xgboost, tensorflow, and keras, where peptidy smooths the computations. Feel free to check our documentation for more information and examples and create issues or pull requests on our GitHub repository for added functionalities or bug reports.

See you in the forums! :wave:

Release files for peptidy 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for peptidy 0.0.1
File Size Uploaded
peptidy-0.0.1.tar.gz 22.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for peptidy 0.0.1
File Interpreter ABI Platform
peptidy-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 44.5 kB

Release files / peptidy-0.0.1.tar.gz

Download URL peptidy-0.0.1.tar.gz
Size 22.6 kB
Tags Source
SHA-256 checksum
How to use checksums
18438e5eaeada7bb525ede487e0846d39cbc0ed0b027558d52f1df5e93a0450c
BLAKE2b-256 checksum
How to use checksums
92c1b06598714c7dd44d18cfa0f2f0887b546f3853ee55730ee3db99d6b7bad9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.7.16

Release files / peptidy-0.0.1-py3-none-any.whl

Download URL peptidy-0.0.1-py3-none-any.whl
Size 21.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3dbf82fc2bbd9b78d71c5dc45941333a6a07fc5e68afb7678e4ab5e610dbe90f
BLAKE2b-256 checksum
How to use checksums
7bcfb7c42d1697a1942b317829e8aedb5046c3ab15d4ed941f13b2956ecb1d0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.7.16

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page