Skip to main content

No project description provided

Project description

Sequential properties - peptide representation scheme

This package contains implementation of sequential properties representation scheme from the paper "Sequential properties representation scheme for recurrent neural network based prediction of therapeutic peptides".

Usage

from seqprops import SequentialPropertiesEncoder
encoder = SequentialPropertiesEncoder()
encoder.encode(["AA", "HTTA"])

Minimal working example

import numpy as np
from sklearn.preprocessing import MinMaxScaler
from tensorflow import keras
from seqprops import SequentialPropertiesEncoder
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Dense, Input, LSTM

# Some input data
sequences = ["AAC", "ACACA", "AHHHTK", "HH"]
y = np.array([0, 1, 1, 0])

# Encode sequences
encoder = SequentialPropertiesEncoder(scaler=MinMaxScaler(feature_range=(-1, 1)))
X = encoder.encode(sequences)

# Define a model
model_input = Input(shape=X.shape[1:], name="input_1")
x = LSTM(32, unroll=True, name="bi_lstm")(model_input)
x = Dense(1, activation='sigmoid', name="output_dense")(x)
model = Model(inputs=model_input, outputs=x)

# Model training
adam_optimizer = keras.optimizers.Adam()
model.compile(loss="binary_crossentropy", optimizer=adam_optimizer)
model.fit(
    X, y, 
)

Available properties

You can list available properties with:

print(encoder.get_available_properties())

To manually select specific properties:

encoder.select_properties(['MSWHIM_MSWHIM3', 'tScales_T1'])

For automatic feature selection, the users are referred to function feature_selection and usage example here

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

seqprops-1.0.1.tar.gz (22.3 kB view details)

Uploaded Source

File details

Details for the file seqprops-1.0.1.tar.gz.

File metadata

  • Download URL: seqprops-1.0.1.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.1

File hashes

Hashes for seqprops-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8752e8dfe5c4c0e3fa607156c85bfdfd2dc8b0d9962b53fc35baad5000d68d9a
MD5 8b36084d18a16e8c6dcafcb63c5d52a2
BLAKE2b-256 43efcd49fef9fdbf8b612d9fd6f4bb1e0a71261893fe29c72dacf13386a2dc07

See more details on using hashes here.

Supported by

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