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.
Try it out
The simplest way to run the model inference is to open the Colab notebook, paste the sequeces in FASTA format into the first cell and hit Runtime -> Run All. Use a runtime with a GPU to speed things up.
Docker
Another way to try out the model without disclosing the sequences is via the Docker image: docker pull rp3net/rp3net. The image contains the binary installation of the package, the checkpoint, a Jupyter server and the notebook. It supports CUDA. To run the docker contaier from the command line, using mounts to send the data in and out:
docker run -v /path/to/my/files:/mnt/rp3 rp3net/rp3net rp3 -p rp3net_v0.1_d.ckpt -f /mnt/rp3/sequences.fasta.gz -o /mnt/rp3/scores.csv.gz --log_file /dev/null
To interact with the container via the notebook, run docker run -p 8888:8888 rp3net/rp3net jupyter lab, open http://localhost:8888 in the browser and open rp3_colab.ipynb. There is no need to download the checkpoint and install the dependencies.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rp3net-0.0.2.tar.gz.
File metadata
- Download URL: rp3net-0.0.2.tar.gz
- Upload date:
- Size: 40.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33d260d37edaf392cacaa1aa1999f3b1a6afe73e2486e008f52830c068b34bbf
|
|
| MD5 |
a756809ed66f3f68f84b4866b8b9a42d
|
|
| BLAKE2b-256 |
fb6ea7bb64232bc018b2d12cfc1aa4595d7646dfdc72139e543cfc0fb5e13350
|
Provenance
The following attestation bundles were made for rp3net-0.0.2.tar.gz:
Publisher:
pypi-publish.yml on RP3Net/RP3Net
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rp3net-0.0.2.tar.gz -
Subject digest:
33d260d37edaf392cacaa1aa1999f3b1a6afe73e2486e008f52830c068b34bbf - Sigstore transparency entry: 1781144480
- Sigstore integration time:
-
Permalink:
RP3Net/RP3Net@b374f1204b42def702874d47ba6b64a81f1c06a3 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/RP3Net
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@b374f1204b42def702874d47ba6b64a81f1c06a3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rp3net-0.0.2-py3-none-any.whl.
File metadata
- Download URL: rp3net-0.0.2-py3-none-any.whl
- Upload date:
- Size: 33.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8a6ecf1902e43a3dd1ccf3c579ca97d6f715480c1e58128f0e6fd514c1a1c1e
|
|
| MD5 |
827855d6d64d02a840a1154ea1e1bdca
|
|
| BLAKE2b-256 |
c1a4a293b0f6255fea11058578f0ceaff660e9a09270b2e89e826664871764e4
|
Provenance
The following attestation bundles were made for rp3net-0.0.2-py3-none-any.whl:
Publisher:
pypi-publish.yml on RP3Net/RP3Net
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rp3net-0.0.2-py3-none-any.whl -
Subject digest:
d8a6ecf1902e43a3dd1ccf3c579ca97d6f715480c1e58128f0e6fd514c1a1c1e - Sigstore transparency entry: 1781145117
- Sigstore integration time:
-
Permalink:
RP3Net/RP3Net@b374f1204b42def702874d47ba6b64a81f1c06a3 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/RP3Net
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@b374f1204b42def702874d47ba6b64a81f1c06a3 -
Trigger Event:
push
-
Statement type: