seqprops


Nameseqprops JSON
Version 1.0.3 PyPI version JSON
download
home_pagehttps://github.com/eotovic/seqprops
Summary
upload_time2023-03-10 14:31:02
maintainer
docs_urlNone
authorErik Otović
requires_python
licenseGPL3
keywords sequential properties physicochemical machine learning peptides proteins
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## 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". If you use this package in your work, please cite it as below or use the citation option in the side menu.

*Otović, E., Njirjak, M., Kalafatovic, D., & Mauša, G. (2022). Sequential Properties Representation Scheme for Recurrent Neural Network-Based Prediction of Therapeutic Peptides. Journal of Chemical Information and Modeling, 62(12), 2961-2972.*

You can install this package manually from this repository or from PyPI repository with
````
pip install seqprops
````

### 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 <em>feature_selection</em> and usage example [here](https://github.com/eotovic/seqprops_therapeutic)


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/eotovic/seqprops",
    "name": "seqprops",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "sequential properties physicochemical machine learning peptides proteins",
    "author": "Erik Otovi\u0107",
    "author_email": "erik.otovic@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/48/48/3430d7f8b85804ab61fb37670dfe3775d68731c63ddfce756d8de62b2405/seqprops-1.0.3.tar.gz",
    "platform": null,
    "description": "## Sequential properties - peptide representation scheme\r\nThis package contains implementation of sequential properties representation scheme from the paper \"Sequential properties representation scheme for recurrent neural network based prediction of therapeutic peptides\". If you use this package in your work, please cite it as below or use the citation option in the side menu.\r\n\r\n*Otovic\u0301, E., Njirjak, M., Kalafatovic, D., & Maus\u030ca, G. (2022). Sequential Properties Representation Scheme for Recurrent Neural Network-Based Prediction of Therapeutic Peptides. Journal of Chemical Information and Modeling, 62(12), 2961-2972.*\r\n\r\nYou can install this package manually from this repository or from PyPI repository with\r\n````\r\npip install seqprops\r\n````\r\n\r\n### Usage\r\n````\r\nfrom seqprops import SequentialPropertiesEncoder\r\nencoder = SequentialPropertiesEncoder()\r\nencoder.encode([\"AA\", \"HTTA\"])\r\n````\r\n\r\n### Minimal working example\r\n````\r\nimport numpy as np\r\nfrom sklearn.preprocessing import MinMaxScaler\r\nfrom tensorflow import keras\r\nfrom seqprops import SequentialPropertiesEncoder\r\nfrom tensorflow.keras.models import Model\r\nfrom tensorflow.keras.layers import Dense, Input, LSTM\r\n\r\n# Some input data\r\nsequences = [\"AAC\", \"ACACA\", \"AHHHTK\", \"HH\"]\r\ny = np.array([0, 1, 1, 0])\r\n\r\n# Encode sequences\r\nencoder = SequentialPropertiesEncoder(scaler=MinMaxScaler(feature_range=(-1, 1)))\r\nX = encoder.encode(sequences)\r\n\r\n# Define a model\r\nmodel_input = Input(shape=X.shape[1:], name=\"input_1\")\r\nx = LSTM(32, unroll=True, name=\"bi_lstm\")(model_input)\r\nx = Dense(1, activation='sigmoid', name=\"output_dense\")(x)\r\nmodel = Model(inputs=model_input, outputs=x)\r\n\r\n# Model training\r\nadam_optimizer = keras.optimizers.Adam()\r\nmodel.compile(loss=\"binary_crossentropy\", optimizer=adam_optimizer)\r\nmodel.fit(\r\n    X, y, \r\n)\r\n````\r\n\r\n### Available properties\r\nYou can list available properties with:\r\n````\r\nprint(encoder.get_available_properties())\r\n````\r\n\r\nTo manually select specific properties:\r\n````\r\nencoder.select_properties(['MSWHIM_MSWHIM3', 'tScales_T1'])\r\n````\r\n\r\nFor automatic feature selection, the users are referred to function <em>feature_selection</em> and usage example [here](https://github.com/eotovic/seqprops_therapeutic)\r\n\r\n",
    "bugtrack_url": null,
    "license": "GPL3",
    "summary": "",
    "version": "1.0.3",
    "split_keywords": [
        "sequential",
        "properties",
        "physicochemical",
        "machine",
        "learning",
        "peptides",
        "proteins"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "48483430d7f8b85804ab61fb37670dfe3775d68731c63ddfce756d8de62b2405",
                "md5": "75b50cc08de917310d0392e7055a6310",
                "sha256": "1213ce5c9e47cf06f455ea8b2e9bf0975b840b41ee3b20e42f3a85e8d5751ae2"
            },
            "downloads": -1,
            "filename": "seqprops-1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "75b50cc08de917310d0392e7055a6310",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 11328,
            "upload_time": "2023-03-10T14:31:02",
            "upload_time_iso_8601": "2023-03-10T14:31:02.515463Z",
            "url": "https://files.pythonhosted.org/packages/48/48/3430d7f8b85804ab61fb37670dfe3775d68731c63ddfce756d8de62b2405/seqprops-1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-10 14:31:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "eotovic",
    "github_project": "seqprops",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "seqprops"
}
        
Elapsed time: 0.05444s