Spaces:
Sleeping
Sleeping
| import requests | |
| invoke_url = "https://health.api.nvidia.com/v1/biology/nvidia/esmfold" | |
| from store_pdb import StorePDB_CloudFlare | |
| headers = { | |
| "Authorization": "Bearer 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", | |
| "Accept": "application/json", | |
| } | |
| def Get3D_Structure_of_Protein(sequence_for_structure,filename): | |
| payload = { | |
| "sequence":sequence_for_structure | |
| } | |
| #re-use connections | |
| session = requests.Session() | |
| response = session.post(invoke_url, headers=headers, json=payload) | |
| response.raise_for_status() | |
| response_body = response.json() | |
| if 'pdbs' in response_body: | |
| #return response_body["pdbs"][0]) | |
| Status,URL=StorePDB_CloudFlare(response_body["pdbs"][0],filename) | |
| if Status == True and URL != "": | |
| return URL | |
| else: | |
| return "FATAL" |