Spaces:
Sleeping
Sleeping
Create epitope_prediction.py
Browse files- epitope_prediction.py +35 -0
epitope_prediction.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
def Predict_Epitopes(pdbstring):
|
| 5 |
+
"""
|
| 6 |
+
Query IEDB API for epitope prediction using Emini Surface Accessibility method
|
| 7 |
+
|
| 8 |
+
Args:
|
| 9 |
+
sequence (str): Protein sequence to analyze
|
| 10 |
+
|
| 11 |
+
Returns:
|
| 12 |
+
dict: Response from the IEDB API
|
| 13 |
+
"""
|
| 14 |
+
'''
|
| 15 |
+
url = "http://tools-cluster-interface.iedb.org/tools_api/bcell/"
|
| 16 |
+
|
| 17 |
+
payload = {
|
| 18 |
+
"method": "Emini",
|
| 19 |
+
"sequence_text": sequence
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
response = requests.post(url, data=payload)
|
| 23 |
+
|
| 24 |
+
if response.status_code == 200:
|
| 25 |
+
return response.text
|
| 26 |
+
else:
|
| 27 |
+
raise Exception(f"API request failed: {response.status_code}")
|
| 28 |
+
'''
|
| 29 |
+
|
| 30 |
+
base_url="http://ec2-13-51-44-62.eu-north-1.compute.amazonaws.com:8000/conformationalepitopes"
|
| 31 |
+
response=requests.post(base_url,json={
|
| 32 |
+
"pdb_string":pdbstring
|
| 33 |
+
})
|
| 34 |
+
actualresponse=response.json()
|
| 35 |
+
return actualresponse
|