AlphaFold2 NIM Endpoints
AlphaFold2 NIM provides the following endpoints:
protein-structure/alphafold2/predict-structure-from-sequence- Predict a protein structure given an input amino acid sequence.protein-structure/alphafold2/predict-MSA-from-sequence- Perform a Multiple Sequence Alignment (MSA) and return the MSA and templates for AlphaFold2 inference. This endpoint is useful for batching long-running MSA inference.protein-structure/alphafold2/predict-structure-from-MSA- Perform structural prediction from an input MSA and templates. This is useful when using a pre-computed MSA.
Usage
The three endpoints follow, with requests you can run when the NIM is configured.
Predict Structure From an Input Sequence
The predict-structure-from-sequence provides a full end-to-end structural prediction pipeline. It requires nothing but an input amino acid sequence, though there are many tunable parameters:
sequence: A valid amino acid sequence. Refer to the table of amino acid codes if you are unsure if your sequence is valid.databases: A list containing any of “uniref90”, “mgnify”, and “small_bfd”. These databases contain sequences used to generate a Multiple Sequence Alignment that is used as input to the structural prediction neural network in AlphaFold2. In general, passing all three will provide the most accurate structural prediction at the cost of requiring the longest runtime.algorithm: The algorithm used for Multiple Sequence Alignment. The available options arejackhmmerandmmseqs2.mmseqs2provides significantly improved performance (especially for long sequences), whereas the AlphaFold2 model was trained using the outputs of JackHMMer.e_value: The sequence e-value for filtering sequences in the MSA. Smaller is stricter; fewer sequences will be included, however, this will also reduce the sensitivity of the MSA. The default value is in general a good choice. This value ranges from 0 to 1.bit_score: The sequence bit-score to use for filtering before MSA. If passed, this is used in place of e-value for filtering. A good starting place is around 200. This value is greater than zero.iterations: The number of MSA iterations to perform. In general, the defaultiterations=1is sufficient and takes the least amount of time.relax_prediction: Set to True to run structural relaxation after prediction. This is set to True by default and helps fix clashes in the predicted structure.
Here is an example query for a sequence and a full set of databases using cURL:
Here is the same example, but this time using the Python requests module.
The response is JSON and includes the predicted structure as PDB text. Refer to the PyMOL website for how to view PDB text.
Predict MSA From an Input Sequence
The predict-msa-from-sequence endpoint generates the Multiple Sequence Alignments and templates used for structural prediction.
This is useful if you want to batch prediction on different nodes.
Below is an example query using cURL:
Here is the same query in Python using the requests module:
The predict-msa-from-sequence endpoint takes the following parameters:
sequence: A valid amino acid sequence. Refer to the table of amino acid codes if you are unsure if your sequence is valid.databases: A list containing any of “uniref90”, “mgnify”, and “small_bfd”. These databases contain sequences used to generate a Multiple Sequence Alignment that is used as input to the structural prediction neural network in AlphaFold2. In general, passing all three will provide the most accurate structural prediction at the cost of requiring the longest runtime. If you must pick only one,uniref90is considered the best choice, though it is still recommended to run with all three.algorithm: The algorithm used for Multiple Sequence Alignment. The available options arejackhmmerandmmseqs2.mmseqs2provides significantly improved performance (especially for long sequences), whereas the AlphaFold2 model was trained using the outputs of JackHMMer.e_value: The sequence e-value for filtering sequences in the MSA. Smaller is stricter; fewer sequences will be included, however, this will also reduce the sensitivity of the MSA. The default value is in general a good choice. This value ranges from 0 to 1.bit_score: The sequence bit-score to use for filtering before MSA. If passed, this is used in place of e-value for filtering. A good starting place is around 200. This value is greater than zero.iterations: The number of MSA iterations to perform. In general, the defaultiterations=1is sufficient and takes the least amount of time.
Predict Structure From an Input MSA
The predict-structure-from-msa endpoint takes the results of the predict-msa-from-sequence endpoint and
runs structural prediction.
Do not run the MSA-to-structure prediction with cURL. The inputs include characters that need careful escaping in bash. Use the Python requests module for this endpoint.
The predict-structure-from-msa endpoint takes the following arguments:
sequence: A valid amino acid sequence. Refer to the table of amino acid codes if you are unsure if your sequence is valid.alignments: The MSA results frompredict-msa-from-sequence. This is in a dictionary of tuples of the form{<db name> : {<db name>, <MSA output>, <MSA output format>}}templates: Templates from the structural database search. These use a format specific to AlphaFold2. More details of the fields are in the AlphaFold template parser.relax_prediction: Set to True to run structural relaxation after prediction. This is set to True by default and helps fix clashes in the predicted structure.
Here is an example of a request to the predict-structure-from-msa endpoint using the Python requests module.
The structural prediction module scales quadratically with sequence length. Long sequences can take several hours to predict.