nielsr HF Staff commited on
Commit
dd483e5
·
verified ·
1 Parent(s): 97d71c0

Improve model card and add metadata

Browse files

Hi, I'm Niels from the community science team at Hugging Face. I've updated your model card to include:
- A link to the paper page on the Hugging Face Hub.
- A link to the official GitHub repository.
- Relevant metadata, including the `pipeline_tag: feature-extraction`.

This helps researchers find and cite your work more easily!

Files changed (1) hide show
  1. README.md +21 -21
README.md CHANGED
@@ -1,23 +1,27 @@
1
  ---
2
  license: mit
 
3
  ---
4
 
 
5
 
6
- ## **Overview**
7
 
8
- `AbAffinity` is a Large Languge Model to predict binding affinity of scFv antibody sequence against SARS-CoV-2 HR2 peptide. It takes input of antibody heavy and light chain sequence, and predicts the binding affinity against a peptide in SARS-CoV-2 HR2 peptide. This peptide is common in all the variants of SARS-CoV-2.
9
 
10
- ## **Key Features**
11
 
12
- - Predict Binding Affinity: Given the input antiobdy seqeunce, predict binding affinity
13
 
14
- - Antibody Representation: Given the input antiobdy seqeunce, provide embedding of the antibody. The model gives both residue level representation and sequence level representation.
15
 
16
- - Attention Contact Map: Given the input antibody sequence, AbAffinity will give residue-residue attention maps of the antibody.
 
 
17
 
18
  ## **Installation**
19
 
20
- You can install `AbAffinity` from Huggingface:
21
 
22
  ```bash
23
  pip install git+https://huggingface.co/faisalashraf/abaffinity
@@ -32,7 +36,6 @@ cd abaffinity
32
  pip install .
33
  ```
34
 
35
-
36
  ## **Usage**
37
 
38
  Here's a quick example to get started:
@@ -44,7 +47,8 @@ from abaffinity import AbAffinity
44
  abmodel=AbAffinity()
45
 
46
 
47
- #The model takes complete scFv sequences as input. Heavy and Light chain are connected with a linker sequence. Use make_scFv() method from the model to get the complete scFv seqeunce from heavy chain and light chain sequence.
 
48
 
49
  heavy_seq = 'EVQLVESGAEVKKPGASVKVSCKASGYTFTSYGISWVRQAPGQGLEWMGWISAYNGNTNYAQKLQGRVTMTTDTSTSTAYMELRSLRSDDTAVYYCARVGRGVIDHWGQGTLVTVSS'
50
  light_seq = 'SSELTQDPAVSVALGQTVRITCEGDSLDYYYANWYQQKPGQAPILVIYGKNNRPSGIADRFSGSNSGDTSSLIITGAQAEDEADYYCSSRDSSGFEVTFGAGTKLTVL'
@@ -52,15 +56,13 @@ light_seq = 'SSELTQDPAVSVALGQTVRITCEGDSLDYYYANWYQQKPGQAPILVIYGKNNRPSGIADRFSGSNSG
52
  scFv_seq = abmodel.make_scFv(heavy_seq, light_seq)
53
  print(scFv_seq) # Output: EVQLVESGAEVKKPGASVKVSCKASGYTFTSYGISWVRQAPGQGLEWMGWISAYNGNTNYAQKLQGRVTMTTDTSTSTAYMELRSLRSDDTAVYYCARVGRGVIDHWGQGTLVTVSSGGGGSGGGGSGGGGSSSELTQDPAVSVALGQTVRITCEGDSLDYYYANWYQQKPGQAPILVIYGKNNRPSGIADRFSGSNSGDTSSLIITGAQAEDEADYYCSSRDSSGFEVTFGAGTKLTVL
54
 
55
- #Use `get_affinity()` method to get the predicted binding affinity of the antibody sequence.
56
- #You can pass a list of sequences to get embeddings for all. Make sure that you have enough memory to process the sequences altogether. You can tune the batch size for this purpose. Example: `model.get_affinity(list_sequences, batch_size=16)`. Default batch_size is 4.
57
-
58
  pred_affinity = abmodel.get_affinity(scFv_seq)
59
  print(pred_affinity) # Output: tensor([3.1595])
60
 
61
 
62
- # Use `get_embeddings()` method to get the embeddings for input sequences. Use `mode='res'` to get residue wise embeddings, and `mode='seq'` will give seqeunce embedding.
63
- # You can pass a list of sequences to get embeddings for all. Make sure that you have enough memory to process the sequences altogether. You can tune the batch size for this purpose. Example: `model.get_embeddings(list_sequences, mode='seq', batch_size=16)`. Default batch_size is 4.
64
 
65
  res_emb = abmodel.get_embeddings(scFv_seq, mode='res')
66
  print(res_emb.shape) # Output: torch.Size([258, 1280])
@@ -68,22 +70,20 @@ print(res_emb.shape) # Output: torch.Size([258, 1280])
68
  seq_emb = abmodel.get_embeddings(scFv_seq, mode='seq')
69
  print(seq_emb.shape) # Output: torch.Size([1280])
70
 
71
- # Use `get_contact_map()` method to get the contact maps of the given antibody sequence. It will return a matrix of shape `L x L` where `L` is the length of input sequence. Each value in the matrix represents the contact weight between two residue in the sequence.
72
  # Use `mode='VH-VL'` if you want to plot the contacts for heavy chain and light chain separately, and `mode='scFv'` to plot single contacts for the entire scFv sequence.
73
 
74
  contacts = abmodel.get_contact_map(scFv_seq, mode = 'scFv')
75
- print(contacts.shape) # Output: contact map figure, (240, 240)
76
-
77
  ```
78
 
79
-
80
  ## **License**
81
 
82
- This project is licensed under the MIT License - see the [LICENSE](https://github.com/yourusername/AbAffinity/blob/main/LICENSE) file for details.
83
 
84
  ## **Acknowledgments**
85
 
86
- For citation:
87
 
88
  ```
89
  @article{ashraf2024large,
@@ -94,4 +94,4 @@ For citation:
94
  year={2024},
95
  publisher={Cold Spring Harbor Laboratory}
96
  }
97
- ```
 
1
  ---
2
  license: mit
3
+ pipeline_tag: feature-extraction
4
  ---
5
 
6
+ # AbAffinity
7
 
8
+ This repository contains the model presented in the paper [AbAffinity: A Large Language Model for Predicting Antibody Binding Affinity against SARS-CoV-2](https://huggingface.co/papers/2603.04480).
9
 
10
+ **GitHub Repository**: [ucrbioinfo/AbAffinity](https://github.com/ucrbioinfo/AbAffinity)
11
 
12
+ ## **Overview**
13
 
14
+ `AbAffinity` is a Large Language Model designed to predict the binding affinity of scFv antibody sequences against the SARS-CoV-2 HR2 peptide. It takes the antibody heavy and light chain sequences as input and predicts the binding affinity against a peptide common to all SARS-CoV-2 variants.
15
 
16
+ ## **Key Features**
17
 
18
+ - **Predict Binding Affinity**: Given the input antibody sequence, predict binding affinity.
19
+ - **Antibody Representation**: Provides both residue-level and sequence-level embeddings (representations) of the antibody.
20
+ - **Attention Contact Map**: Generates residue-residue attention maps for the input antibody sequence.
21
 
22
  ## **Installation**
23
 
24
+ You can install `AbAffinity` from Hugging Face:
25
 
26
  ```bash
27
  pip install git+https://huggingface.co/faisalashraf/abaffinity
 
36
  pip install .
37
  ```
38
 
 
39
  ## **Usage**
40
 
41
  Here's a quick example to get started:
 
47
  abmodel=AbAffinity()
48
 
49
 
50
+ # The model takes complete scFv sequences as input. Heavy and Light chain are connected with a linker sequence.
51
+ # Use make_scFv() method from the model to get the complete scFv sequence from heavy chain and light chain sequence.
52
 
53
  heavy_seq = 'EVQLVESGAEVKKPGASVKVSCKASGYTFTSYGISWVRQAPGQGLEWMGWISAYNGNTNYAQKLQGRVTMTTDTSTSTAYMELRSLRSDDTAVYYCARVGRGVIDHWGQGTLVTVSS'
54
  light_seq = 'SSELTQDPAVSVALGQTVRITCEGDSLDYYYANWYQQKPGQAPILVIYGKNNRPSGIADRFSGSNSGDTSSLIITGAQAEDEADYYCSSRDSSGFEVTFGAGTKLTVL'
 
56
  scFv_seq = abmodel.make_scFv(heavy_seq, light_seq)
57
  print(scFv_seq) # Output: EVQLVESGAEVKKPGASVKVSCKASGYTFTSYGISWVRQAPGQGLEWMGWISAYNGNTNYAQKLQGRVTMTTDTSTSTAYMELRSLRSDDTAVYYCARVGRGVIDHWGQGTLVTVSSGGGGSGGGGSGGGGSSSELTQDPAVSVALGQTVRITCEGDSLDYYYANWYQQKPGQAPILVIYGKNNRPSGIADRFSGSNSGDTSSLIITGAQAEDEADYYCSSRDSSGFEVTFGAGTKLTVL
58
 
59
+ # Use `get_affinity()` method to get the predicted binding affinity of the antibody sequence.
 
 
60
  pred_affinity = abmodel.get_affinity(scFv_seq)
61
  print(pred_affinity) # Output: tensor([3.1595])
62
 
63
 
64
+ # Use `get_embeddings()` method to get the embeddings for input sequences.
65
+ # Use `mode='res'` to get residue wise embeddings, and `mode='seq'` will give sequence embedding.
66
 
67
  res_emb = abmodel.get_embeddings(scFv_seq, mode='res')
68
  print(res_emb.shape) # Output: torch.Size([258, 1280])
 
70
  seq_emb = abmodel.get_embeddings(scFv_seq, mode='seq')
71
  print(seq_emb.shape) # Output: torch.Size([1280])
72
 
73
+ # Use `get_contact_map()` method to get the contact maps of the given antibody sequence.
74
  # Use `mode='VH-VL'` if you want to plot the contacts for heavy chain and light chain separately, and `mode='scFv'` to plot single contacts for the entire scFv sequence.
75
 
76
  contacts = abmodel.get_contact_map(scFv_seq, mode = 'scFv')
77
+ print(contacts.shape) # Output: contact map figure, (240, 240)
 
78
  ```
79
 
 
80
  ## **License**
81
 
82
+ This project is licensed under the MIT License.
83
 
84
  ## **Acknowledgments**
85
 
86
+ If you find this work useful, please cite:
87
 
88
  ```
89
  @article{ashraf2024large,
 
94
  year={2024},
95
  publisher={Cold Spring Harbor Laboratory}
96
  }
97
+ ```