Skip to main content

RP3Net: Modelling of recombinant soluble protein production in E. coli

Project description

RP3Net

RP3Net is an AI model for predicting the results of recombinant small-scale protein production in E. coli from the construct sequence. See the preprint and supplements for more details on how it works.

Checkpoints

Inference

Installation

pip install RP3Net

Command line

Simple usage:

rp3 -p <path_to_checkpoint_file> -f <in_fasta_file> -o <out_csv_file>

The out_csv_file will contain the dataframe with the ids from the in_fasta_file and the predicted probabilities of successfull recombinant small-scale protein production in E. coli. For more information on the command line arguments, type rp3 -h.

Python interface

import RP3Net as rp3
m = rp3.load_model(rp3.RP3_DEFAULT_CONFIG, '/path/to/checkpoint')
scores = m.predict(['PRTEINWQENCE', 'PRTEIN', 'SQWENCE'])
print(scores)
# tensor([0.4223, 0.4134, 0.4165])
score_map = m.predict({'seq1': 'PRTEINWQENCE', 'seq2': 'PRTEIN', 'seq3': 'SQWENCE'})
print(score_map)
# {'seq1': 0.4223055839538574, 'seq2': 0.41336774826049805, 'seq3': 0.4165498912334442}

The load_model function returns the model object that can be used directly for prediction (predict), and is otherwise a fully functional implementation of a Pytorch module, so can be used for computing gradients and training as well. The predict method accepts either a list of sequences as strings, or a dictionary of sequences keyed by their ids. The return type depends on the input, and is either a one-dimensional tensor or a dictionary of floats. In the former case the order of the scores corresponds to the order of the input sequences, in the latter case the dictionary is keyed by the sequence ids.

Performance and resource usage

The command line verstion on a modern CPU (base frequency 2.6 GHz) for a batch of 16 constructs with length under 500aa runs in about 3 minutes, using under 5Gb of RAM.

Training

Note that installation for inference does not bring in the libraries that are used for training.

Installation

pip install 'RP3Net[training]'

Command line

rp3_train fit -c <training_config_file>

Examples of trainer cofigs can be found under config folder. Training is managed by Pytorch Lightning CLI; more information can be found by typing rp3_train -h

Training data

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

rp3net-0.0.1.tar.gz (35.8 kB view details)

Uploaded Source

Built Distribution

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

rp3net-0.0.1-py3-none-any.whl (33.0 kB view details)

Uploaded Python 3

File details

Details for the file rp3net-0.0.1.tar.gz.

File metadata

  • Download URL: rp3net-0.0.1.tar.gz
  • Upload date:
  • Size: 35.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for rp3net-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c2acf8da6f6307c873da452bbcce8a5178fcbb27ec1686856660c4bac644c921
MD5 1bd77be9cd5308a59c699bb81179ad8e
BLAKE2b-256 c4d45e2194782b9b2102ced5b8a64e890bea12229f2316d62bc9bd65366d76db

See more details on using hashes here.

Provenance

The following attestation bundles were made for rp3net-0.0.1.tar.gz:

Publisher: pypi-publish.yml on RP3Net/RP3Net

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rp3net-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: rp3net-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 33.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for rp3net-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f9354479b3c558960c94984fda9995aac0d0d7818dc45fbb0473c59824996c79
MD5 19fe688d12e4b1fd519664ed5d49fc46
BLAKE2b-256 103bade96ce33dd147943b47cf40047fe6e88289cfb06a22d853393462fd1ee8

See more details on using hashes here.

Provenance

The following attestation bundles were made for rp3net-0.0.1-py3-none-any.whl:

Publisher: pypi-publish.yml on RP3Net/RP3Net

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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