Note: SaProt requires structural (SA token) input for optimal performance. AA sequence only mode works but must be finetuned frozen embeddings work only for SA, not AA sequences! With structural input, SaProt surpasses ESM2 in most tasks. We provide two ways to use SaProt, including through huggingface class and through the same way as in esm github. Users can choose either one to use. Huggingface model The following code shows how to load the model. esm model The esm version is also stored in the same folder, named SaProt 650M AF2.pt . We provide a function to load the model. Predict mutational effect We provide a function to predict the mutational effect of a protein sequence. The example below shows how to predict the mutational effect at a specific position. If using the AF2 structure, we strongly recommend that you add pLDDT mask (see below). Get protein embeddings If you want to generate protein embeddings, you could refer to the following code. The embeddings are the average of the hidden states of the last layer. Note frozen SaProt supports SA sequence embeddings but not AA sequence embeddings.
We use cookies for essential functionality and analytics. You can accept or reject analytics cookies.Cookie policy