FlashABB: modelling antibody structures at the speed of language
Project description
FlashABB: modelling antibody structures at the speed of language
Installation:
pip install flash-abb
Or from source:
git clone git@github.com:oxpig/FlashABB.git
cd FlashABB
pip install .
Structure prediction
The following is also in example.py and can be used to create the structures in sample_preds.
from flash_abb import pretrained
import torch
flabb = pretrained(device='cuda')
# Sequences in heavy|light format
seqs = [
'EVQLLESGGEVKKPGASVKVSCRASGYTFRNYGLTWVRQAPGQGLEWMGWISAYNGNTNYAQKFQGRVTLTTDTSTSTAYMELRSLRSDDTAVYFCARDVPGHGAAFMDVWGTGTTVTVSS|DIQLTQSPLSLPVTLGQPASISCRSSQSLEASDTNIYLSWFQQRPGQSPRRLIYKISNRDSGVPDRFSGSGSGTHFTLRISRVEADDVAVYYCMQGTHWPPAFGQGTKVDIK',
'EVQLLESGGEVKKPGASVKVSCRASGYTFRNYGLTWVRQAPGQGLEWMGWISAYNGNTNYAQKFQGRVTLTTDTSTSTAYMELRSLRSDDTAVYFCARDVPGHGAAFMDVWGTGTTVTVS|DIQLTQSPLSLPVTLGQPASISCRSSQSLEASDTNIYLSWFQQRPGQSPRRLIYKISNRDSGVPDRFSGSGSGTHFTLRISRVEADDVAVYYCMQGTHWPPAFGQGTKVDIK',
]
with torch.no_grad():
result = flabb(seqs)
print(result.coords.shape) # (2, n_residues, 37, 3)
print(result.bb_coords.shape) # (2, n_residues, 4, 3)
result.to_pdbs(['ab1', 'ab2'], pdb_dir='sample_preds')
Developability scoring (FlashTAP)
FlashTAP predicts four TAP developability scores: PSH, PPC, PNC, and SFvCSP.
from flash_abb import pretrained_tap
tap = pretrained_tap(device='cuda')
seqs = [
'EVQLLESGGEVKKPGASVKVSCRASGYTFRNYGLTWVRQAPGQGLEWMGWISAYNGNTNYAQKFQGRVTLTTDTSTSTAYMELRSLRSDDTAVYFCARDVPGHGAAFMDVWGTGTTVTVSS|DIQLTQSPLSLPVTLGQPASISCRSSQSLEASDTNIYLSWFQQRPGQSPRRLIYKISNRDSGVPDRFSGSGSGTHFTLRISRVEADDVAVYYCMQGTHWPPAFGQGTKVDIK',
]
result = tap(seqs)
print(result.scores) # [{'PSH': ..., 'PPC': ..., 'PNC': ..., 'SFvCSP': ...}]
print(result.tensor) # (1, 4) raw score tensor
print(result.flag_probs) # [{'PSH': 0.12, 'PPC': 0.03, 'PNC': 0.05, 'SFvCSP': 0.41}]
print(result.any_flag_prob) # [0.47]
Structure-aware embeddings (FlashABB-SSS)
FlashABB-SSS (seq2struct2seq) produces per-residue embeddings that combine sequence and predicted 3D structure. These can be used as features for downstream tasks.
from flash_abb import pretrained_sss
sss = pretrained_sss(device='cuda')
seqs = [
'EVQLLESGGEVKKPGASVKVSCRASGYTFRNYGLTWVRQAPGQGLEWMGWISAYNGNTNYAQKFQGRVTLTTDTSTSTAYMELRSLRSDDTAVYFCARDVPGHGAAFMDVWGTGTTVTVSS|DIQLTQSPLSLPVTLGQPASISCRSSQSLEASDTNIYLSWFQQRPGQSPRRLIYKISNRDSGVPDRFSGSGSGTHFTLRISRVEADDVAVYYCMQGTHWPPAFGQGTKVDIK',
]
result = sss(seqs)
print(result.embeddings.shape) # (1, n_residues, 128)
print(result.mask.shape) # (1, n_residues)
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 flash_abb-0.0.3.tar.gz.
File metadata
- Download URL: flash_abb-0.0.3.tar.gz
- Upload date:
- Size: 78.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
506012a30feada90961911d29d3b4485b3089df97d2279e58a3f64cea06376a9
|
|
| MD5 |
626fbcdaf3d6c86c1b2c0b798c94a2fd
|
|
| BLAKE2b-256 |
63c4718f7f4ce79148e871a60736a2e2071e6264c610fce320110bad1ab6a324
|
Provenance
The following attestation bundles were made for flash_abb-0.0.3.tar.gz:
Publisher:
publish.yml on oxpig/FlashABB
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flash_abb-0.0.3.tar.gz -
Subject digest:
506012a30feada90961911d29d3b4485b3089df97d2279e58a3f64cea06376a9 - Sigstore transparency entry: 1704136343
- Sigstore integration time:
-
Permalink:
oxpig/FlashABB@b63f789a9a4f55855decfbf678e79ee68fe7023b -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/oxpig
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b63f789a9a4f55855decfbf678e79ee68fe7023b -
Trigger Event:
push
-
Statement type:
File details
Details for the file flash_abb-0.0.3-py3-none-any.whl.
File metadata
- Download URL: flash_abb-0.0.3-py3-none-any.whl
- Upload date:
- Size: 78.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
517bd1057c39d727c548433a37580597631cb24d7cbdce410fe2e9b6f151ab49
|
|
| MD5 |
cc8590bb3698a2eec420cc26c98914e9
|
|
| BLAKE2b-256 |
2b521d4a389b49f2a49997c88b58a42ddcc96d79087c71f576972a637ad28844
|
Provenance
The following attestation bundles were made for flash_abb-0.0.3-py3-none-any.whl:
Publisher:
publish.yml on oxpig/FlashABB
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flash_abb-0.0.3-py3-none-any.whl -
Subject digest:
517bd1057c39d727c548433a37580597631cb24d7cbdce410fe2e9b6f151ab49 - Sigstore transparency entry: 1704136403
- Sigstore integration time:
-
Permalink:
oxpig/FlashABB@b63f789a9a4f55855decfbf678e79ee68fe7023b -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/oxpig
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b63f789a9a4f55855decfbf678e79ee68fe7023b -
Trigger Event:
push
-
Statement type: