Skip to main content

Set of functions to predict the structure of immune receptor proteins

Project description


ImmuneBuilder: Deep-Learning models for predicting the structures of immune proteins


Abstract

Immune receptor proteins play a key role in the immune system and have shown great promise as biotherapeutics. The structure of these proteins is critical for understanding what antigen they bind. Here, we present ImmuneBuilder, a set of deep learning models trained to accurately predict the structure of antibodies (ABodyBuilder2), nanobodies (NanoBodyBuilder2) and T-Cell receptors (TCRBuilder2). We show that ImmuneBuilder generates structures with state of the art accuracy while being much faster than AlphaFold2. For example, on a benchmark of 34 recently solved antibodies, ABodyBuilder2 predicts CDR-H3 loops with an RMSD of 2.81Å, a 0.09Å improvement over AlphaFold-Multimer, while being over a hundred times faster. Similar results are also achieved for nanobodies (NanoBodyBuilder2 predicts CDR-H3 loops with an average RMSD of 2.89Å, a 0.55Å improvement over AlphaFold2) and TCRs. By predicting an ensemble of structures, ImmuneBuilder also gives an error estimate for every residue in its final prediction.

Install

To install, download from github:

$ git clone https://github.com/brennanaba/ImmuneBuilder.git
$ pip install ImmuneBuilder/

This package requires PyTorch. If you do not already have PyTorch installed, you can do so following these instructions.

It also requires OpenMM and pdbfixer for the refinement step. OpenMM and pdbfixer can be installed via conda using:

$ conda install -c conda-forge openmm pdbfixer

It also uses anarci for trimming and numbering sequences. We recommend installing ANARCI from here, but it can also be installed using (maintained by a third party):

$ conda install -c bioconda anarci

Usage

To test the method out without installing it you can try this Google Colab

Antibody structure prediction

To predict an antibody structure using the python API you can do the following.

from ImmuneBuilder import ABodyBuilder2
predictor = ABodyBuilder2()

output_file = "my_antibody.pdb"
sequences = {
  'H': 'EVQLVESGGGVVQPGGSLRLSCAASGFTFNSYGMHWVRQAPGKGLEWVAFIRYDGGNKYYADSVKGRFTISRDNSKNTLYLQMKSLRAEDTAVYYCANLKDSRYSGSYYDYWGQGTLVTVS',
  'L': 'VIWMTQSPSSLSASVGDRVTITCQASQDIRFYLNWYQQKPGKAPKLLISDASNMETGVPSRFSGSGSGTDFTFTISSLQPEDIATYYCQQYDNLPFTFGPGTKVDFK'}

antibody = predictor.predict(sequences)
antibody.save(output_file)

ABodyBuilder2 can also be used via de command line. To do this you can use:

ABodyBuilder2 --fasta_file my_antibody.fasta -v

You can get information about different options by using:

ABodyBuilder2 --help

I would recommend using the python API if you intend to predict many structures as you only have to load the models once.

Happy antibodies!!

Nanobody structure prediction

The python API for nanobodies is quite similar than for antibodies.

from ImmuneBuilder import NanoBodyBuilder2
predictor = NanoBodyBuilder2()

output_file = "my_nanobody.pdb"
sequence = {'H': 'QVQLVESGGGLVQPGESLRLSCAASGSIFGIYAVHWFRMAPGKEREFTAGFGSHGSTNYAASVKGRFTMSRDNAKNTTYLQMNSLKPADTAVYYCHALIKNELGFLDYWGPGTQVTVSS'}

nanobody = predictor.predict(sequence)
nanobody.save(output_file)

And it can also be used from the command line:

NanoBodyBuilder2 --fasta_file my_nanobody.fasta -v

TCR structure prediction

It is all pretty much the same for TCRs

from ImmuneBuilder import TCRBuilder2
predictor = TCRBuilder2()

output_file = "my_tcr.pdb"
sequences = {
"A": "AQSVTQLGSHVSVSEGALVLLRCNYSSSVPPYLFWYVQYPNQGLQLLLKYTSAATLVKGINGFEAEFKKSETSFHLTKPSAHMSDAAEYFCAVSEQDDKIIFGKGTRLHILP",
"B": "ADVTQTPRNRITKTGKRIMLECSQTKGHDRMYWYRQDPGLGLRLIYYSFDVKDINKGEISDGYSVSRQAQAKFSLSLESAIPNQTALYFCATSDESYGYTFGSGTRLTVV"}

tcr = predictor.predict(sequences)
tcr.save(output_file)

And it can also be used from the command line:

TCRBuilder2 --fasta_file my_tcr.fasta -v

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

ImmuneBuilder-0.0.3.tar.gz (32.5 MB view details)

Uploaded Source

Built Distribution

ImmuneBuilder-0.0.3-py3-none-any.whl (33.2 MB view details)

Uploaded Python 3

File details

Details for the file ImmuneBuilder-0.0.3.tar.gz.

File metadata

  • Download URL: ImmuneBuilder-0.0.3.tar.gz
  • Upload date:
  • Size: 32.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for ImmuneBuilder-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ddf52dbcbff2327abef847c52ea41c2559067443415998e6b9d9a4319f4eb3e4
MD5 49e77288c6d048693091963a845b78ab
BLAKE2b-256 fb259724d7fd557836d7b79f531f35462778b7b37e10bbfc0f990afcee89a041

See more details on using hashes here.

File details

Details for the file ImmuneBuilder-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for ImmuneBuilder-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 42fc37f1b44bacc85cee33095f403401a43fe587b16f0db472aa77fce4d444f9
MD5 81503de1201a090e47adde5533b442db
BLAKE2b-256 9036fa736209f45841978ca31c2cb6567eebc2107e2e348fe3090bbe28eb7ab2

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