Skip to main content

Protein solubility prediction toolkit

Project description

SolvNet

Protein Solubility Prediction Toolkit

SolvNet is a Python toolkit for predicting protein solubility from amino acid sequences. It provides easy-to-use functions to generate embeddings and predict solubility with confidence estimates.


Installation

Create environment:

conda create --name solvnet
conda activate solvnet

Install package

pip install SolvNet

Step 0: Prepare Data

Prepare your dataset or load a test dataset from pbdsolv.

from SolvNet import load_pdb
df = load_pdb()

The dataset should be a pandas DataFrame with the following columns:

Column Description
name Protein name
aa_seq Amino acid sequence
label Binary solubility label (0: insoluble, 1: soluble)

Step 1: Generate ESMC Embeddings

Generate ESMC embeddings for the protein sequences:

from SolvNet import esmc_embeddings
data = esmc_embeddings(df_test)

Parameters:

  • df_test: Dataframe from step 0.

Step 2: Predict Solubility

Use the generated embeddings to predict protein solubility:

from SolvNet import Predict

labels, preds, confs, probs = Predict(
    data=data,
    model = "pdb", # model in ["pdb", "plm"]
    percentage=0.85,
    batch_size=64
)

Parameters:

  • data: ESMC embeddings.
  • model: Must be pdb or plm, which indicates the dataset the model was trained on Default is pdb
  • percentage: The top percentage of most confident predictions to return (default 0.85).
  • batch_size: Batch size for prediction (default 64).

Returns:

  • labels: True labels for the top percentage% most confident proteins.
  • preds: Predicted labels for the top percentage%.
  • confs: Confidence scores for predictions.
  • probs: Predicted probabilities.

Example Workflow for Inference

from SolvNet import *

# Step 0: Load pdb dataset:
df = load_pdb()

# Step 1: Generate embeddings
data = esmc_embeddings(df)

# Step 2: Make predictions
labels, preds, confs, probs = Predict(
    data=data,
    percentage=0.85,
    batch_size=64
)

Training

Step 0: Prepare df_train, df_val, and df_test

from SolvNet import *

top_percent = 0.95
noise_rate = 1-top_percent

TRAIN, VAL, TEST = esmc_embeddings(df_train), esmc_embeddings(df_val), esmc_embeddings(df_test)
TRAIN, VAL, TEST = list(TRAIN.values()), list(VAL.values()), list(TEST.values())

best_model, last_model, metrics = train_dividemix(TRAIN, VAL, TEST, batch_size=64, lr=1e-4, epochs=12, warmup_epochs=5, noise_rate=noise_rate, alpha=0.85) # alpha: hyperparameter for mixup augmentation

License

MIT License © 2025 Thao Nguyen et al.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

solvnet-1.0.20.tar.gz (100.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

solvnet-1.0.20-py3-none-any.whl (100.1 MB view details)

Uploaded Python 3

File details

Details for the file solvnet-1.0.20.tar.gz.

File metadata

  • Download URL: solvnet-1.0.20.tar.gz
  • Upload date:
  • Size: 100.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for solvnet-1.0.20.tar.gz
Algorithm Hash digest
SHA256 c6bf08af8d33c7bc7e4cf886722e7cf973fe3993bbb31e6002359e4553e91589
MD5 1d8e35e5e5ae750014420f0981b12448
BLAKE2b-256 b80ddead6f0480d7bae2ca3d91ba3b0d08b7f02c3ad5fc7e11c89559bd97c617

See more details on using hashes here.

File details

Details for the file solvnet-1.0.20-py3-none-any.whl.

File metadata

  • Download URL: solvnet-1.0.20-py3-none-any.whl
  • Upload date:
  • Size: 100.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for solvnet-1.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 2229a6ee6cd006ddd05eee19b0d596bb6b353b9636bde46d2eef3bffd81690a2
MD5 2a795bf45a0d8e11a4c832a49d261769
BLAKE2b-256 9cd69b02c60ba2f47ca6e84956f2857cb184b48cb743b016bc0990e9e648d389

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page